www/set_devices.php

Tue, 07 May 2024 14:11:31 +0200

author
Michiel Broek <mbroek@mbse.eu>
date
Tue, 07 May 2024 14:11:31 +0200
changeset 732
b0e99e30a008
parent 703
344470c6bb1c
permissions
-rw-r--r--

Save one devices loop when handling a 2413 device.

685
819553a2b97e Devices list grid added.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1 <?php
819553a2b97e Devices list grid added.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2 require_once($_SERVER['DOCUMENT_ROOT'].'/includes/global.inc.php');
689
f94b525f7563 Create global_json() for all and expanded the data to the complete setup. Added design for the global setup.
Michiel Broek <mbroek@mbse.eu>
parents: 687
diff changeset
3 page_header('Sensor devices', 'set_devices');
685
819553a2b97e Devices list grid added.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4 ?>
819553a2b97e Devices list grid added.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5
819553a2b97e Devices list grid added.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6 <div id="jqxgrid"></div>
819553a2b97e Devices list grid added.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7 <div style="margin-top: 30px;">
819553a2b97e Devices list grid added.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8 <div id="cellbegineditevent"></div>
819553a2b97e Devices list grid added.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9 <div style="margin-top: 10px;" id="cellendeditevent"></div>
819553a2b97e Devices list grid added.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
10 </div>
819553a2b97e Devices list grid added.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
11
686
372b2442a30f More work for devices list and editor.
Michiel Broek <mbroek@mbse.eu>
parents: 685
diff changeset
12 <!-- Popup editor window. -->
372b2442a30f More work for devices list and editor.
Michiel Broek <mbroek@mbse.eu>
parents: 685
diff changeset
13 <div id="popupWindow">
372b2442a30f More work for devices list and editor.
Michiel Broek <mbroek@mbse.eu>
parents: 685
diff changeset
14 <div>Edit device</div>
372b2442a30f More work for devices list and editor.
Michiel Broek <mbroek@mbse.eu>
parents: 685
diff changeset
15 <div style="overflow: hidden;">
372b2442a30f More work for devices list and editor.
Michiel Broek <mbroek@mbse.eu>
parents: 685
diff changeset
16 <table style="width: 100%;">
372b2442a30f More work for devices list and editor.
Michiel Broek <mbroek@mbse.eu>
parents: 685
diff changeset
17 <tr>
372b2442a30f More work for devices list and editor.
Michiel Broek <mbroek@mbse.eu>
parents: 685
diff changeset
18 <td style="vertical-align: top; float: right; padding: 3px;">Uuid:</td>
687
f5d05b420732 Devices edit popup layout ready.
Michiel Broek <mbroek@mbse.eu>
parents: 686
diff changeset
19 <td align="left" colspan="5" style="vertical-align: top; padding: 3px;"><input id="dev_uuid" readonly /></td>
686
372b2442a30f More work for devices list and editor.
Michiel Broek <mbroek@mbse.eu>
parents: 685
diff changeset
20 </tr>
372b2442a30f More work for devices list and editor.
Michiel Broek <mbroek@mbse.eu>
parents: 685
diff changeset
21 <tr>
372b2442a30f More work for devices list and editor.
Michiel Broek <mbroek@mbse.eu>
parents: 685
diff changeset
22 <td style="vertical-align: top; float: right; padding: 3px;">Description:</td>
372b2442a30f More work for devices list and editor.
Michiel Broek <mbroek@mbse.eu>
parents: 685
diff changeset
23 <td align="left" colspan="5" style="vertical-align: top; padding: 3px;"><input id="dev_description" /></td>
372b2442a30f More work for devices list and editor.
Michiel Broek <mbroek@mbse.eu>
parents: 685
diff changeset
24 </tr>
372b2442a30f More work for devices list and editor.
Michiel Broek <mbroek@mbse.eu>
parents: 685
diff changeset
25 <tr>
372b2442a30f More work for devices list and editor.
Michiel Broek <mbroek@mbse.eu>
parents: 685
diff changeset
26 <td colspan="6"><hr></td>
372b2442a30f More work for devices list and editor.
Michiel Broek <mbroek@mbse.eu>
parents: 685
diff changeset
27 </tr>
372b2442a30f More work for devices list and editor.
Michiel Broek <mbroek@mbse.eu>
parents: 685
diff changeset
28 <tr>
372b2442a30f More work for devices list and editor.
Michiel Broek <mbroek@mbse.eu>
parents: 685
diff changeset
29 <td style="vertical-align: top; float: right; padding: 3px;">Device type:</td>
372b2442a30f More work for devices list and editor.
Michiel Broek <mbroek@mbse.eu>
parents: 685
diff changeset
30 <td colspan="2" style="padding: 3px;"><div style="float: left;" id="dev_type"></div></td>
372b2442a30f More work for devices list and editor.
Michiel Broek <mbroek@mbse.eu>
parents: 685
diff changeset
31 <td style="vertical-align: top; float: right; padding: 3px;">I/O direction:</td>
372b2442a30f More work for devices list and editor.
Michiel Broek <mbroek@mbse.eu>
parents: 685
diff changeset
32 <td colspan="2" style="padding: 3px;"><div style="float: left;" id="dev_direction"></div></td>
372b2442a30f More work for devices list and editor.
Michiel Broek <mbroek@mbse.eu>
parents: 685
diff changeset
33 </tr>
372b2442a30f More work for devices list and editor.
Michiel Broek <mbroek@mbse.eu>
parents: 685
diff changeset
34 <tr>
372b2442a30f More work for devices list and editor.
Michiel Broek <mbroek@mbse.eu>
parents: 685
diff changeset
35 <td style="vertical-align: top; float: right; padding: 3px;">Device value:</td>
372b2442a30f More work for devices list and editor.
Michiel Broek <mbroek@mbse.eu>
parents: 685
diff changeset
36 <td colspan="2" style="padding: 3px;"><div style="float: left;" id="dev_value"></div></td>
372b2442a30f More work for devices list and editor.
Michiel Broek <mbroek@mbse.eu>
parents: 685
diff changeset
37 <td style="vertical-align: top; float: right; padding: 3px;">Value offset:</td>
372b2442a30f More work for devices list and editor.
Michiel Broek <mbroek@mbse.eu>
parents: 685
diff changeset
38 <td colspan="2" style="padding: 3px;"><div style="float: left;" id="dev_offset"></div></td>
372b2442a30f More work for devices list and editor.
Michiel Broek <mbroek@mbse.eu>
parents: 685
diff changeset
39 </tr>
372b2442a30f More work for devices list and editor.
Michiel Broek <mbroek@mbse.eu>
parents: 685
diff changeset
40 <tr>
372b2442a30f More work for devices list and editor.
Michiel Broek <mbroek@mbse.eu>
parents: 685
diff changeset
41 <td style="vertical-align: top; float: right; padding: 3px;">Address:</td>
687
f5d05b420732 Devices edit popup layout ready.
Michiel Broek <mbroek@mbse.eu>
parents: 686
diff changeset
42 <td align="left" colspan="2" style="vertical-align: top; padding: 3px;"><input id="dev_address" /></td>
686
372b2442a30f More work for devices list and editor.
Michiel Broek <mbroek@mbse.eu>
parents: 685
diff changeset
43 <td style="vertical-align: top; float: right; padding: 3px;">Subdevice:</td>
372b2442a30f More work for devices list and editor.
Michiel Broek <mbroek@mbse.eu>
parents: 685
diff changeset
44 <td colspan="2" style="padding: 3px;"><div style="float: left;" id="dev_subdevice"></div></td>
372b2442a30f More work for devices list and editor.
Michiel Broek <mbroek@mbse.eu>
parents: 685
diff changeset
45 </tr>
372b2442a30f More work for devices list and editor.
Michiel Broek <mbroek@mbse.eu>
parents: 685
diff changeset
46 <tr>
372b2442a30f More work for devices list and editor.
Michiel Broek <mbroek@mbse.eu>
parents: 685
diff changeset
47 <td style="vertical-align: top; float: right; padding: 3px;">Present:</td>
372b2442a30f More work for devices list and editor.
Michiel Broek <mbroek@mbse.eu>
parents: 685
diff changeset
48 <td colspan="2" style="padding: 3px;"><div style="float: left;" id="dev_present"></div></td>
372b2442a30f More work for devices list and editor.
Michiel Broek <mbroek@mbse.eu>
parents: 685
diff changeset
49 <td style="vertical-align: top; float: right; padding: 3px;">GPIO pin:</td>
372b2442a30f More work for devices list and editor.
Michiel Broek <mbroek@mbse.eu>
parents: 685
diff changeset
50 <td colspan="2" style="padding: 3px;"><div style="float: left;" id="dev_gpiopin"></div></td>
372b2442a30f More work for devices list and editor.
Michiel Broek <mbroek@mbse.eu>
parents: 685
diff changeset
51 </tr>
372b2442a30f More work for devices list and editor.
Michiel Broek <mbroek@mbse.eu>
parents: 685
diff changeset
52 <tr>
372b2442a30f More work for devices list and editor.
Michiel Broek <mbroek@mbse.eu>
parents: 685
diff changeset
53 <td style="vertical-align: top; float: right; padding: 3px;">In use:</td>
372b2442a30f More work for devices list and editor.
Michiel Broek <mbroek@mbse.eu>
parents: 685
diff changeset
54 <td colspan="2" style="padding: 3px;"><div style="float: left;" id="dev_inuse"></div></td>
372b2442a30f More work for devices list and editor.
Michiel Broek <mbroek@mbse.eu>
parents: 685
diff changeset
55 <td style="vertical-align: top; float: right; padding: 3px;">Last change:</td>
687
f5d05b420732 Devices edit popup layout ready.
Michiel Broek <mbroek@mbse.eu>
parents: 686
diff changeset
56 <td align="left" colspan="2" style="vertical-align: top; padding: 3px;"><input id="dev_timestamp" readonly /></td>
686
372b2442a30f More work for devices list and editor.
Michiel Broek <mbroek@mbse.eu>
parents: 685
diff changeset
57 </tr>
372b2442a30f More work for devices list and editor.
Michiel Broek <mbroek@mbse.eu>
parents: 685
diff changeset
58 <tr>
372b2442a30f More work for devices list and editor.
Michiel Broek <mbroek@mbse.eu>
parents: 685
diff changeset
59 <td style="vertical-align: top; float: right; padding: 3px;">Comment:</td>
372b2442a30f More work for devices list and editor.
Michiel Broek <mbroek@mbse.eu>
parents: 685
diff changeset
60 <td align="left" colspan="5" style="vertical-align: top; padding: 3px;"><input id="dev_comment" /></td>
372b2442a30f More work for devices list and editor.
Michiel Broek <mbroek@mbse.eu>
parents: 685
diff changeset
61 </tr>
687
f5d05b420732 Devices edit popup layout ready.
Michiel Broek <mbroek@mbse.eu>
parents: 686
diff changeset
62 <tr><td colspan="6"></td></tr>
686
372b2442a30f More work for devices list and editor.
Michiel Broek <mbroek@mbse.eu>
parents: 685
diff changeset
63 <tr>
372b2442a30f More work for devices list and editor.
Michiel Broek <mbroek@mbse.eu>
parents: 685
diff changeset
64 <td style="padding-top: 20px;" align="right"><input type="button" id="Delete" value="Delete" /></td>
372b2442a30f More work for devices list and editor.
Michiel Broek <mbroek@mbse.eu>
parents: 685
diff changeset
65 <td></td>
372b2442a30f More work for devices list and editor.
Michiel Broek <mbroek@mbse.eu>
parents: 685
diff changeset
66 <td></td><td></td>
687
f5d05b420732 Devices edit popup layout ready.
Michiel Broek <mbroek@mbse.eu>
parents: 686
diff changeset
67 <td style="padding-top: 20px;" align="right"><input style="margin-right: 5px;" type="button" id="Save" value="Save" /></td>
f5d05b420732 Devices edit popup layout ready.
Michiel Broek <mbroek@mbse.eu>
parents: 686
diff changeset
68 <td style="padding-top: 20px;" align="left"><input id="Cancel" type="button" value="Cancel" /></td>
686
372b2442a30f More work for devices list and editor.
Michiel Broek <mbroek@mbse.eu>
parents: 685
diff changeset
69 </tr>
372b2442a30f More work for devices list and editor.
Michiel Broek <mbroek@mbse.eu>
parents: 685
diff changeset
70 </table>
372b2442a30f More work for devices list and editor.
Michiel Broek <mbroek@mbse.eu>
parents: 685
diff changeset
71 </div>
372b2442a30f More work for devices list and editor.
Michiel Broek <mbroek@mbse.eu>
parents: 685
diff changeset
72 </div>
372b2442a30f More work for devices list and editor.
Michiel Broek <mbroek@mbse.eu>
parents: 685
diff changeset
73
699
35382668a140 Added Add new device.
Michiel Broek <mbroek@mbse.eu>
parents: 689
diff changeset
74 <div id="addWindow">
35382668a140 Added Add new device.
Michiel Broek <mbroek@mbse.eu>
parents: 689
diff changeset
75 <div>
35382668a140 Added Add new device.
Michiel Broek <mbroek@mbse.eu>
parents: 689
diff changeset
76 Add new device
35382668a140 Added Add new device.
Michiel Broek <mbroek@mbse.eu>
parents: 689
diff changeset
77 </div>
35382668a140 Added Add new device.
Michiel Broek <mbroek@mbse.eu>
parents: 689
diff changeset
78 <div>
35382668a140 Added Add new device.
Michiel Broek <mbroek@mbse.eu>
parents: 689
diff changeset
79 <div>
35382668a140 Added Add new device.
Michiel Broek <mbroek@mbse.eu>
parents: 689
diff changeset
80 Select a new device type and press "OK" to create a new device record.<br>
35382668a140 Added Add new device.
Michiel Broek <mbroek@mbse.eu>
parents: 689
diff changeset
81 Press "Cancel" to close without adding a new device.
35382668a140 Added Add new device.
Michiel Broek <mbroek@mbse.eu>
parents: 689
diff changeset
82 </div>
35382668a140 Added Add new device.
Michiel Broek <mbroek@mbse.eu>
parents: 689
diff changeset
83 <div>
35382668a140 Added Add new device.
Michiel Broek <mbroek@mbse.eu>
parents: 689
diff changeset
84 <div style="float: right; margin-top: 25px; margin-bottom: 10px;">
35382668a140 Added Add new device.
Michiel Broek <mbroek@mbse.eu>
parents: 689
diff changeset
85 <div style="float: left; margin-right: 15px" id="addType"></div>
35382668a140 Added Add new device.
Michiel Broek <mbroek@mbse.eu>
parents: 689
diff changeset
86 <input type="button" id="addOk" value="OK" style="margin-right: 15px" />
35382668a140 Added Add new device.
Michiel Broek <mbroek@mbse.eu>
parents: 689
diff changeset
87 <input type="button" id="addCancel" value="Cancel" style="margin-right: 65px" />
35382668a140 Added Add new device.
Michiel Broek <mbroek@mbse.eu>
parents: 689
diff changeset
88 </div>
35382668a140 Added Add new device.
Michiel Broek <mbroek@mbse.eu>
parents: 689
diff changeset
89 </div>
35382668a140 Added Add new device.
Michiel Broek <mbroek@mbse.eu>
parents: 689
diff changeset
90 </div>
35382668a140 Added Add new device.
Michiel Broek <mbroek@mbse.eu>
parents: 689
diff changeset
91 </div>
35382668a140 Added Add new device.
Michiel Broek <mbroek@mbse.eu>
parents: 689
diff changeset
92
685
819553a2b97e Devices list grid added.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
93 <?php
686
372b2442a30f More work for devices list and editor.
Michiel Broek <mbroek@mbse.eu>
parents: 685
diff changeset
94 confirm_delete();
685
819553a2b97e Devices list grid added.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
95 page_footer();
819553a2b97e Devices list grid added.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
96 ?>

mercurial