www-thermferm/profiles.php

changeset 397
00ca08f5a6f8
parent 379
50675fd80fed
child 399
2f472a9081c9
equal deleted inserted replaced
396:66d4e137b99d 397:00ca08f5a6f8
20 * along with ThermFerm; see the file COPYING. If not, write to the Free 20 * along with ThermFerm; see the file COPYING. If not, write to the Free
21 * Software Foundation, 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. 21 * Software Foundation, 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
22 *****************************************************************************/ 22 *****************************************************************************/
23 23
24 require_once('utilities.php'); 24 require_once('utilities.php');
25 $my_style = 'ui-redmond';
26
25 27
26 /* 28 /*
27 * Each time this page is loaded, get the profiles from the server. 29 * Each time this page is loaded, get the profiles from the server.
28 * $arr contains the complete reply of he PROFILE LIST command. 30 * $arr contains the complete reply of he PROFILE LIST command.
29 */ 31 */
66 68
67 /* 69 /*
68 * $steps contains all steps of a profile 70 * $steps contains all steps of a profile
69 */ 71 */
70 $steps = array ( 72 $steps = array (
71 1 => array("steptime" => 0, "resttime" => 0, "target" => 20.0 ), 73 1 => array("steptime" => 0, "resttime" => 0, "target_lo" => 19.8, "target_hi" => 20.2, "fridge_mode" => 0 ),
72 2 => array("steptime" => 0, "resttime" => 0, "target" => 20.0 ), 74 2 => array("steptime" => 0, "resttime" => 0, "target_lo" => 19.8, "target_hi" => 20.2, "fridge_mode" => 0 ),
73 3 => array("steptime" => 0, "resttime" => 0, "target" => 20.0 ), 75 3 => array("steptime" => 0, "resttime" => 0, "target_lo" => 19.8, "target_hi" => 20.2, "fridge_mode" => 0 ),
74 4 => array("steptime" => 0, "resttime" => 0, "target" => 20.0 ), 76 4 => array("steptime" => 0, "resttime" => 0, "target_lo" => 19.8, "target_hi" => 20.2, "fridge_mode" => 0 ),
75 5 => array("steptime" => 0, "resttime" => 0, "target" => 20.0 ), 77 5 => array("steptime" => 0, "resttime" => 0, "target_lo" => 19.8, "target_hi" => 20.2, "fridge_mode" => 0 ),
76 6 => array("steptime" => 0, "resttime" => 0, "target" => 20.0 ), 78 6 => array("steptime" => 0, "resttime" => 0, "target_lo" => 19.8, "target_hi" => 20.2, "fridge_mode" => 0 ),
77 7 => array("steptime" => 0, "resttime" => 0, "target" => 20.0 ), 79 7 => array("steptime" => 0, "resttime" => 0, "target_lo" => 19.8, "target_hi" => 20.2, "fridge_mode" => 0 ),
78 8 => array("steptime" => 0, "resttime" => 0, "target" => 20.0 ), 80 8 => array("steptime" => 0, "resttime" => 0, "target_lo" => 19.8, "target_hi" => 20.2, "fridge_mode" => 0 ),
79 ); 81 );
80 82
81 $answer = send_cmd("PROFILE GETS ".$UUID); 83 $answer = send_cmd("PROFILE GETS ".$UUID);
82 $psteps = explode("\r\n", $answer); 84 $psteps = explode("\r\n", $answer);
83 85
87 if (strcmp($psteps[$j], ".") == 0) 89 if (strcmp($psteps[$j], ".") == 0)
88 break; 90 break;
89 $f = explode(",", $psteps[$j]); 91 $f = explode(",", $psteps[$j]);
90 $steps[$j]["steptime"] = $f[0]; 92 $steps[$j]["steptime"] = $f[0];
91 $steps[$j]["resttime"] = $f[1]; 93 $steps[$j]["resttime"] = $f[1];
92 $steps[$j]["target"] = $f[2]; 94 $steps[$j]["target_lo"] = $f[2];
95 $steps[$j]["target_hi"] = $f[3];
96 $steps[$j]["fridge_mode"] = $f[4];
93 $j++; 97 $j++;
94 } 98 }
95 } 99 }
96 100
97 edit_steps($UUID, $steps, "", "ThermFerm - Edit Profile Steps"); 101 edit_steps($UUID, $steps, "", "ThermFerm - Edit Profile Steps");
109 $outstr .= ' <table class="editor">'.PHP_EOL; 113 $outstr .= ' <table class="editor">'.PHP_EOL;
110 $outstr .= ' <tr class="trhead">'.PHP_EOL; 114 $outstr .= ' <tr class="trhead">'.PHP_EOL;
111 $outstr .= ' <td>Step</td>'.PHP_EOL; 115 $outstr .= ' <td>Step</td>'.PHP_EOL;
112 $outstr .= ' <td>Steptime</td>'.PHP_EOL; 116 $outstr .= ' <td>Steptime</td>'.PHP_EOL;
113 $outstr .= ' <td>Resttime</td>'.PHP_EOL; 117 $outstr .= ' <td>Resttime</td>'.PHP_EOL;
114 $outstr .= ' <td>Temperature</td>'.PHP_EOL; 118 $outstr .= ' <td>Temp low</td>'.PHP_EOL;
119 $outstr .= ' <td>Temp high</td>'.PHP_EOL;
120 $outstr .= ' <td>Fridge mode</td>'.PHP_EOL;
115 $outstr .= ' </tr>'.PHP_EOL; 121 $outstr .= ' </tr>'.PHP_EOL;
116 122
117 for ($i = 1; $i <= 8; $i++) { 123 for ($i = 1; $i <= 8; $i++) {
118 $outstr .= ' <tr class="editor">'.PHP_EOL; 124 $outstr .= ' <tr class="editor">'.PHP_EOL;
119 $outstr .= ' <td>Step '.$i.'</td>'.PHP_EOL; 125 $outstr .= ' <td>Step '.$i.'</td>'.PHP_EOL;
120 $outstr .= ' <td><input type="text" name="steptime'.$i.'" size="4" value="'.$steps[$i]["steptime"].'"></td>'.PHP_EOL; 126 $outstr .= ' <td><input type="text" name="steptime'.$i.'" size="4" value="'.$steps[$i]["steptime"].'"></td>'.PHP_EOL;
121 $outstr .= ' <td><input type="text" name="resttime'.$i.'" size="4" value="'.$steps[$i]["resttime"].'"></td>'.PHP_EOL; 127 $outstr .= ' <td><input type="text" name="resttime'.$i.'" size="4" value="'.$steps[$i]["resttime"].'"></td>'.PHP_EOL;
122 $outstr .= ' <td><input type="text" name="target'.$i.'" size="4" value="'.$steps[$i]["target"].'"></td>'.PHP_EOL; 128 $outstr .= ' <td><input type="text" name="target_lo'.$i.'" size="4" value="'.$steps[$i]["target_lo"].'"></td>'.PHP_EOL;
129 $outstr .= ' <td><input type="text" name="target_hi'.$i.'" size="4" value="'.$steps[$i]["target_hi"].'"></td>'.PHP_EOL;
130 $outstr .= ' <td><input type="hidden" name="fridge_mode'.$i.'" value="0"><input type="checkbox" name="fridge_mode'.$i.'" value="1"';
131 if ($steps[$i]["fridge_mode"] == 1)
132 $outstr .= ' checked';
133 $outstr .= '></td>'.PHP_EOL;
123 $outstr .= ' </tr>'.PHP_EOL; 134 $outstr .= ' </tr>'.PHP_EOL;
124 } 135 }
125 136
126 $outstr .= ' <tr class="editor">'.PHP_EOL; 137 $outstr .= ' <tr class="editor">'.PHP_EOL;
127 $outstr .= ' <td class="editname">&nbsp;</td>'.PHP_EOL; 138 $outstr .= ' <td class="editname">&nbsp;</td>'.PHP_EOL;
141 $outstr .= ' Steps are valid if the steptime or resttime is greater then zero.'.PHP_EOL; 152 $outstr .= ' Steps are valid if the steptime or resttime is greater then zero.'.PHP_EOL;
142 $outstr .= ' Order is important.'.PHP_EOL; 153 $outstr .= ' Order is important.'.PHP_EOL;
143 $outstr .= ' Lines with a zero steptime and zero resttime are ignored.'.PHP_EOL; 154 $outstr .= ' Lines with a zero steptime and zero resttime are ignored.'.PHP_EOL;
144 $outstr .= ' The step- and resttimes are in hours.'.PHP_EOL; 155 $outstr .= ' The step- and resttimes are in hours.'.PHP_EOL;
145 $outstr .= ' </div> <!-- atable -->'.PHP_EOL; 156 $outstr .= ' </div> <!-- atable -->'.PHP_EOL;
157 $outstr .= ' <script type="text/javascript">'.PHP_EOL;
158 $outstr .= ' $(document).ready(function () {'.PHP_EOL;
159 $outstr .= ' $("#maintenance").jqxButton({ width: 150, height: 25, theme: \'ui-redmond\' });'.PHP_EOL;
160 $outstr .= ' });'.PHP_EOL;
161 $outstr .= ' </script>'.PHP_EOL;
146 $outstr .= build_footer(); 162 $outstr .= build_footer();
147 echo $outstr; 163 echo $outstr;
148 } 164 }
149 165
150 166
173 /* 189 /*
174 * Profile update or delete 190 * Profile update or delete
175 * 191 *
176 * @param string $_POST['UUID'] The profile UUID 192 * @param string $_POST['UUID'] The profile UUID
177 * @param string $_POST['Name'] The profile name 193 * @param string $_POST['Name'] The profile name
178 * @param string $_POST['Inittemp'] The profile initial temperature 194 * @param string $_POST['Inittemp_lo'] The profile initial temperature low
195 * @param string $_POST['Inittemp_hi'] The profile initial temperature high
196 * @param string $_POST['Fridge_mode'] The profile fridge/beer mode
179 * @param string $_POST['key'] The button pressed. 197 * @param string $_POST['key'] The button pressed.
180 */ 198 */
181 function profile_update() { 199 function profile_update() {
182 /* 200 /*
183 * Build the update command 201 * Build the update command
187 } 205 }
188 206
189 if ($_POST['key'] == 'Save') { 207 if ($_POST['key'] == 'Save') {
190 $cmd = array("PROFILE PUT ".$_POST['UUID']); 208 $cmd = array("PROFILE PUT ".$_POST['UUID']);
191 $cmd[] = "NAME,".$_POST['Name']; 209 $cmd[] = "NAME,".$_POST['Name'];
192 $cmd[] = "INITTEMP,".$_POST['Inittemp']; 210 $cmd[] = "INITTEMP_LO,".$_POST['Inittemp_lo'];
211 $cmd[] = "INITTEMP_HI,".$_POST['Inittemp_hi'];
212 $cmd[] = "FRIDGE_MODE,".$_POST['Fridge_mode'];
193 $cmd[] = "."; 213 $cmd[] = ".";
194 send_array($cmd); 214 send_array($cmd);
195 } 215 }
196 216
197 unset($_POST['UUID']); 217 unset($_POST['UUID']);
198 unset($_POST['Name']); 218 unset($_POST['Name']);
199 unset($_POST['Inittemp']); 219 unset($_POST['Inittemp_lo']);
220 unset($_POST['Inittemp_hi']);
221 unset($_POST['Fridge_mode']);
200 unset($_POST['key']); 222 unset($_POST['key']);
201 unset($_POST['command']); 223 unset($_POST['command']);
202 load('profiles.php'); 224 load('profiles.php');
203 } 225 }
204 226
208 * Test input of a modified or new profile. 230 * Test input of a modified or new profile.
209 * 231 *
210 * @param string $_POST['UUID'] Unique record UUID 232 * @param string $_POST['UUID'] Unique record UUID
211 * @param int $_POST['steptime'n] Profile steptime 233 * @param int $_POST['steptime'n] Profile steptime
212 * @param int $_POST['resttime'n] Profile resttime 234 * @param int $_POST['resttime'n] Profile resttime
213 * @param float $_POST['target'n] Profile target temperature 235 * @param float $_POST['target_lo'n] Profile target temperature low
236 * @param float $_POST['target_hi'n] Profile target temperature high
237 * @param int $_POST['fridge_mode'n] Profile fridge mode
214 * @param string $_POST['key'] Key choice, Save or Cancel 238 * @param string $_POST['key'] Key choice, Save or Cancel
215 * 239 *
216 * Return: 0 = Ok 240 * Return: 0 = Ok
217 * 1 = Missing data 241 * 1 = Missing data
218 * 3 = A target temperature out of range 242 * 3 = A target temperature out of range
221 function test_thesteps() { 245 function test_thesteps() {
222 246
223 global $arr; 247 global $arr;
224 248
225 for ($i = 1; $i <= 8; $i++) { 249 for ($i = 1; $i <= 8; $i++) {
226 if ((! isset($_POST['steptime'.$i])) || (! isset($_POST['resttime'.$i])) || (! isset($_POST['target'.$i]))) 250 if ((! isset($_POST['steptime'.$i])) || (! isset($_POST['resttime'.$i])) || (! isset($_POST['target_lo'.$i])) || (! isset($_POST['target_hi'.$i])) || (! isset($_POST['fridge_mode'.$i])))
227 return 1; 251 return 1;
228 if ((strlen($_POST['steptime'.$i]) == 0) || (strlen($_POST['resttime'.$i]) == 0) || (strlen($_POST['target'.$i]) == 0)) 252 if ((strlen($_POST['steptime'.$i]) == 0) || (strlen($_POST['resttime'.$i]) == 0) || (strlen($_POST['target_lo'.$i]) == 0) || (strlen($_POST['target_hi'.$i]) == 0) || (strlen($_POST['fridge_mode'.$i]) == 0))
229 return 1; 253 return 1;
230 } 254 }
231 255
232 if (isset($_POST['UUID']) && isset($_POST['key'])) { 256 if (isset($_POST['UUID']) && isset($_POST['key'])) {
233 257
234 if ($_POST['key'] == 'Cancel') 258 if ($_POST['key'] == 'Cancel')
235 return 99; 259 return 99;
236 260
237 for ($i = 1; $i <= 8; $i++) { 261 for ($i = 1; $i <= 8; $i++) {
238 262
239 if (($_POST['target'.$i] < -5) || ($_POST['target'.$i] > 30)) 263 if (($_POST['target_lo'.$i] < -5) || ($_POST['target_lo'.$i] > 30))
240 return 3; 264 return 3;
265 if (($_POST['target_hi'.$i] < -5) || ($_POST['target_hi'.$i] > 30))
266 return 3;
267 if ($_POST['target_lo'.$i] > $_POST['target_hi'.$i])
268 return 3;
241 } 269 }
242 } else { 270 } else {
243 return 1; 271 return 1;
244 } 272 }
245 273
258 286
259 switch ($result) { 287 switch ($result) {
260 case 0: $cmd = array("PROFILE PUTS ".$_POST['UUID']); 288 case 0: $cmd = array("PROFILE PUTS ".$_POST['UUID']);
261 for ($i = 1; $i <= 8; $i++) { 289 for ($i = 1; $i <= 8; $i++) {
262 if (($_POST['steptime'.$i] > 0) || ($_POST['resttime'.$i] > 0)) { 290 if (($_POST['steptime'.$i] > 0) || ($_POST['resttime'.$i] > 0)) {
263 $cmd[] = $_POST['steptime'.$i].','.$_POST['resttime'.$i].','.$_POST['target'.$i]; 291 $cmd[] = $_POST['steptime'.$i].','.$_POST['resttime'.$i].','.$_POST['target_lo'.$i].','.$_POST['target_hi'.$i].','.$_POST['fridge_mode'.$i];
264 } 292 }
265 unset($_POST['steptime'.$i]); 293 unset($_POST['steptime'.$i]);
266 unset($_POST['resttime'.$i]); 294 unset($_POST['resttime'.$i]);
267 unset($_POST['target'.$i]); 295 unset($_POST['target_lo'.$i]);
296 unset($_POST['target_hi'.$i]);
297 unset($_POST['fridge_mode'.$i]);
268 } 298 }
269 $cmd[] = "."; 299 $cmd[] = ".";
270 send_array($cmd); 300 send_array($cmd);
271 unset($_POST['UUID']); 301 unset($_POST['UUID']);
272 unset($_POST['key']); 302 unset($_POST['key']);
283 load('profiles.php'); 313 load('profiles.php');
284 break; 314 break;
285 } 315 }
286 316
287 $steps = array ( 317 $steps = array (
288 1 => array("steptime" => $_POST['steptime1'], "resttime" => $_POST['resttime1'], "target" => $_POST['target1'] ), 318 1 => array("steptime" => $_POST['steptime1'], "resttime" => $_POST['resttime1'], "target_lo" => $_POST['target_lo1'], "target_hi" => $_POST['target_hi1'], "fridge_mode" => $_POST['mode_fridge1'] ),
289 2 => array("steptime" => $_POST['steptime2'], "resttime" => $_POST['resttime2'], "target" => $_POST['target2'] ), 319 2 => array("steptime" => $_POST['steptime2'], "resttime" => $_POST['resttime2'], "target_lo" => $_POST['target_lo2'], "target_hi" => $_POST['target_hi2'], "fridge_mode" => $_POST['mode_fridge2'] ),
290 3 => array("steptime" => $_POST['steptime3'], "resttime" => $_POST['resttime3'], "target" => $_POST['target3'] ), 320 3 => array("steptime" => $_POST['steptime3'], "resttime" => $_POST['resttime3'], "target_lo" => $_POST['target_lo3'], "target_hi" => $_POST['target_hi3'], "fridge_mode" => $_POST['mode_fridge3'] ),
291 4 => array("steptime" => $_POST['steptime4'], "resttime" => $_POST['resttime4'], "target" => $_POST['target4'] ), 321 4 => array("steptime" => $_POST['steptime4'], "resttime" => $_POST['resttime4'], "target_lo" => $_POST['target_lo4'], "target_hi" => $_POST['target_hi4'], "fridge_mode" => $_POST['mode_fridge4'] ),
292 5 => array("steptime" => $_POST['steptime5'], "resttime" => $_POST['resttime5'], "target" => $_POST['target5'] ), 322 5 => array("steptime" => $_POST['steptime5'], "resttime" => $_POST['resttime5'], "target_lo" => $_POST['target_lo5'], "target_hi" => $_POST['target_hi5'], "fridge_mode" => $_POST['mode_fridge5'] ),
293 6 => array("steptime" => $_POST['steptime6'], "resttime" => $_POST['resttime6'], "target" => $_POST['target6'] ), 323 6 => array("steptime" => $_POST['steptime6'], "resttime" => $_POST['resttime6'], "target_lo" => $_POST['target_lo6'], "target_hi" => $_POST['target_hi6'], "fridge_mode" => $_POST['mode_fridge6'] ),
294 7 => array("steptime" => $_POST['steptime7'], "resttime" => $_POST['resttime7'], "target" => $_POST['target7'] ), 324 7 => array("steptime" => $_POST['steptime7'], "resttime" => $_POST['resttime7'], "target_lo" => $_POST['target_lo7'], "target_hi" => $_POST['target_hi7'], "fridge_mode" => $_POST['mode_fridge7'] ),
295 8 => array("steptime" => $_POST['steptime8'], "resttime" => $_POST['resttime8'], "target" => $_POST['target8'] ), 325 8 => array("steptime" => $_POST['steptime8'], "resttime" => $_POST['resttime8'], "target_lo" => $_POST['target_lo8'], "target_hi" => $_POST['target_hi8'], "fridge_mode" => $_POST['mode_fridge8'] ),
296 ); 326 );
297 327
298 edit_steps($_POST['UUID'], $steps, $error, "ThermFerm - Edit Profile Steps"); 328 edit_steps($_POST['UUID'], $steps, $error, "ThermFerm - Edit Profile Steps");
299 } 329 }
300 330
303 /* 333 /*
304 * Test input of a modified or new profile. 334 * Test input of a modified or new profile.
305 * 335 *
306 * @param string $_POST['UUID'] Unique record UUID 336 * @param string $_POST['UUID'] Unique record UUID
307 * @param string $_POST['Name'] Profile name 337 * @param string $_POST['Name'] Profile name
308 * @param float $_POST['Inittemp'] Profile initial temperature 338 * @param float $_POST['Inittemp_lo'] Profile initial temperature
339 * @param float $_POST['Inittemp_hi'] Profile initial temperature
340 * @param float $_POST['Fridge_mode'] Profile fridge mode
309 * @param string $_POST['key'] Key choice, Save or Cancel 341 * @param string $_POST['key'] Key choice, Save or Cancel
310 * @param string $_POST['command'] Command used, 'add' or 'update' 342 * @param string $_POST['command'] Command used, 'add' or 'update'
311 * 343 *
312 * Return: 0 = Ok 344 * Return: 0 = Ok
313 * 1 = Missing data 345 * 1 = Missing data
317 */ 349 */
318 function test_thedata() { 350 function test_thedata() {
319 351
320 global $arr; 352 global $arr;
321 353
322 if (isset($_POST['UUID']) && isset($_POST['Name']) && isset($_POST['Inittemp']) && isset($_POST['key']) && isset($_POST['command'])) { 354 if (isset($_POST['UUID']) && isset($_POST['Name']) && isset($_POST['Inittemp_lo']) && isset($_POST['Inittemp_hi']) && isset($_POST['key']) && isset($_POST['command'])) {
323 355
324 if ($_POST['key'] == 'Cancel') 356 if ($_POST['key'] == 'Cancel')
325 return 99; 357 return 99;
326 358
327 if (strlen($_POST['Name']) < 2) 359 if (strlen($_POST['Name']) < 2)
424 $outstr .= ' <tr class="editor">'.PHP_EOL; 456 $outstr .= ' <tr class="editor">'.PHP_EOL;
425 $outstr .= ' <td class="editname">Profile Name</td>'.PHP_EOL; 457 $outstr .= ' <td class="editname">Profile Name</td>'.PHP_EOL;
426 $outstr .= ' <td class="editfield"><input type="text" name="Name" size="50" value="'.$f[1].'"></td>'.PHP_EOL; 458 $outstr .= ' <td class="editfield"><input type="text" name="Name" size="50" value="'.$f[1].'"></td>'.PHP_EOL;
427 $outstr .= ' </tr>'.PHP_EOL; 459 $outstr .= ' </tr>'.PHP_EOL;
428 } 460 }
429 if ($f[0] == "INITTEMP") { 461 if ($f[0] == "INITTEMP_LO") {
430 $outstr .= ' <tr class="editor">'.PHP_EOL; 462 $outstr .= ' <tr class="editor">'.PHP_EOL;
431 $outstr .= ' <td class="editname">Initial temperature</td>'.PHP_EOL; 463 $outstr .= ' <td class="editname">Initial temperature low</td>'.PHP_EOL;
432 $outstr .= ' <td class="editfield"><input type="text" name="Inittemp" size="5" value="'.$f[1].'"></td>'.PHP_EOL; 464 $outstr .= ' <td class="editfield"><input type="text" name="Inittemp_lo" size="5" value="'.$f[1].'"></td>'.PHP_EOL;
433 $outstr .= ' </tr>'.PHP_EOL; 465 $outstr .= ' </tr>'.PHP_EOL;
434 } 466 }
467 if ($f[0] == "INITTEMP_HI") {
468 $outstr .= ' <tr class="editor">'.PHP_EOL;
469 $outstr .= ' <td class="editname">Initial temperature high</td>'.PHP_EOL;
470 $outstr .= ' <td class="editfield"><input type="text" name="Inittemp_hi" size="5" value="'.$f[1].'"></td>'.PHP_EOL;
471 $outstr .= ' </tr>'.PHP_EOL;
472 }
473 if ($f[0] == "FRIDGE_MODE") {
474 $outstr .= ' <tr class="editor">'.PHP_EOL;
475 $outstr .= ' <td class="editname">Fridge mode</td>'.PHP_EOL;
476 $outstr .= ' <td class="editfield"><input type="hidden" name="Fridge_mode" value="0"><input type="checkbox" name="Fridge_mode" value="1"';
477 if ($f[1] == "1")
478 $outstr .= " checked";
479 $outstr .= '></td>'.PHP_EOL;
480 $outstr .= ' </tr>'.PHP_EOL;
481 }
482
435 $i++; 483 $i++;
436 } 484 }
437 } 485 }
438 $outstr .= ' <tr class="editor">'.PHP_EOL; 486 $outstr .= ' <tr class="editor">'.PHP_EOL;
439 $outstr .= ' <td class="editname"><input type="submit" value="Save" name="key"></td>'.PHP_EOL; 487 $outstr .= ' <td class="editname"><input type="submit" value="Save" name="key"></td>'.PHP_EOL;
444 $outstr .= '<input type="hidden" value="'.$UUID.'" name="UUID"></td>'.PHP_EOL; 492 $outstr .= '<input type="hidden" value="'.$UUID.'" name="UUID"></td>'.PHP_EOL;
445 $outstr .= ' </tr>'.PHP_EOL; 493 $outstr .= ' </tr>'.PHP_EOL;
446 $outstr .= ' </table>'.PHP_EOL; 494 $outstr .= ' </table>'.PHP_EOL;
447 $outstr .= ' </form>'.PHP_EOL; 495 $outstr .= ' </form>'.PHP_EOL;
448 $outstr .= ' </div> <!-- etable -->'.PHP_EOL; 496 $outstr .= ' </div> <!-- etable -->'.PHP_EOL;
497 $outstr .= ' <script type="text/javascript">'.PHP_EOL;
498 $outstr .= ' $(document).ready(function () {'.PHP_EOL;
499 $outstr .= ' $("#maintenance").jqxButton({ width: 150, height: 25, theme: \'ui-redmond\' });'.PHP_EOL;
500 $outstr .= ' });'.PHP_EOL;
501 $outstr .= ' </script>'.PHP_EOL;
449 $outstr .= build_footer(); 502 $outstr .= build_footer();
450 echo $outstr; 503 echo $outstr;
451 } 504 }
452 505
453 506
523 $outstr .= ' <td class="editfield"><input type="text" name="Name" size="50" value=""></td>'.PHP_EOL; 576 $outstr .= ' <td class="editfield"><input type="text" name="Name" size="50" value=""></td>'.PHP_EOL;
524 $outstr .= ' <td class="editsub"><input type="submit" value="Add" name="key"></td>'.PHP_EOL; 577 $outstr .= ' <td class="editsub"><input type="submit" value="Add" name="key"></td>'.PHP_EOL;
525 $outstr .= '<input type="hidden" value="testdata" name="action">'; 578 $outstr .= '<input type="hidden" value="testdata" name="action">';
526 $outstr .= '<input type="hidden" value="add" name="command">'; 579 $outstr .= '<input type="hidden" value="add" name="command">';
527 $outstr .= '<input type="hidden" value="00000000-0000-0000-0000-000000000000" name="UUID">'; 580 $outstr .= '<input type="hidden" value="00000000-0000-0000-0000-000000000000" name="UUID">';
528 $outstr .= '<input type="hidden" value="20.0" name="Inittemp"></td>'; 581 $outstr .= '<input type="hidden" value="19.8" name="Inittemp_lo"></td>';
582 $outstr .= '<input type="hidden" value="20.2" name="Inittemp_hi"></td>';
529 $outstr .= ' </tr>'.PHP_EOL; 583 $outstr .= ' </tr>'.PHP_EOL;
530 $outstr .= ' </table>'.PHP_EOL; 584 $outstr .= ' </table>'.PHP_EOL;
531 $outstr .= ' </form>'.PHP_EOL; 585 $outstr .= ' </form>'.PHP_EOL;
532 586
533 $outstr .= ' </div> <!-- atable -->'.PHP_EOL; 587 $outstr .= ' </div> <!-- atable -->'.PHP_EOL;
588 $outstr .= ' <script type="text/javascript">'.PHP_EOL;
589 $outstr .= ' $(document).ready(function () {'.PHP_EOL;
590 $outstr .= ' $("#maintenance").jqxButton({ width: 150, height: 25, theme: \'ui-redmond\' });'.PHP_EOL;
591 $outstr .= ' });'.PHP_EOL;
592 $outstr .= ' </script>'.PHP_EOL;
534 $outstr .= build_footer(); 593 $outstr .= build_footer();
535 echo $outstr; 594 echo $outstr;
536 } 595 }
537 596

mercurial