-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathindex.php
More file actions
73 lines (67 loc) · 1.88 KB
/
index.php
File metadata and controls
73 lines (67 loc) · 1.88 KB
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
<html>
<head>
<meta charset="utf-8" lang="hu">
<title>Raspberry weather station</title>
<style>
ul {
width: 500px;
list-style-type: none;
margin: 0;
padding: 0;
overflow: hidden;
background-color: #848484;
}
li {
float: left;
}
li a {
display: block;
color: white;
text-align: center;
padding: 16px;
text-decoration: none;
}
li a:hover {
background-color: #2e2e2e;
}
li a:active {
background-color: #08088a;
}
button {
color: white;
background-color: #848484;
}
</style>
</head>
<body bgcolor="darkgrey">
<ul>
<li><a href="all.html" target="iframe">All</a></li>
<li><a href="avg.html" target="iframe">Average</a></li>
<li><a href="min.html" target="iframe">Minimum</a></li>
<li><a href="max.html" target="iframe">Maximum</a></li>
<li><a href="custom.html" target="iframe">Custom</a></li>
</ul><br>
<iframe scrolling="no" src="all.html" id="iframe" name="iframe" frameborder="none" height="410" width="510">grafikonok megjelenitése</iframe><br>
<form action="" method="post" id="buttons" name="buttons">
<label>Tól (pl.: 2018-03-31 22:03:03): <input type="text" name="from" id="from" value="0"></label><br>
<label>Ig (pl.: 2018-04-31 22:03:03): <input type="text" name="to" id="to" value="0"></label><br>
<button name="Custom Graph" id="custom">Dátumok lekérdezése</button><br>
<button name="refresh graph" id="refresh">Teljes lekérdezés</button><br>
</form>
<?php
if (isset($_POST["custom"])) {
$from = $_POST["from"];
$to = $_POST["to"];
exec('python3 /var/www/html/plot.py "'. $from.'" "'.$to . '" > /dev/null 2>/dev/null &');
sleep(3);
}
if (isset($_POST["refresh"])) {
$command = escapeshellcmd('/var/www/html/test.py');
shell_exec($command);
exec('python3 /var/www/html/test.py > /dev/null 2>/dev/null &');
sleep(5);
header("reload:0;");
}
?>
</body>
</html>