-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathfloorplan.doorsensors.php
364 lines (347 loc) · 8.78 KB
/
floorplan.doorsensors.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
<?php
$start=microtime(true);
require 'secure/functions.php';
require '/var/www/authentication.php';
echo '<html>
<head>
<title>Floorplan</title>
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8"/>
<meta name="HandheldFriendly" content="true"/>
<meta name="mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<meta name="theme-color" content="#000">';
if ($udevice=='iPhone') {
echo '
<meta name="viewport" content="width=device-width,height=device-height,initial-scale=0.77,user-scalable=yes,minimal-ui"/>';
} elseif ($udevice=='iPhoneSE') {
echo '
<meta name="viewport" content="width=device-width,height=device-height,initial-scale=0.77,user-scalable=yes,minimal-ui"/>';
} elseif ($udevice=='iPad') {
echo '
<meta name="viewport" content="width=device-width,height=device-height,initial-scale=1.2,user-scalable=yes,minimal-ui"/>';
}
echo '
<link rel="icon" type="image/png" href="images/domoticzphp48.png"/>
<link rel="shortcut icon" href="images/domoticzphp48.png"/>
<link rel="apple-touch-icon" href="images/domoticzphp48.png"/>
<link rel="stylesheet" type="text/css" href="/styles/floorplan.css">
<style>
.green{color:#000;}
.red{color:#FFF;}
.stamp{width:38px;text-align:center;font-size:120%;color:#888}
.fix{cursor:pointer;z-index:100;}
.dachterdeur{top:309px;left:80px;width:60px;height:51px;}
.draamliving{top:56px;left:80px;width:60px;height:188px;}
.draamkeuken{top:210px;left:417px;width:60px;height:48px;}
.draamwaskamer{top:521px;left:80px;width:60px;height:48px;}
.draamalex{top:661px;left:80px;width:60px;height:48px;}
.draamkamer{top:661px;left:425px;width:60px;height:48px;text-align:left;}
.draamhall{top:461px;left:216px;width:55px;height:40px;}
.ddeurvoordeur{top:71px;left:418px;width:60px;height:51px;}
.ddeurbadkamer{top:490px;left:341px;width:60px;height:48px;}
.ddeurkamer{top:544px;left:290px;width:46px;height:33px;}
.ddeurwaskamer{top:521px;left:167px;width:44px;height:51px;}
.ddeuralex{top:597px;left:213px;width:43px;height:33px;}
.ddeurgarage{top:264px;left:341px;width:43px;height:33px;}
.ddeurinkom{top:68px;left:338px;width:43px;height:50px;}
.ddeurwc{top:43px;left:418px;width:43px;height:33px;}
</style>
</head>';
if (isset($_REQUEST['name'])&&isset($_REQUEST['action'])) {
store($_REQUEST['name'], $_REQUEST['action'], basename(__FILE__).':'.__LINE__);
if ($_REQUEST['action']=='Open') {
if ($_REQUEST['name']=='raamkamer') {
storemode('RkamerL', 0, basename(__FILE__).':'.__LINE__);
storemode('RkamerR', 0, basename(__FILE__).':'.__LINE__);
} elseif ($_REQUEST['name']=='raamwaskamer') {
storemode('Rwaskamer', 0, basename(__FILE__).':'.__LINE__);
} elseif ($_REQUEST['name']=='raamalex') {
storemode('Ralex', 0, basename(__FILE__).':'.__LINE__);
}
}
}
$d=fetchdata();
echo '
<body class="floorplan">
<div class="fix z1" style="bottom:12px;left:12px;">
<a href=\'javascript:navigator_Go("floorplan.php");\'>
<img src="/images/close.png" width="72px" height="72px"/>
</a>
</div>
<div class="fix" id="clock" onclick="javascript:navigator_Go(\'floorplan.doorsensors.php\');">'.date('G:i:s').'
</div>';
if ($d['achterdeur']['s']=='Open') {
echo '
<a href=\'javascript:navigator_Go("?name=achterdeur&action=Closed");\'>
<div class="fix red dachterdeur">
<br>
Open
</div>
</a>';
} else {
echo '
<a href=\'javascript:navigator_Go("?name=achterdeur&action=Open");\'>
<div class="fix green dachterdeur">
<br>
Closed
</div>
</a>';
}
if ($d['raamliving']['s']=='Open') {
echo '
<a href=\'javascript:navigator_Go("?name=raamliving&action=Closed");\'>
<div class="fix red draamliving">
<br>
<br>
<br>
<br>
<br>
<br>
Open
</div>
</a>';
} else {
echo '
<a href=\'javascript:navigator_Go("?name=raamliving&action=Open");\'>
<div class="fix green draamliving">
<br>
<br>
<br>
<br>
<br>
<br>
Closed
</div>
</a>';
}
if ($d['raamwaskamer']['s']=='Open') {
echo '
<a href=\'javascript:navigator_Go("?name=raamwaskamer&action=Closed");\'>
<div class="fix red draamwaskamer">
<br>
Open
</div>
</a>';
} else {
echo '
<a href=\'javascript:navigator_Go("?name=raamwaskamer&action=Open");\'>
<div class="fix green draamwaskamer">
<br>
Closed
</div>
</a>';
}
if ($d['raamalex']['s']=='Open') {
echo '
<a href=\'javascript:navigator_Go("?name=raamalex&action=Closed");\'>
<div class="fix red draamalex">
<br>
Open
</div>
</a>';
} else {
echo '
<a href=\'javascript:navigator_Go("?name=raamalex&action=Open");\'>
<div class="fix green draamalex">
<br>
Closed
</div>
</a>';
}
if ($d['raamkamer']['s']=='Open') {
echo '
<a href=\'javascript:navigator_Go("?name=raamkamer&action=Closed");\'>
<div class="fix red draamkamer">
<br>
Open
</div>
</a>';
} else {
echo '
<a href=\'javascript:navigator_Go("?name=raamkamer&action=Open");\'>
<div class="fix green draamkamer">
<br>
Closed
</div>
</a>';
}
if ($d['raamhall']['s']=='Open') {
echo '
<a href=\'javascript:navigator_Go("?name=raamhall&action=Closed");\'>
<div class="fix red draamhall">
<br>
Open
</div>
</a>';
} else {
echo '
<a href=\'javascript:navigator_Go("?name=raamhall&action=Open");\'>
<div class="fix green draamhall">
<br>
Closed
</div>
</a>';
}
if ($d['raamkeuken']['s']=='Open') {
echo '
<a href=\'javascript:navigator_Go("?name=raamkeuken&action=Closed");\'>
<div class="fix red draamkeuken">
<br>
Open
</div>
</a>';
} else {
echo '
<a href=\'javascript:navigator_Go("?name=raamkeuken&action=Open");\'>
<div class="fix green draamkeuken">
<br>
Closed
</div>
</a>';
}
if ($d['deurbadkamer']['s']=='Open') {
echo '
<a href=\'javascript:navigator_Go("?name=deurbadkamer&action=Closed");\'>
<div class="fix red ddeurbadkamer">
<br>
Open
</div>
</a>';
} else {
echo '
<a href=\'javascript:navigator_Go("?name=deurbadkamer&action=Open");\'>
<div class="fix green ddeurbadkamer">
<br>
Closed
</div>
</a>';
}
if ($d['deurvoordeur']['s']=='Open') {
echo '
<a href=\'javascript:navigator_Go("?name=deurvoordeur&action=Closed");\'>
<div class="fix red ddeurvoordeur">
<br>
Open
</div>
</a>';
} else {
echo '
<a href=\'javascript:navigator_Go("?name=deurvoordeur&action=Open");\'>
<div class="fix green ddeurvoordeur">
<br>
Closed
</div>
</a>';
}
if ($d['deurkamer']['s']=='Open') {
echo '
<a href=\'javascript:navigator_Go("?name=deurkamer&action=Closed");\'>
<div class="fix red ddeurkamer">
<br>
Open
</div>
</a>';
} else {
echo '
<a href=\'javascript:navigator_Go("?name=deurkamer&action=Open");\'>
<div class="fix green ddeurkamer">
<br>
Closed
</div>
</a>';
}
if ($d['deurwaskamer']['s']=='Open') {
echo '
<a href=\'javascript:navigator_Go("?name=deurwaskamer&action=Closed");\'>
<div class="fix red ddeurwaskamer">
<br>
Open
</div>
</a>';
} else {
echo '
<a href=\'javascript:navigator_Go("?name=deurwaskamer&action=Open");\'>
<div class="fix green ddeurwaskamer">
<br>
Closed
</div>
</a>';
}
if ($d['deuralex']['s']=='Open') {
echo '
<a href=\'javascript:navigator_Go("?name=deuralex&action=Closed");\'>
<div class="fix red ddeuralex">
<br>
Open
</div>
</a>';
} else {
echo '
<a href=\'javascript:navigator_Go("?name=deuralex&action=Open");\'>
<div class="fix green ddeuralex">
<br>
Closed
</div>
</a>';
}
if ($d['deurgarage']['s']=='Open') {
echo '
<a href=\'javascript:navigator_Go("?name=deurgarage&action=Closed");\'>
<div class="fix red ddeurgarage">
<br>
Open
</div>
</a>';
} else {
echo '
<a href=\'javascript:navigator_Go("?name=deurgarage&action=Open");\'>
<div class="fix green ddeurgarage">
<br>
Closed
</div>
</a>';
}
if ($d['deurinkom']['s']=='Open') {
echo '
<a href=\'javascript:navigator_Go("?name=deurinkom&action=Closed");\'>
<div class="fix red ddeurinkom">
<br>
Open
</div>
</a>';
} else {
echo '
<a href=\'javascript:navigator_Go("?name=deurinkom&action=Open");\'>
<div class="fix green ddeurinkom">
<br>
Closed
</div>
</a>';
}
/*
if ($d['deurwc']['s']=='Open') {
echo '
<a href=\'javascript:navigator_Go("?name=deurwc&action=Closed");\'>
<div class="fix red ddeurwc">
<br>
Open
</div>
</a>';
} else {
echo '
<a href=\'javascript:navigator_Go("?name=deurwc&action=Open");\'>
<div class="fix green ddeurwc">
<br>
Closed
</div>
</a>';
}
*/
echo $udevice.'
<script type="text/javascript">
function navigator_Go(url) {window.location.assign(url);}
</script>';
?>
</body>
</html>