forked from iinnovations/cupidweblib
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtemp.html
executable file
·411 lines (393 loc) · 18.4 KB
/
temp.html
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
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
<?php require_once('auth/user.php'); ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html><!-- InstanceBegin template="/Templates/main.dwt" codeOutsideHTMLIsLocked="false" -->
<head>
<!-- Get me some jquery-->
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js" type="text/javascript"></script>
<script src="/js/iijslib.js" type="text/javascript"></script>
<!--Record auth level-->
<script type="text/javascript">
var sessiondata = {}
sessiondata.username = "<?php if (!empty($_SESSION['user']['name'])) { echo $_SESSION['user']['name'];} ?>";
sessiondata.sessionid = "<?php if (!empty($_SESSION['user']['sessionid'])) {echo $_SESSION['user']['sessionid'];} ?>";
sessiondata.appip = "<?php if (!empty($_SESSION['user']['appip'])) {echo $_SESSION['user']['appip'];} ?>";
sessiondata.realip = "<?php if (!empty($_SESSION['user']['realip'])) {echo $_SESSION['user']['realip'];} ?>";
sessiondata.authlevel = "<?php if (!empty($_SESSION['user']['authlevel'])) {echo $_SESSION['user']['authlevel'];} ?>";
// <!--Log access-->
logUserAuths(sessiondata)
</script>
<!-- InstanceBeginEditable name="doctitle" -->
<title>CuPID Settings</title>
<!-- InstanceEndEditable -->
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
<style media="all" type="text/css">
@import "css/all.css";
</style>
<!-- InstanceBeginEditable name="head" -->
<?php $user->require_login(); ?>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js" type="text/javascript">
</script>
<style type="text/css">
input[type="text"]{width:75px;}
</style>
<!-- Here we define some dynamic table functions -->
<SCRIPT language="javascript">
var editmode="off"
var refresh=2000
var controldatabase='/var/www/data/controldata.db'
var logdatabase='/var/www/data/logdata.db'
var logdata=[]
var channelsdata=[]
// These are variables that are shared between the various settings
var inputids=[]
var recipetypes=[]
var outputnames=[]
var controltypes=[]
var controlrecipes=[]
var statusdata=[]
var actauthlevel=2
var stdmessage='You do not have sufficient authorization for this action'
// Here we define functions to get our shared variables
function outputnames() {
// Get the data
$.ajax({
url: "/wsgisqlitequery",
type: "post",
datatype:"json",
data: {'database':controldatabase,'table':'sensordata'},
success: function(response){
//alert("I worked");
// Execute our callback function
sensorROMs=[];
for(var i = 0; i < response.length ; i++)
{
sensorROMs.push(response[i].ROM)
}
}
});
}
//// Control Inputs - also do ROM display table at same time
function UpdateControlInputs() {
var callback=RenderControlInputs
wsgiCallbackTableData(controldatabase,'inputsdata',callback)
}
function RenderControlInputs (databaseinputstable) {
inputids=[]
for (var i=0; i<databaseinputstable.length;i++){
inputids[i]=databaseinputstable[i].id
}
tableid="inputstable"
var table = document.getElementById(tableid)
for(var i = table.rows.length - 1; i > 0; i--)
{
table.deleteRow(i);
}
for (var j=0;j<databaseinputstable.length;j++)
{
addRow(tableid,[[databaseinputstable[j].id,"id","value"],[databaseinputstable[j].interface,"interface","value"],[databaseinputstable[j].type,"type","value"],[databaseinputstable[j].value,"value","value"],[databaseinputstable[j].unit,"unit","value"],[databaseinputstable[j].polltime,"time","value"]]);
}
}
$(document).ready(function() {
// Run once at page load
UpdateControlInputs()
$('#statusrefreshbutton').click(function(){
//alert('I am going to update now');
GetAndRenderStatusData()
});
$('#channelsrefreshbutton').click(function(){
//alert('I am going to update now');
GetAndRenderChannelsData()
});
});
</script>
<!-- InstanceEndEditable -->
</head>
<body>
<div id="main">
<!-- InstanceBeginEditable name="NavBar" -->
<div id="header" style="padding-left:0px"> <a href="http://www.interfaceinnovations.org/cupidcontrols.html" class="logo" ><img src="images/cmstemplate/logo.png"alt="" /></a>
<ul id="top-navigation">
<li><span><span><a href="index.html">Home</a></span></span></li>
<li><span><span><a href="controlpanel.html">Panel</a></span></span></li>
<li><span><span><a href="smallpanel.html">SmPanel</a></span></span></li>
<li class="active"><span><span>Inputs</span></span></li>
<li><span><span><a href="datalogs.html">Datalogs</a></span></span></li>
<li><span><span><a href="settings.html">Settings</a></span></span></li>
<li><span><span><a href="admin.html">Admin</a></span></span></li>
<li><span><span><a href="help.html">Help</a></span></span></li>
</ul>
<div id="login"><?php
if($user->logged_in()):
?>
<p>You are logged in as <?php echo $_SESSION['user']['name']; ?>. <a href="auth/logout">Log out</a></p>
<?php
endif;
if(!$user->logged_in()): ?>
<p>You are not logged in. <a href="auth/login">Log in</a>
<?php
endif;
?>
</p></div><!-- login -->
</div><!-- header -->
<!-- InstanceEndEditabìe -->
<!-- InstanãeBeginEditable name="MainBody" -->
<div id="maddle">
<div id="full-column">
<div class="top-bar">
<h1>Sensors</h1>
<div class="breadcrumbs">
<p>The things that measure things</p>
<p>We're not quite implemunted yet. Just a bit of javascript left to load our data.</p>
</div>
</div> <!-- Enä top bar -->
<br />
<div class="fullcontent">
<table width="100%" cmllpad$ing="0" cellspacing="0" >
<tr>
<td>
<h2>Currently attached input devices</h2>
</td>
<td align="right">
<button id="statusrefreshbutton"><b>Refresh Attached Sensors</b></button>
</td>
</tr>
</table>
</div> <!-- fullcontent -->
<div class="table fulltable" ><img src="images/cmstemplate/bg-th-left.gif" width="8" height="7" alt="" class="left" /> <img src="images/cmstemplate/bg-th-right.gif" width="7" height="7" alt="" class="right" />
<table class="listing fulllisting" cellpadding="0" cellspacing="0" id="inputstable">
<tr>
<th class="first">Name</th>
<th>Interface</th>
<th>Type</th>
<th>Value</th>
<th>Unit</th>
<th class="last">Time</th>
</tr>
<tr>
<td>value</td>
<td>value</td>
<td>value</td>
<td>value</td>
<td>value</td>
<td>value</td>
</tr>
</table>
</div> <!-- full table -->
<div class="fullcontent">
<table width="100%" cellpadding="0" cellspacing="0">
<tr>
<td>
<h2>Stored sensor metadata</h2>
</td>
<td align="right">
<button id="channelsrefreshbutton" >Reload Sensor Metadata</button>
<button id="channelssetdatabutton" >Set New Sensor Metadata</button>
</td>
</tr>
</table>
</div>
<div class="table fulltable"> <img src="images/cmstemplate/bg-th-left.gif" width="8" height="7" alt="" class="left" /> <img src="images/cmstemplate/bg-th-right.gif" width="7" height="7" alt="" class="right" />
<table class="listing fulllisting" cellpadding="0" cellspacing="0" id="channelstable">
<tr>
<th class="first">Sensor Name</th>
<th>Sensor Type</th>
<th>Sensor ID</th>
<th class="last">Sensor ID Type</th>
</tr>
<tr>
<td>value</td>
<td>value</td>
<td>value</td>
<td>value</td>
</tr>
</table>
</div> <!-- full table -->
<div class="fullcontent">
<table width="100%" cellpadding="0" cellspacing="0">
<tr>
<td>
<h2>Sensor type configuration data</h2>
</td>
<td align="right">
<button id="outputsrefreshbutton">Reload Sensor Config</button>
<button id="outputssetdatabutton">Set New Sensor Config</button>
</td>
</tr>
</table>
</div>
<div class="table fulltable"> <img src="images/cmstemplate/bg-th-left.gif" width="8" height="7" alt="" class="left" /> <img src="images/cmstemplate/bg-th-right.gif" width="7" height="7" alt="" class="right" />
<table class="listing fulllisting" cellpadding="0" cellspacing="0" id="outputstable">
<tr>
<th class="first">Sensor Type</th>
<th>Interface</th>
<th>Unit</th>
<th class="last">Calibration Formula</th>
</tr>
<tr>
<td>value </td>
<td>value</td>
<td>value</td>
<td>value</td>
</tr>
</table>
</div> <!-- full table -->
</div><!-- middle -->
</div><!-- full column -->
<!-- InstanceEndEditable -->
<!-- InstanceBeginEditable name="MainBody" -->
<div id="middle">
<div id="center-column">
<div class="top-bar">
<h1>Homepage</h1>
<div class="breadcrumbs">Welcome to your homepage!</div>
</div> <!-- End top bar -->
<br />
<!--<div class="select-bar">
<label>
<input type="text" name="textfield" />
</label>
<label>
<input type="submit" name="Submit" value="Search" />
</label>
</div>-->
<div class="table"> <img src="images/cmstemplate/bg-th-left.gif" width="8" height="7" alt="" class="left" /> <img src="images/cmstemplate/bg-th-right.gif" width="7" height="7" alt="" class="right" />
<table class="listing" cellpadding="0" cellspacing="0">
<tr>
<th class="first" width="177">Header Here</th>
<th>Header</th>
<th>Head</th>
<th>Header</th>
<th>Header</th>
<th>Head</th>
<th>Header</th>
<th class="last">Head</th>
</tr>
<tr>
<td class="first style1">- Lorem Ipsum </td>
<td><img src="images/cmstemplate/add-icon.gif" width="16" height="16" alt="" /></td>
<td><img src="images/cmstemplate/hr.gif" width="16" height="16" alt="" /></td>
<td><img src="images/cmstemplate/save-icon.gif" width="16" height="16" alt="" /></td>
<td><img src="images/cmstemplate/edit-icon.gif" width="16" height="16" alt="" /></td>
<td><img src="images/cmstemplate/login-icon.gif" width="16" height="16" alt="" /></td>
<td><img src="images/cmstemplate/save-icon.gif" width="16" height="16" alt="save" /></td>
<td class="last"><img src="images/cmstemplate/add-icon.gif" width="16" height="16" alt="add" /></td>
</tr>
<tr class="bg">
<td class="first style2">- Lorem Ipsum </td>
<td><img src="images/cmstemplate/add-icon.gif" width="16" height="16" alt="add" /></td>
<td><img src="images/cmstemplate/hr.gif" width="16" height="16" alt="" /></td>
<td><img src="images/cmstemplate/save-icon.gif" width="16" height="16" alt="save" /></td>
<td><img src="images/cmstemplate/edit-icon.gif" width="16" height="16" alt="edit" /></td>
<td><img src="images/cmstemplate/login-icon.gif" width="16" height="16" alt="login" /></td>
<td><img src="images/cmstemplate/save-icon.gif" width="16" height="16" alt="save" /></td>
<td class="last"><img src="images/cmstemplate/add-icon.gif" width="16" height="16" alt="add" /></td>
</tr>
<tr>
<td class="first style3">- Lorem Ipsum </td>
<td><img src="images/cmstemplate/add-icon.gif" width="16" height="16" alt="add" /></td>
<td><img src="images/cmstemplate/hr.gif" width="16" height="16" alt="" /></td>
<td><img src="images/cmstemplate/save-icon.gif" width="16" height="16" alt="save" /></td>
<td><img src="images/cmstemplate/edit-icon.gif" width="16" height="16" alt="edit" /></td>
<td><img src="images/cmstemplate/login-icon.gif" width="16" height="16" alt="login" /></td>
<td><img src="images/cmstemplate/save-icon.gif" width="16" height="16" alt="save" /></td>
<td class="last"><img src="images/cmstemplate/add-icon.gif" width="16" height="16" alt="add" /></td>
</tr>
<tr class="bg">
<td class="first style1">- Lorem Ipsum </td>
<td><img src="images/cmstemplate/add-icon.gif" width="16" height="16" alt="add" /></td>
<td><img src="images/cmstemplate/hr.gif" width="16" height="16" alt="" /></td>
<td><img src="images/cmstemplate/save-icon.gif" width="16" height="16" alt="save" /></td>
<td><img src="images/cmstemplate/edit-icon.gif" width="16" height="16" alt="edit" /></td>
<td><img src="images/cmstemplate/login-icon.gif" width="16" height="16" alt="login" /></td>
<td><img src="images/cmstemplate/save-icon.gif" width="16" height="16" alt="save" /></td>
<td class="last"><img src="images/cmstemplate/add-icon.gif" width="16" height="16" alt="add" /></td>
</tr>
<tr>
<td class="first style2">- Lorem Ipsum </td>
<td><img src="images/cmstemplate/add-icon.gif" width="16" height="16" alt="add" /></td>
<td><img src="images/cmstemplate/hr.gif" width="16" height="16" alt="" /></td>
<td><img src="images/cmstemplate/save-icon.gif" width="16" height="16" alt="save" /></td>
<td><img src="images/cmstemplate/edit-icon.gif" width="16" height="16" alt="edit" /></td>
<td><img src="images/cmstemplate/login-icon.gif" width="16" height="16" alt="login" /></td>
<td><img src="images/cmstemplate/save-icon.gif" width="16" height="16" alt="save" /></td>
<td class="last"><img src="images/cmstemplate/add-icon.gif" width="16" height="16" alt="add" /></td>
</tr>
<tr class="bg">
<td class="first style3">- Lorem Ipsum </td>
<td><img src="images/cmstemplate/add-icon.gif" width="16" height="16" alt="add" /></td>
<td><img src="images/cmstemplate/hr.gif" width="16" height="16" alt="" /></td>
<td><img src="images/cmstemplate/save-icon.gif" width="16" height="16" alt="save" /></td>
<td><img src="images/cmstemplate/edit-icon.gif" width="16" height="16" alt="edit" /></td>
<td><img src="images/cmstemplate/login-icon.gif" width="16" height="16" alt="login" /></td>
<td><img src="images/cmstemplate/save-icon.gif" width="16" height="16" alt="save" /></td>
<td class="last"><img src="images/cmstemplate/add-icon.gif" width="16" height="16" alt="add" /></td>
</tr>
<tr>
<td class="first style4">- Lorem Ipsum </td>
<td><img src="images/cmstemplate/add-icon.gif" width="16" height="16" alt="add" /></td>
<td><img src="images/cmstemplate/hr.gif" width="16" height="16" alt="" /></td>
<td><img src="images/cmstemplate/save-icon.gif" width="16" height="16" alt="save" /></td>
<td><img src="images/cmstemplate/edit-icon.gif" width="16" height="16" alt="edit" /></td>
<td><img src="images/cmstemplate/login-icon.gif" width="16" height="16" alt="login" /></td>
<td><img src="images/cmstemplate/save-icon.gif" width="16" height="16" alt="save" /></td>
<td class="last"><img src="images/cmstemplate/add-icon.gif" width="16" height="16" alt="add" /></td>
</tr>
</table>
<div class="select"> <strong>Other Pages: </strong>
<select>
<option>1</option>
</select>
</div>
</div>
<div class="table"> <img src="images/cmstemplate/bg-th-left.gif" width="8" height="7" alt="" class="left" /> <img src="images/cmstemplate/bg-th-right.gif" width="7" height="7" alt="" class="right" />
<table class="listing form" cellpadding="0" cellspacing="0">
<tr>
<th class="full" colspan="2">Header Here</th>
</tr>
<tr>
<td class="first" width="172"><strong>Lorem Ipsum</strong></td>
<td class="last"><input type="text" class="text" /></td>
</tr>
<tr class="bg">
<td class="first"><strong>Lorem Ipsum</strong></td>
<td class="last"><input type="text" class="text" /></td>
</tr>
<tr>
<td class="first"><strong>Lorem Ipsum</strong></td>
<td class="last"><input type="text" class="text" /></td>
</tr>
<tr class="bg">
<td class="first"><strong>Lorem Ipsum</strong></td>
<td class="last"><input type="text" class="text" /></td>
</tr>
</table>
<p> </p>
</div>
<div id="content">
<h1>Class 1</h1>
<h2>Class H2</h2>
<h3>Class H3</h3>
<h4>Class H4</h4>
<p>Some typical content is here for your perusal</p>
</div>
</div>
<div id="right-column">
<h3>Header</h3>
<ul class="nav">
<li><a href="http://www.free-css.com/">Lorem Ipsum dollar</a></li>
<li><a href="http://www.free-css.com/">Dollar</a></li>
<li><a href="http://www.free-css.com/">Lorem dollar</a></li>
<li><a href="http://www.free-css.com/">Ipsum dollar</a></li>
<li><a href="http://www.free-css.com/">Lorem Ipsum dollar</a></li>
<li class="last"><a href="http://www.free-css.com/">Dollar Lorem Ipsum</a></li>
</ul>
<a href="http://www.free-css.com/" class="link">Link here</a> <a href="http://www.free-css.com/" class="link">Link here</a>
<strong class="h">INFO</strong>
<div class="box">Detect and eliminate viruses and Trojan horses, even new and unknown ones. Detect and eliminate viruses and Trojan horses, even new and </div>
</div>
</div>
<!-- InstanceEndEditable -->
<div id="footer"></div>
</div>
</body>
<!-- InstanceEnd --></html>