Thu, 26 Mar 2015 20:34:53 +0100
Fixed Offset label in device editor. Added code to edit pin states for DS2408 and DS2413 1-wire devices.
134
f05601490415
Redesigned the web interface, one single app is too slow. The main dashboard will be a shiny ajax driven page, the setup pages will be simple and php only. Keep It Simple, Stupid.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1 | <?php |
f05601490415
Redesigned the web interface, one single app is too slow. The main dashboard will be a shiny ajax driven page, the setup pages will be simple and php only. Keep It Simple, Stupid.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
2 | /***************************************************************************** |
344
acd840c9fcc0
Fixed Offset label in device editor. Added code to edit pin states for DS2408 and DS2413 1-wire devices.
Michiel Broek <mbroek@mbse.eu>
parents:
252
diff
changeset
|
3 | * Copyright (C) 2014-2015 |
134
f05601490415
Redesigned the web interface, one single app is too slow. The main dashboard will be a shiny ajax driven page, the setup pages will be simple and php only. Keep It Simple, Stupid.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
4 | * |
f05601490415
Redesigned the web interface, one single app is too slow. The main dashboard will be a shiny ajax driven page, the setup pages will be simple and php only. Keep It Simple, Stupid.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
5 | * Michiel Broek <mbroek at mbse dot eu> |
f05601490415
Redesigned the web interface, one single app is too slow. The main dashboard will be a shiny ajax driven page, the setup pages will be simple and php only. Keep It Simple, Stupid.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
6 | * |
f05601490415
Redesigned the web interface, one single app is too slow. The main dashboard will be a shiny ajax driven page, the setup pages will be simple and php only. Keep It Simple, Stupid.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
7 | * This file is part of ThermFerm |
f05601490415
Redesigned the web interface, one single app is too slow. The main dashboard will be a shiny ajax driven page, the setup pages will be simple and php only. Keep It Simple, Stupid.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
8 | * |
f05601490415
Redesigned the web interface, one single app is too slow. The main dashboard will be a shiny ajax driven page, the setup pages will be simple and php only. Keep It Simple, Stupid.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
9 | * This is free software; you can redistribute it and/or modify it |
f05601490415
Redesigned the web interface, one single app is too slow. The main dashboard will be a shiny ajax driven page, the setup pages will be simple and php only. Keep It Simple, Stupid.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
10 | * under the terms of the GNU General Public License as published by the |
f05601490415
Redesigned the web interface, one single app is too slow. The main dashboard will be a shiny ajax driven page, the setup pages will be simple and php only. Keep It Simple, Stupid.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
11 | * Free Software Foundation; either version 2, or (at your option) any |
f05601490415
Redesigned the web interface, one single app is too slow. The main dashboard will be a shiny ajax driven page, the setup pages will be simple and php only. Keep It Simple, Stupid.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
12 | * later version. |
f05601490415
Redesigned the web interface, one single app is too slow. The main dashboard will be a shiny ajax driven page, the setup pages will be simple and php only. Keep It Simple, Stupid.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
13 | * |
f05601490415
Redesigned the web interface, one single app is too slow. The main dashboard will be a shiny ajax driven page, the setup pages will be simple and php only. Keep It Simple, Stupid.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
14 | * ThermFerm is distributed in the hope that it will be useful, but |
f05601490415
Redesigned the web interface, one single app is too slow. The main dashboard will be a shiny ajax driven page, the setup pages will be simple and php only. Keep It Simple, Stupid.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
15 | * WITHOUT ANY WARRANTY; without even the implied warranty of |
f05601490415
Redesigned the web interface, one single app is too slow. The main dashboard will be a shiny ajax driven page, the setup pages will be simple and php only. Keep It Simple, Stupid.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
f05601490415
Redesigned the web interface, one single app is too slow. The main dashboard will be a shiny ajax driven page, the setup pages will be simple and php only. Keep It Simple, Stupid.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
17 | * General Public License for more details. |
f05601490415
Redesigned the web interface, one single app is too slow. The main dashboard will be a shiny ajax driven page, the setup pages will be simple and php only. Keep It Simple, Stupid.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
18 | * |
f05601490415
Redesigned the web interface, one single app is too slow. The main dashboard will be a shiny ajax driven page, the setup pages will be simple and php only. Keep It Simple, Stupid.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
19 | * You should have received a copy of the GNU General Public License |
f05601490415
Redesigned the web interface, one single app is too slow. The main dashboard will be a shiny ajax driven page, the setup pages will be simple and php only. Keep It Simple, Stupid.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
20 | * along with ThermFerm; see the file COPYING. If not, write to the Free |
f05601490415
Redesigned the web interface, one single app is too slow. The main dashboard will be a shiny ajax driven page, the setup pages will be simple and php only. Keep It Simple, Stupid.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
21 | * Software Foundation, 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. |
f05601490415
Redesigned the web interface, one single app is too slow. The main dashboard will be a shiny ajax driven page, the setup pages will be simple and php only. Keep It Simple, Stupid.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
22 | *****************************************************************************/ |
f05601490415
Redesigned the web interface, one single app is too slow. The main dashboard will be a shiny ajax driven page, the setup pages will be simple and php only. Keep It Simple, Stupid.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
23 | |
f05601490415
Redesigned the web interface, one single app is too slow. The main dashboard will be a shiny ajax driven page, the setup pages will be simple and php only. Keep It Simple, Stupid.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
24 | require_once('utilities.php'); |
f05601490415
Redesigned the web interface, one single app is too slow. The main dashboard will be a shiny ajax driven page, the setup pages will be simple and php only. Keep It Simple, Stupid.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
25 | |
174 | 26 | /* |
27 | * $arr contains the complete reply of the LIST BUS command | |
28 | */ | |
196 | 29 | $answer = send_cmd("DEVICE LIST"); |
134
f05601490415
Redesigned the web interface, one single app is too slow. The main dashboard will be a shiny ajax driven page, the setup pages will be simple and php only. Keep It Simple, Stupid.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
30 | $arr = explode("\r\n", $answer); |
f05601490415
Redesigned the web interface, one single app is too slow. The main dashboard will be a shiny ajax driven page, the setup pages will be simple and php only. Keep It Simple, Stupid.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
31 | |
f05601490415
Redesigned the web interface, one single app is too slow. The main dashboard will be a shiny ajax driven page, the setup pages will be simple and php only. Keep It Simple, Stupid.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
32 | |
174 | 33 | if (isset($_GET['action'])) { |
34 | switch ($_GET['action']) { | |
35 | case 'edit': device_edit(); | |
36 | break; | |
37 | default: break; | |
38 | } | |
39 | } elseif (isset($_POST['action'])) { | |
40 | switch ($_POST['action']) { | |
41 | case 'testdata': testdata(); | |
42 | break; | |
43 | default: break; | |
44 | } | |
45 | } else { | |
46 | device_list(); | |
47 | } | |
48 | ||
49 | exit; | |
50 | ||
51 | /**************************************************************************** | |
52 | * | |
53 | */ | |
54 | ||
55 | ||
56 | /* | |
57 | * Device add | |
58 | * | |
252
2197976f2bc5
Device editor uses array commands
Michiel Broek <mbroek@mbse.eu>
parents:
232
diff
changeset
|
59 | * @param string $_POST['Type'] The device type |
2197976f2bc5
Device editor uses array commands
Michiel Broek <mbroek@mbse.eu>
parents:
232
diff
changeset
|
60 | * @param string $_POST['key'] The pressed key |
174 | 61 | */ |
62 | function device_add() { | |
252
2197976f2bc5
Device editor uses array commands
Michiel Broek <mbroek@mbse.eu>
parents:
232
diff
changeset
|
63 | if ($_POST['key'] == 'Add') |
2197976f2bc5
Device editor uses array commands
Michiel Broek <mbroek@mbse.eu>
parents:
232
diff
changeset
|
64 | send_cmd("DEVICE ADD ".$_POST['Type']); |
174 | 65 | unset($_POST['UUID']); |
66 | unset($_POST['Name']); | |
67 | unset($_POST['key']); | |
68 | unset($_POST['command']); | |
69 | load('devices.php'); | |
70 | } | |
71 | ||
72 | ||
73 | ||
74 | /* | |
75 | * Device update | |
76 | * | |
77 | * @param string $_POST['UUID'] The device UUID | |
78 | * @param string $_POST['Type'] The device Type | |
79 | * @param string $_POST['Direction'] The device IO Direction | |
80 | * @param string $_POST['Value'] The device value | |
209
c5b1dfd83e81
Added offset value for sensor that need it
Michiel Broek <mbroek@mbse.eu>
parents:
196
diff
changeset
|
81 | * @param string $_POST['Offset'] The device offset |
174 | 82 | * @param string $_POST['Present'] The device Present state |
83 | * @param string $_POST['Address'] The device Address | |
84 | * @param string $_POST['Subdevice'] The device Subaddress | |
85 | * @param string $_POST['Gpiopin'] The device GPIO pin | |
86 | * @param string $_POST['Description'] The device Description | |
87 | * @param string $_POST['Comment'] The device Comment | |
88 | * @param string $_POST['key'] The button pressed. | |
89 | */ | |
90 | function device_update() { | |
91 | /* | |
92 | * Build the update command | |
93 | */ | |
94 | if ($_POST['key'] == 'Delete') { | |
196 | 95 | send_cmd("DEVICE DEL ".$_POST['UUID']); |
174 | 96 | } |
134
f05601490415
Redesigned the web interface, one single app is too slow. The main dashboard will be a shiny ajax driven page, the setup pages will be simple and php only. Keep It Simple, Stupid.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
97 | |
174 | 98 | if ($_POST['key'] == 'Save') { |
252
2197976f2bc5
Device editor uses array commands
Michiel Broek <mbroek@mbse.eu>
parents:
232
diff
changeset
|
99 | $cmd = array("DEVICE PUT ".$_POST['UUID']); |
2197976f2bc5
Device editor uses array commands
Michiel Broek <mbroek@mbse.eu>
parents:
232
diff
changeset
|
100 | $cmd[] = "TYPE,".$_POST['Type']; |
2197976f2bc5
Device editor uses array commands
Michiel Broek <mbroek@mbse.eu>
parents:
232
diff
changeset
|
101 | $cmd[] = "DIRECTION,".$_POST['Direction']; |
2197976f2bc5
Device editor uses array commands
Michiel Broek <mbroek@mbse.eu>
parents:
232
diff
changeset
|
102 | $cmd[] = "VALUE,".$_POST['Value']; |
2197976f2bc5
Device editor uses array commands
Michiel Broek <mbroek@mbse.eu>
parents:
232
diff
changeset
|
103 | $cmd[] = "OFFSET,".$_POST['Offset']; |
2197976f2bc5
Device editor uses array commands
Michiel Broek <mbroek@mbse.eu>
parents:
232
diff
changeset
|
104 | $cmd[] = "PRESENT,".$_POST['Present']; |
2197976f2bc5
Device editor uses array commands
Michiel Broek <mbroek@mbse.eu>
parents:
232
diff
changeset
|
105 | $cmd[] = "ADDRESS,".$_POST['Address']; |
2197976f2bc5
Device editor uses array commands
Michiel Broek <mbroek@mbse.eu>
parents:
232
diff
changeset
|
106 | $cmd[] = "SUBDEVICE,".$_POST['Subdevice']; |
2197976f2bc5
Device editor uses array commands
Michiel Broek <mbroek@mbse.eu>
parents:
232
diff
changeset
|
107 | $cmd[] = "GPIOPIN,".$_POST['Gpiopin']; |
2197976f2bc5
Device editor uses array commands
Michiel Broek <mbroek@mbse.eu>
parents:
232
diff
changeset
|
108 | $cmd[] = "DESCRIPTION,".$_POST['Description']; |
2197976f2bc5
Device editor uses array commands
Michiel Broek <mbroek@mbse.eu>
parents:
232
diff
changeset
|
109 | $cmd[] = "COMMENT,".$_POST['Comment']; |
2197976f2bc5
Device editor uses array commands
Michiel Broek <mbroek@mbse.eu>
parents:
232
diff
changeset
|
110 | $cmd[] = "."; |
2197976f2bc5
Device editor uses array commands
Michiel Broek <mbroek@mbse.eu>
parents:
232
diff
changeset
|
111 | send_array($cmd); |
174 | 112 | } |
113 | ||
114 | unset($_POST['UUID']); | |
115 | unset($_POST['Type']); | |
116 | unset($_POST['Direction']); | |
117 | unset($_POST['Value']); | |
118 | unset($_POST['Present']); | |
119 | unset($_POST['Address']); | |
120 | unset($_POST['Subdevice']); | |
121 | unset($_POST['Gpiopin']); | |
122 | unset($_POST['Description']); | |
123 | unset($_POST['Comment']); | |
124 | unset($_POST['key']); | |
125 | unset($_POST['command']); | |
126 | load('devices.php'); | |
127 | } | |
128 | ||
129 | ||
130 | ||
131 | /* | |
132 | * Test input of a modified or new device. | |
133 | * | |
134 | * @param string $_POST['UUID'] Unique record UUID | |
135 | * @param string $_POST['Type'] Device Type | |
136 | * @param string $_POST['Direction'] | |
137 | * @param string $_POST['Value'] | |
209
c5b1dfd83e81
Added offset value for sensor that need it
Michiel Broek <mbroek@mbse.eu>
parents:
196
diff
changeset
|
138 | * @param string $_POST['Offset'] |
174 | 139 | * @param string $_POST['Present'] |
140 | * @param string $_POST['Address'] | |
141 | * @param string $_POST['Subdevice'] | |
142 | * @param string $_POST['Gpiopin'] | |
143 | * @param string $_POST['Description'] | |
144 | * @param string $_POST['Comment'] | |
145 | * @param string $_POST['key'] Key choice, Save or Cancel | |
146 | * @param string $_POST['command'] Command used, 'add' or 'update' | |
147 | * | |
148 | * Return: 0 = Ok | |
149 | * 1 = Missing data | |
150 | * 2 = Address field too short | |
151 | * 3 = Address/Subdevice already in use | |
152 | * 4 = Description field too short | |
153 | * 5 = Comment field too short | |
154 | * 99 = Cancel key | |
155 | */ | |
156 | function test_thedata() { | |
157 | ||
158 | global $arr; | |
159 | ||
209
c5b1dfd83e81
Added offset value for sensor that need it
Michiel Broek <mbroek@mbse.eu>
parents:
196
diff
changeset
|
160 | if (isset($_POST['UUID']) && isset($_POST['Type']) && isset($_POST['Direction']) && isset($_POST['Value']) && isset($_POST['Offset']) && |
174 | 161 | isset($_POST['Present']) && isset($_POST['Address']) && isset($_POST['Subdevice']) && isset($_POST['Gpiopin']) && |
162 | isset($_POST['Description']) && isset($_POST['Comment']) && isset($_POST['key']) && isset($_POST['command'])) { | |
163 | ||
164 | if ($_POST['key'] == 'Cancel') | |
165 | return 99; | |
166 | ||
167 | if (strlen($_POST['Address']) < 2) | |
168 | return 2; | |
169 | ||
170 | if (startsWith($arr[0], "212")) { | |
171 | $j = 1; | |
172 | while (1) { | |
173 | if (strcmp($arr[$j], ".") == 0) | |
174 | break; | |
175 | $f = explode(",", $arr[$j]); | |
176 | if (strcmp($f[0], $_POST['UUID']) && ($f[1] == $_POST['Address']) && ($f[2] == $_POST['Subdevice'])) { | |
177 | return 3; | |
178 | } | |
179 | $j++; | |
180 | } | |
181 | } | |
182 | ||
183 | if (strlen($_POST['Description']) < 2) | |
184 | return 4; | |
185 | ||
186 | if (strlen($_POST['Comment']) < 2) | |
187 | return 5; | |
188 | ||
189 | } else { | |
190 | return 1; | |
191 | } | |
192 | ||
193 | return 0; | |
194 | } | |
195 | ||
196 | ||
197 | ||
198 | /* | |
199 | * Test result from edit screen and do next action | |
200 | */ | |
201 | function testdata() { | |
202 | ||
203 | $result = test_thedata(); | |
204 | $error = ''; | |
134
f05601490415
Redesigned the web interface, one single app is too slow. The main dashboard will be a shiny ajax driven page, the setup pages will be simple and php only. Keep It Simple, Stupid.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
205 | |
174 | 206 | switch ($result) { |
207 | case 0: if ($_POST['command'] == 'add') { | |
208 | device_add(); | |
209 | return; | |
210 | } else if ($_POST['command'] == 'update') { | |
211 | device_update(); | |
212 | return; | |
213 | } | |
214 | break; | |
215 | case 1: $error = 'Missing data'; | |
216 | break; | |
217 | case 2: $error = 'The Address is too short'; | |
218 | break; | |
219 | case 3: $error = 'The Address + Subdevice is already in use, choose another one'; | |
220 | break; | |
221 | case 4: $error = 'The Description is too short'; | |
222 | break; | |
223 | case 5: $error = 'The Comment is too short'; | |
224 | break; | |
225 | case 99: | |
226 | load('devices.php'); | |
227 | break; | |
228 | } | |
229 | ||
230 | if ($_POST['command'] == 'add') { | |
231 | $heading = 'ThermFerm - Add Device'; | |
232 | } else { | |
233 | $heading = 'ThermFerm - Edit Device'; | |
234 | } | |
235 | ||
236 | edit_screen($_POST['UUID'], $_POST['command'], $heading, $error); | |
237 | } | |
238 | ||
239 | ||
240 | ||
241 | /* | |
242 | * Unit edit screen. Used by unit_edit(), unit_add() and testdata() | |
243 | * | |
244 | * @param string $UUID The record UUID (fixed). | |
245 | * @param string $command 'add' or 'update' | |
246 | * @param string $heading Page heading title. | |
247 | * @Param string $error_message Blank or previous error. | |
248 | */ | |
249 | function edit_screen($UUID, $command, $heading, $error_message) { | |
250 | ||
196 | 251 | $answer = send_cmd("DEVICE GET ".$UUID); |
174 | 252 | $reply = explode("\r\n", $answer); |
253 | ||
254 | $outstr = build_header($heading); | |
255 | $outstr .= ' <div id="errors">'.PHP_EOL; | |
256 | $outstr .= ' '.$error_message.PHP_EOL; | |
257 | $outstr .= ' </div> <!-- errors -->'.PHP_EOL; | |
258 | $outstr .= ' <div id="etable">'.PHP_EOL; | |
259 | $outstr .= ' <form method="POST" action="devices.php">'.PHP_EOL; | |
260 | $outstr .= ' <table class="editor">'.PHP_EOL; | |
261 | ||
262 | if (startsWith($reply[0], "213")) { | |
263 | $j = 1; | |
264 | while (1) { | |
265 | if (strcmp($reply[$j], ".") == 0) | |
266 | break; | |
267 | $f = explode(",", $reply[$j]); | |
268 | if ($f[0] == "TYPE") { | |
269 | $type = $f[1]; | |
270 | /* | |
271 | * Only allow certain types to edit. Auto detected hardware cannot be changed. | |
272 | */ | |
273 | $outstr .= ' <tr class="editor">'.PHP_EOL; | |
274 | $outstr .= ' <td class="editname">Device Type</td>'.PHP_EOL; | |
344
acd840c9fcc0
Fixed Offset label in device editor. Added code to edit pin states for DS2408 and DS2413 1-wire devices.
Michiel Broek <mbroek@mbse.eu>
parents:
252
diff
changeset
|
275 | if (($type == "W1") || ($type == "GPIO") || ($type == "SIM")) |
174 | 276 | $outstr .= ' <td class="editfield"><input type="hidden" name="Type" value="'.$f[1].'">'.$f[1].'</td>'.PHP_EOL; |
277 | else | |
278 | $outstr .= ' <td class="editfield"><input type="text" name="Type" size="50" value="'.$f[1].'"></td>'.PHP_EOL; | |
279 | $outstr .= ' </tr>'.PHP_EOL; | |
280 | } | |
344
acd840c9fcc0
Fixed Offset label in device editor. Added code to edit pin states for DS2408 and DS2413 1-wire devices.
Michiel Broek <mbroek@mbse.eu>
parents:
252
diff
changeset
|
281 | if ($f[0] == "ADDRESS") { |
acd840c9fcc0
Fixed Offset label in device editor. Added code to edit pin states for DS2408 and DS2413 1-wire devices.
Michiel Broek <mbroek@mbse.eu>
parents:
252
diff
changeset
|
282 | $address = $f[1]; |
acd840c9fcc0
Fixed Offset label in device editor. Added code to edit pin states for DS2408 and DS2413 1-wire devices.
Michiel Broek <mbroek@mbse.eu>
parents:
252
diff
changeset
|
283 | $outstr .= ' <tr class="editor">'.PHP_EOL; |
acd840c9fcc0
Fixed Offset label in device editor. Added code to edit pin states for DS2408 and DS2413 1-wire devices.
Michiel Broek <mbroek@mbse.eu>
parents:
252
diff
changeset
|
284 | $outstr .= ' <td class="editname">Address</td>'.PHP_EOL; |
acd840c9fcc0
Fixed Offset label in device editor. Added code to edit pin states for DS2408 and DS2413 1-wire devices.
Michiel Broek <mbroek@mbse.eu>
parents:
252
diff
changeset
|
285 | if (($type == "W1") || ($type == "GPIO")) |
acd840c9fcc0
Fixed Offset label in device editor. Added code to edit pin states for DS2408 and DS2413 1-wire devices.
Michiel Broek <mbroek@mbse.eu>
parents:
252
diff
changeset
|
286 | $outstr .= ' <td class="editfield"><input type="hidden" name="Address" value="'.$f[1].'">'.$f[1].'</td>'.PHP_EOL; |
acd840c9fcc0
Fixed Offset label in device editor. Added code to edit pin states for DS2408 and DS2413 1-wire devices.
Michiel Broek <mbroek@mbse.eu>
parents:
252
diff
changeset
|
287 | else |
acd840c9fcc0
Fixed Offset label in device editor. Added code to edit pin states for DS2408 and DS2413 1-wire devices.
Michiel Broek <mbroek@mbse.eu>
parents:
252
diff
changeset
|
288 | $outstr .= ' <td class="editfield"><input type="text" name="Address" size="50" value="'.$f[1].'"></td>'.PHP_EOL; |
acd840c9fcc0
Fixed Offset label in device editor. Added code to edit pin states for DS2408 and DS2413 1-wire devices.
Michiel Broek <mbroek@mbse.eu>
parents:
252
diff
changeset
|
289 | $outstr .= ' </tr>'.PHP_EOL; |
acd840c9fcc0
Fixed Offset label in device editor. Added code to edit pin states for DS2408 and DS2413 1-wire devices.
Michiel Broek <mbroek@mbse.eu>
parents:
252
diff
changeset
|
290 | } |
174 | 291 | if ($f[0] == "DIRECTION") { |
292 | $direction = $f[1]; | |
293 | /* | |
294 | * Only devices that cannot auto detect can be changed. | |
295 | */ | |
296 | $outstr .= ' <tr class="editor">'.PHP_EOL; | |
297 | $outstr .= ' <td class="editname">IO Direction and mode</td>'.PHP_EOL; | |
344
acd840c9fcc0
Fixed Offset label in device editor. Added code to edit pin states for DS2408 and DS2413 1-wire devices.
Michiel Broek <mbroek@mbse.eu>
parents:
252
diff
changeset
|
298 | if ($type == "W1") { |
acd840c9fcc0
Fixed Offset label in device editor. Added code to edit pin states for DS2408 and DS2413 1-wire devices.
Michiel Broek <mbroek@mbse.eu>
parents:
252
diff
changeset
|
299 | if ((strncmp($address, "29", 2) == 0) || (strncmp($address, "3a", 2) == 0)) { |
acd840c9fcc0
Fixed Offset label in device editor. Added code to edit pin states for DS2408 and DS2413 1-wire devices.
Michiel Broek <mbroek@mbse.eu>
parents:
252
diff
changeset
|
300 | $outstr .= ' <td class="editfield"><select name="Direction">'.PHP_EOL; |
acd840c9fcc0
Fixed Offset label in device editor. Added code to edit pin states for DS2408 and DS2413 1-wire devices.
Michiel Broek <mbroek@mbse.eu>
parents:
252
diff
changeset
|
301 | $se = ($f[1] == "UNDEF")?" selected":""; |
acd840c9fcc0
Fixed Offset label in device editor. Added code to edit pin states for DS2408 and DS2413 1-wire devices.
Michiel Broek <mbroek@mbse.eu>
parents:
252
diff
changeset
|
302 | $outstr .= ' <option value="UNDEF"'.$se.'>Undefined</option>'.PHP_EOL; |
acd840c9fcc0
Fixed Offset label in device editor. Added code to edit pin states for DS2408 and DS2413 1-wire devices.
Michiel Broek <mbroek@mbse.eu>
parents:
252
diff
changeset
|
303 | $se = ($f[1] == "IN_BIN")?" selected":""; |
acd840c9fcc0
Fixed Offset label in device editor. Added code to edit pin states for DS2408 and DS2413 1-wire devices.
Michiel Broek <mbroek@mbse.eu>
parents:
252
diff
changeset
|
304 | $outstr .= ' <option value="IN_BIN"'.$se.'>Binary input</option>'.PHP_EOL; |
acd840c9fcc0
Fixed Offset label in device editor. Added code to edit pin states for DS2408 and DS2413 1-wire devices.
Michiel Broek <mbroek@mbse.eu>
parents:
252
diff
changeset
|
305 | $se = ($f[1] == "OUT_BIN")?" selected":""; |
acd840c9fcc0
Fixed Offset label in device editor. Added code to edit pin states for DS2408 and DS2413 1-wire devices.
Michiel Broek <mbroek@mbse.eu>
parents:
252
diff
changeset
|
306 | $outstr .= ' <option value="OUT_BIN"'.$se.'>Binary output</option>'.PHP_EOL; |
acd840c9fcc0
Fixed Offset label in device editor. Added code to edit pin states for DS2408 and DS2413 1-wire devices.
Michiel Broek <mbroek@mbse.eu>
parents:
252
diff
changeset
|
307 | $se = ($f[1] == "OUT_PWM")?" selected":""; |
acd840c9fcc0
Fixed Offset label in device editor. Added code to edit pin states for DS2408 and DS2413 1-wire devices.
Michiel Broek <mbroek@mbse.eu>
parents:
252
diff
changeset
|
308 | $outstr .= ' <option value="OUT_PWM"'.$se.'>PWM output</option>'.PHP_EOL; |
acd840c9fcc0
Fixed Offset label in device editor. Added code to edit pin states for DS2408 and DS2413 1-wire devices.
Michiel Broek <mbroek@mbse.eu>
parents:
252
diff
changeset
|
309 | $outstr .= ' </select></td>'.PHP_EOL; |
acd840c9fcc0
Fixed Offset label in device editor. Added code to edit pin states for DS2408 and DS2413 1-wire devices.
Michiel Broek <mbroek@mbse.eu>
parents:
252
diff
changeset
|
310 | } else { |
acd840c9fcc0
Fixed Offset label in device editor. Added code to edit pin states for DS2408 and DS2413 1-wire devices.
Michiel Broek <mbroek@mbse.eu>
parents:
252
diff
changeset
|
311 | $outstr .= ' <td class="editfield"><input type="hidden" name="Direction" value="'.$f[1].'">'.$f[1].'</td>'.PHP_EOL; |
acd840c9fcc0
Fixed Offset label in device editor. Added code to edit pin states for DS2408 and DS2413 1-wire devices.
Michiel Broek <mbroek@mbse.eu>
parents:
252
diff
changeset
|
312 | } |
acd840c9fcc0
Fixed Offset label in device editor. Added code to edit pin states for DS2408 and DS2413 1-wire devices.
Michiel Broek <mbroek@mbse.eu>
parents:
252
diff
changeset
|
313 | } else { |
174 | 314 | $outstr .= ' <td class="editfield"><select name="Direction">'.PHP_EOL; |
315 | if ($type == "GPIO") { | |
316 | $se = ($f[1] == "UNDEF")?" selected":""; | |
317 | $outstr .= ' <option value="UNDEF"'.$se.'>Undefined</option>'.PHP_EOL; | |
318 | $se = ($f[1] == "IN_BIN")?" selected":""; | |
319 | $outstr .= ' <option value="IN_BIN"'.$se.'>Binary input</option>'.PHP_EOL; | |
320 | $se = ($f[1] == "OUT_BIN")?" selected":""; | |
321 | $outstr .= ' <option value="OUT_BIN"'.$se.'>Binary output</option>'.PHP_EOL; | |
322 | $se = ($f[1] == "OUT_PWM")?" selected":""; | |
323 | $outstr .= ' <option value="OUT_PWM"'.$se.'>PWM output</option>'.PHP_EOL; | |
324 | } | |
325 | if ($type == "RC433") { | |
326 | $se = ($f[1] == "UNDEF")?" selected":""; | |
327 | $outstr .= ' <option value="UNDEF"'.$se.'>Undefined</option>'.PHP_EOL; | |
328 | $se = ($f[1] == "OUT_BIN")?" selected":""; | |
329 | $outstr .= ' <option value="OUT_BIN"'.$se.'>Binary output</option>'.PHP_EOL; | |
330 | } | |
331 | if ($type == "DHT") { | |
332 | $se = ($f[1] == "UNDEF")?" selected":""; | |
333 | $outstr .= ' <option value="UNDEF"'.$se.'>Undefined</option>'.PHP_EOL; | |
334 | $se = ($f[1] == "IN_ANALOG")?" selected":""; | |
335 | $outstr .= ' <option value="IN_ANALOG"'.$se.'>Analog input</option>'.PHP_EOL; | |
336 | } | |
252
2197976f2bc5
Device editor uses array commands
Michiel Broek <mbroek@mbse.eu>
parents:
232
diff
changeset
|
337 | if ($type == "I2C") { |
2197976f2bc5
Device editor uses array commands
Michiel Broek <mbroek@mbse.eu>
parents:
232
diff
changeset
|
338 | $se = ($f[1] == "UNDEF")?" selected":""; |
2197976f2bc5
Device editor uses array commands
Michiel Broek <mbroek@mbse.eu>
parents:
232
diff
changeset
|
339 | $outstr .= ' <option value="UNDEF"'.$se.'>Undefined</option>'.PHP_EOL; |
2197976f2bc5
Device editor uses array commands
Michiel Broek <mbroek@mbse.eu>
parents:
232
diff
changeset
|
340 | } |
2197976f2bc5
Device editor uses array commands
Michiel Broek <mbroek@mbse.eu>
parents:
232
diff
changeset
|
341 | if ($type == "SPI") { |
2197976f2bc5
Device editor uses array commands
Michiel Broek <mbroek@mbse.eu>
parents:
232
diff
changeset
|
342 | $se = ($f[1] == "UNDEF")?" selected":""; |
2197976f2bc5
Device editor uses array commands
Michiel Broek <mbroek@mbse.eu>
parents:
232
diff
changeset
|
343 | $outstr .= ' <option value="UNDEF"'.$se.'>Undefined</option>'.PHP_EOL; |
2197976f2bc5
Device editor uses array commands
Michiel Broek <mbroek@mbse.eu>
parents:
232
diff
changeset
|
344 | } |
344
acd840c9fcc0
Fixed Offset label in device editor. Added code to edit pin states for DS2408 and DS2413 1-wire devices.
Michiel Broek <mbroek@mbse.eu>
parents:
252
diff
changeset
|
345 | if ($type == "SIM") { |
acd840c9fcc0
Fixed Offset label in device editor. Added code to edit pin states for DS2408 and DS2413 1-wire devices.
Michiel Broek <mbroek@mbse.eu>
parents:
252
diff
changeset
|
346 | $se = ($f[1] == "UNDEF")?" selected":""; |
acd840c9fcc0
Fixed Offset label in device editor. Added code to edit pin states for DS2408 and DS2413 1-wire devices.
Michiel Broek <mbroek@mbse.eu>
parents:
252
diff
changeset
|
347 | $outstr .= ' <option value="UNDEF"'.$se.'>Undefined</option>'.PHP_EOL; |
acd840c9fcc0
Fixed Offset label in device editor. Added code to edit pin states for DS2408 and DS2413 1-wire devices.
Michiel Broek <mbroek@mbse.eu>
parents:
252
diff
changeset
|
348 | } |
174 | 349 | $outstr .= ' </select></td>'.PHP_EOL; |
350 | } | |
351 | $outstr .= ' </tr>'.PHP_EOL; | |
352 | } | |
353 | if ($f[0] == "VALUE") { | |
354 | /* | |
355 | * Only output can be changed | |
356 | */ | |
357 | $outstr .= ' <tr class="editor">'.PHP_EOL; | |
358 | $outstr .= ' <td class="editname">Value</td>'.PHP_EOL; | |
359 | if (($direction == "OUT_BIN") || ($direction == "OUT_ANALOG") || ($direction == "OUT_PWM")) | |
360 | $outstr .= ' <td class="editfield"><input type="text" name="Value" size="50" value="'.$f[1].'"></td>'.PHP_EOL; | |
361 | else | |
362 | $outstr .= ' <td class="editfield"><input type="hidden" name="Value" value="'.$f[1].'">'.$f[1].'</td>'.PHP_EOL; | |
363 | $outstr .= ' </tr>'.PHP_EOL; | |
364 | } | |
209
c5b1dfd83e81
Added offset value for sensor that need it
Michiel Broek <mbroek@mbse.eu>
parents:
196
diff
changeset
|
365 | if ($f[0] == "OFFSET") { |
c5b1dfd83e81
Added offset value for sensor that need it
Michiel Broek <mbroek@mbse.eu>
parents:
196
diff
changeset
|
366 | $outstr .= ' <tr class="editor">'.PHP_EOL; |
344
acd840c9fcc0
Fixed Offset label in device editor. Added code to edit pin states for DS2408 and DS2413 1-wire devices.
Michiel Broek <mbroek@mbse.eu>
parents:
252
diff
changeset
|
367 | $outstr .= ' <td class="editname">Offset</td>'.PHP_EOL; |
209
c5b1dfd83e81
Added offset value for sensor that need it
Michiel Broek <mbroek@mbse.eu>
parents:
196
diff
changeset
|
368 | if ($direction == "IN_ANALOG") |
c5b1dfd83e81
Added offset value for sensor that need it
Michiel Broek <mbroek@mbse.eu>
parents:
196
diff
changeset
|
369 | $outstr .= ' <td class="editfield"><input type="text" name="Offset" size="50" value="'.$f[1].'"></td>'.PHP_EOL; |
c5b1dfd83e81
Added offset value for sensor that need it
Michiel Broek <mbroek@mbse.eu>
parents:
196
diff
changeset
|
370 | else |
c5b1dfd83e81
Added offset value for sensor that need it
Michiel Broek <mbroek@mbse.eu>
parents:
196
diff
changeset
|
371 | $outstr .= ' <td class="editfield"><input type="hidden" name="Offset" value="'.$f[1].'">'.$f[1].'</td>'.PHP_EOL; |
c5b1dfd83e81
Added offset value for sensor that need it
Michiel Broek <mbroek@mbse.eu>
parents:
196
diff
changeset
|
372 | $outstr .= ' </tr>'.PHP_EOL; |
c5b1dfd83e81
Added offset value for sensor that need it
Michiel Broek <mbroek@mbse.eu>
parents:
196
diff
changeset
|
373 | } |
174 | 374 | if ($f[0] == "PRESENT") { |
375 | /* | |
376 | * Only devices that cannot auto detect can be changed. | |
377 | */ | |
378 | $outstr .= ' <tr class="editor">'.PHP_EOL; | |
379 | $outstr .= ' <td class="editname">Device Present</td>'.PHP_EOL; | |
380 | if (($type == "W1") || ($type == "GPIO")) | |
381 | $outstr .= ' <td class="editfield"><input type="hidden" name="Present" value="'.$f[1].'">'.$f[1].'</td>'.PHP_EOL; | |
382 | else { | |
383 | $outstr .= ' <td class="editfield"><select name="Present">'.PHP_EOL; | |
384 | $se = ($f[1] == "UNDEF")?" selected":""; | |
385 | $outstr .= ' <option value="UNDEF"'.$se.'>Undefined</option>'.PHP_EOL; | |
386 | $se = ($f[1] == "NO")?" selected":""; | |
387 | $outstr .= ' <option value="NO"'.$se.'>Not present</option>'.PHP_EOL; | |
388 | $se = ($f[1] == "YES")?" selected":""; | |
389 | $outstr .= ' <option value="YES"'.$se.'>Present and Ok</option>'.PHP_EOL; | |
390 | $se = ($f[1] == "ERROR")?" selected":""; | |
391 | $outstr .= ' <option value="ERROR"'.$se.'>Present and Error</option>'.PHP_EOL; | |
392 | $outstr .= ' </select></td>'.PHP_EOL; | |
393 | } | |
394 | $outstr .= ' </tr>'.PHP_EOL; | |
395 | } | |
396 | if ($f[0] == "SUBDEVICE") { | |
397 | $outstr .= ' <tr class="editor">'.PHP_EOL; | |
398 | $outstr .= ' <td class="editname">Subdevice</td>'.PHP_EOL; | |
399 | if (($type == "W1") || ($type == "GPIO")) | |
400 | $outstr .= ' <td class="editfield"><input type="hidden" name="Subdevice" value="'.$f[1].'">'.$f[1].'</td>'.PHP_EOL; | |
401 | else | |
402 | $outstr .= ' <td class="editfield"><input type="text" name="Subdevice" size="5" value="'.$f[1].'"></td>'.PHP_EOL; | |
403 | $outstr .= ' </tr>'.PHP_EOL; | |
404 | } | |
405 | if ($f[0] == "GPIOPIN") { | |
406 | $outstr .= ' <tr class="editor">'.PHP_EOL; | |
407 | $outstr .= ' <td class="editname">GPIO pin</td>'.PHP_EOL; | |
408 | $outstr .= ' <td class="editfield"><input type="text" name="Gpiopin" size="5" value="'.$f[1].'"></td>'.PHP_EOL; | |
409 | $outstr .= ' </tr>'.PHP_EOL; | |
410 | } | |
411 | if ($f[0] == "DESCRIPTION") { | |
412 | $outstr .= ' <tr class="editor">'.PHP_EOL; | |
413 | $outstr .= ' <td class="editname">Description</td>'.PHP_EOL; | |
414 | $outstr .= ' <td class="editfield"><input type="text" name="Description" size="50" value="'.$f[1].'"></td>'.PHP_EOL; | |
415 | $outstr .= ' </tr>'.PHP_EOL; | |
416 | } | |
417 | if ($f[0] == "COMMENT") { | |
418 | $outstr .= ' <tr class="editor">'.PHP_EOL; | |
419 | $outstr .= ' <td class="editname">Comment</td>'.PHP_EOL; | |
420 | $outstr .= ' <td class="editfield"><input type="text" name="Comment" size="50" value="'.$f[1].'"></td>'.PHP_EOL; | |
421 | $outstr .= ' </tr>'.PHP_EOL; | |
422 | } | |
423 | $j++; | |
424 | } | |
425 | } | |
426 | ||
427 | $outstr .= ' <tr class="editor">'.PHP_EOL; | |
428 | $outstr .= ' <td class="editname"><input type="submit" value="Save" name="key"></td>'.PHP_EOL; | |
429 | $outstr .= ' <td class="editfield"><input type="submit" value="Cancel" name="key">'; | |
430 | $outstr .= '<input type="submit" value="Delete" name="key" style="margin-left: 100px;">'; | |
431 | $outstr .= '<input type="hidden" value="testdata" name="action">'; | |
432 | $outstr .= '<input type="hidden" value="'.$command.'" name="command">'; | |
433 | $outstr .= '<input type="hidden" value="'.$UUID.'" name="UUID"></td>'.PHP_EOL; | |
434 | $outstr .= ' </tr>'.PHP_EOL; | |
435 | $outstr .= ' </table>'.PHP_EOL; | |
436 | $outstr .= ' </form>'.PHP_EOL; | |
437 | $outstr .= ' </div> <!-- etable -->'.PHP_EOL; | |
438 | $outstr .= build_footer(); | |
439 | echo $outstr; | |
440 | } | |
441 | ||
442 | ||
443 | ||
444 | /* | |
445 | * Edit a Device. Fetches the record data and shows the edit screen. | |
446 | * | |
447 | * @param string $_GET['action'] Must be 'edit'. | |
448 | * @param string $_GET['UUID'] The UUID of the Unit. | |
449 | */ | |
450 | function device_edit() { | |
451 | if ($_GET['action'] == 'edit') { | |
452 | edit_screen($_GET['UUID'], 'update', 'ThermFerm - Edit Device', ''); | |
453 | return; | |
454 | } else { | |
455 | load('devices.php'); | |
134
f05601490415
Redesigned the web interface, one single app is too slow. The main dashboard will be a shiny ajax driven page, the setup pages will be simple and php only. Keep It Simple, Stupid.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
456 | } |
f05601490415
Redesigned the web interface, one single app is too slow. The main dashboard will be a shiny ajax driven page, the setup pages will be simple and php only. Keep It Simple, Stupid.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
457 | } |
f05601490415
Redesigned the web interface, one single app is too slow. The main dashboard will be a shiny ajax driven page, the setup pages will be simple and php only. Keep It Simple, Stupid.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
458 | |
174 | 459 | |
460 | ||
461 | /* | |
462 | * @link edit device | |
463 | * @link add device | |
464 | */ | |
465 | function device_list() { | |
466 | global $arr; | |
467 | ||
468 | $outstr = build_header("ThermFerm - Devices Setup"); | |
469 | $outstr .= ' <div id="errors">'.PHP_EOL; | |
470 | $outstr .= ' </div> <!-- errors -->'.PHP_EOL; | |
471 | $outstr .= ' <div id="etable">'.PHP_EOL; | |
472 | $outstr .= ' <table class="setup">'.PHP_EOL; | |
473 | $outstr .= ' <tr class="trhead">'.PHP_EOL; | |
474 | $outstr .= ' <td class="setup" style="width: 300px;">UUID</td>'.PHP_EOL; | |
475 | $outstr .= ' <td class="setup" style="width: 120px;">Address</td>'.PHP_EOL; | |
476 | $outstr .= ' <td class="setup" style="width: 30px;">Sub</td>'.PHP_EOL; | |
477 | $outstr .= ' <td class="setup" style="width: 30px;">Ref</td>'.PHP_EOL; | |
478 | $outstr .= ' <td class="setup" style="width: 300px;">Cmt</td>'.PHP_EOL; | |
479 | $outstr .= ' <td class="setup" style="width: 35px;">Edit</td>'.PHP_EOL; | |
480 | $outstr .= ' </tr>'.PHP_EOL; | |
134
f05601490415
Redesigned the web interface, one single app is too slow. The main dashboard will be a shiny ajax driven page, the setup pages will be simple and php only. Keep It Simple, Stupid.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
481 | |
174 | 482 | if (startsWith($arr[0], "212")) { |
483 | $j = 1; | |
484 | while (1) { | |
485 | if (strcmp($arr[$j], ".") == 0) | |
486 | break; | |
487 | $f = explode(",", $arr[$j]); | |
488 | $outstr .= ' <tr class="setup">'.PHP_EOL; | |
489 | $outstr .= ' <td class="setup">'.$f[0].'</td>'.PHP_EOL; | |
490 | $outstr .= ' <td class="setup">'.$f[1].'</td>'.PHP_EOL; | |
491 | $outstr .= ' <td class="setup">'.$f[2].'</td>'.PHP_EOL; | |
492 | $outstr .= ' <td class="setup">'.$f[3].'</td>'.PHP_EOL; | |
493 | $outstr .= ' <td class="setup">'.$f[4].'</td>'.PHP_EOL; | |
494 | if ($f[3] == 0) | |
495 | $outstr .= ' <td class="setup"><a href="devices.php?action=edit&UUID='.$f[0].'">Edit</a></td>'.PHP_EOL; | |
496 | else | |
497 | $outstr .= ' <td class="setup">Busy</td>'.PHP_EOL; | |
498 | $outstr .= ' </tr>'.PHP_EOL; | |
499 | $j++; | |
500 | } | |
501 | } | |
502 | ||
503 | $outstr .= ' </table>'.PHP_EOL; | |
504 | $outstr .= ' </div> <!-- etable -->'.PHP_EOL; | |
134
f05601490415
Redesigned the web interface, one single app is too slow. The main dashboard will be a shiny ajax driven page, the setup pages will be simple and php only. Keep It Simple, Stupid.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
505 | |
174 | 506 | $outstr .= ' <div id="atable">'.PHP_EOL; |
507 | $outstr .= ' <form method="POST" action="devices.php">'.PHP_EOL; | |
508 | $outstr .= ' <table class="editor">'.PHP_EOL; | |
509 | $outstr .= ' <tr class="trhead"><td colspan="3">Add new Device</td></tr>'.PHP_EOL; | |
510 | $outstr .= ' <tr class="editor">'.PHP_EOL; | |
511 | $outstr .= ' <td class="editname">Select Device type</td>'.PHP_EOL; | |
512 | $outstr .= ' <td class="editfield">'.PHP_EOL; | |
513 | $outstr .= ' <select name="Type">'.PHP_EOL; | |
514 | $outstr .= ' <option value="NA">Not Available</option>'.PHP_EOL; | |
515 | $outstr .= ' <option value="RC433">433 Mhz Radio Controller</option>'.PHP_EOL; | |
516 | $outstr .= ' <option value="DHT">DHTnn type sensor</option>'.PHP_EOL; | |
517 | $outstr .= ' <option value="I2C">I2C bus device</option>'.PHP_EOL; | |
518 | $outstr .= ' <option value="SPI">SPI bus device</option>'.PHP_EOL; | |
519 | $outstr .= ' </select>'.PHP_EOL; | |
520 | $outstr .= ' </td>'.PHP_EOL; | |
521 | $outstr .= ' <td class="editsub"><input type="submit" value="Add" name="key"></td>'.PHP_EOL; | |
522 | $outstr .= '<input type="hidden" value="testdata" name="action">'; | |
523 | $outstr .= '<input type="hidden" value="add" name="command">'; | |
524 | $outstr .= '<input type="hidden" value="00000000-0000-0000-0000-000000000000" name="UUID">'; | |
525 | $outstr .= '<input type="hidden" value="UNDEF" name="Direction">'; | |
526 | $outstr .= '<input type="hidden" value="0" name="Value">'; | |
232 | 527 | $outstr .= '<input type="hidden" value="0" name="Offset">'; |
174 | 528 | $outstr .= '<input type="hidden" value="UNDEF" name="Present">'; |
529 | $outstr .= '<input type="hidden" value="address unknown" name="Address">'; | |
530 | $outstr .= '<input type="hidden" value="0" name="Subdevice">'; | |
531 | $outstr .= '<input type="hidden" value="-1" name="Gpiopin">'; | |
532 | $outstr .= '<input type="hidden" value="Describe me" name="Description">'; | |
533 | $outstr .= '<input type="hidden" value="Comment me" name="Comment">'; | |
534 | $outstr .= ' </tr>'.PHP_EOL; | |
535 | $outstr .= ' </table>'.PHP_EOL; | |
536 | $outstr .= ' </form>'.PHP_EOL; | |
537 | $outstr .= ' </div> <!-- atable -->'.PHP_EOL; | |
538 | ||
539 | $outstr .= build_footer(); | |
540 | ||
541 | echo $outstr; | |
542 | } | |
543 |