-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.php
More file actions
32 lines (30 loc) · 931 Bytes
/
Copy pathindex.php
File metadata and controls
32 lines (30 loc) · 931 Bytes
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
<html>
<head>
<link rel="stylesheet" href="styles.css">
</head>
<body>
<?php
$d = dir(getcwd());
while (($file = $d->read()) !== false){
if (strpos($file,".php")==true or strpos($file,".html")==true){
echo "<a href=\"$file\">".$file."</a>\n";
}}
$d->close();
?>
<a href="talo/index.php">kuvaaja</a>
<table>
<tr><th>Nimi</th><th>Arvo</th></tr>
<?php
$db = new SQLite3('/home/talo/data/talo.db');
$result = $db->query("SELECT value,position_name FROM talo_data,talo_positions where time=(select max(time) from talo_data) and position_id = talo_positions.id;");
while($data = $result->fetchArray()){
echo "<tr><td>".$data['position_name']."</td><td>".round($data['value'],1)."</td></tr>\n";}
$db->close();
?>
</table>
<form action="keskiarvo.php" method="get">
<label for="h"> Min, max ja keskiarvot annetulla ajalla: h:</label>
<input type="number" id="h" name="h">
<input type="submit" value="submit">
</form>
</html>