-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
69 lines (64 loc) · 1.66 KB
/
index.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
<?php include '/var/www/include/index.inc'; ?> <html> <title>EMF 1 Data Logger</title> <style> table, th, td {
border: 1px solid black;
}
</style>
<body>
<?php
$curr_wind = date('Y-m-d');
//$curr_wind = "2023-04-10";
//echo $curr_wind;
//echo "<br> \n";
$reads = get_EMF_reads($curr_wind);
echo "<h2>External Sensor Data for " . $curr_wind;
echo "\n";
?>
<table style="width:50%">
<tr>
<th><font size="8">Sensor</font></th>
<th><font size="8">Timestamp</font></th>
<th><font size="8">Sensor Value</font></th>
<th><font size="8">Derived mg</font></th>
<th><font size="8">Derived uT</font></th>
</tr>
<?php
echo "\n";
$numofrecs = sizeof($reads);
for ($rd=0; $rd<$numofrecs;$rd++)
{
echo "\t<tr> \n";
echo "\t\t<td align=center><font size=6>";
printf("%s",$reads[$rd][0]);
echo "</font> \n";
echo "\t\t</td> \n";
echo "\n";
echo "\t\t<td align=center><font size=6>";
printf("%s",$reads[$rd][1]);
echo "</font> \n";
echo "\t\t</td> \n";
echo "\n";
echo "\t\t<td align=center><font size=6>";
printf("%s",$reads[$rd][2]);
echo "</font> \n";
echo "\t\t</td> \n";
echo "\n";
echo "\t\t<td align=center><font size=6>";
printf("%.2f mg",$reads[$rd][3]);
echo "</font> \n";
echo "\t\t</td> \n";
echo "\t\t<td align=center><font size=6>";
printf("%.2f uT",$reads[$rd][4]);
echo "</font> \n";
echo "\t\t</td> \n";
echo "\t</tr> \n";
}
echo "</table> \n";
//$myFile = '/home/johns/EMF/EMF1_log.txt';
//$lines = file('/home/johns/EMF/EMF1_log.txt');
//$count = 0;
//foreach($lines as $line) {
// $count += 1;
// echo $line. "<br>";
//}
?>
</body>
</html>