-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.php
More file actions
33 lines (31 loc) · 853 Bytes
/
index.php
File metadata and controls
33 lines (31 loc) · 853 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
33
<?php
$data = "data.json";
$json_source = file_get_contents($data);
$json_data = json_decode($json_source);
$degres = $json_data->temperature;
$hauteurcalc = (161 + ($degres * 4));
$topcalc = (315 + -($degres * 4));
$edittime = date("d/m/Y H:i:s.",filemtime("data.json"));
?>
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" type="text/css" href="stylesheets/style.css">
<meta charset="utf-8">
<title>Thermomètre</title>
</head>
<body>
<h1>Température</h1>
<p>Date de prise de température : <?php echo $edittime ?> </p>
<p>Il fait <?php echo $json_data->temperature ; ?>°C avec <?php echo $json_data->humidite ; ?>% d'humidité.</br></p>
<div id="thermometer">
<div id="bargraph"></div>
</div>
</body>
</html>
<style type="text/css">
#bargraph {
top: <?php echo $topcalc."px" ?>;
height: <?php echo $hauteurcalc."px" ?>;
}
</style>