-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
73 lines (68 loc) · 4.26 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
70
71
72
73
<?php
require_once('session_check.php');
require_once 'WebServiceClient.php';
$display_err_style= $_SESSION['errCode'] == ERR_NO_ERROR ? 'style="display: none;"' : 'style="display: block;"';
?>
<!DOCTYPE html>
<html lang="en">
<head title="WeatherFez">
<?php require_once('header.php'); ?>
<!-- auto refresh della pagina ogni 5 secondi -->
<meta http-equiv="refresh" content="5;URL='index.php'">
</head>
<body>
<!-- Intestazione -->
<div class="container-fluid">
<?php require_once('intestazione.php'); ?>
</div>
<!-- Corpo -->
<div class="container">
<div class="row">
<div class="col-sm-3 st_menu">
<!-- menu laterale -->
<?php require_once('menu.php'); ?>
</div>
<div class="col-sm-9 st_main">
<div class="container-fluid">
<div class="row">
<h1>Realtime Data<h1>
<div class="container-fluid">
<!-- Alert di errore -->
<?php require_once('error_alert.php') ?>
<!-- contenuto della pagina -->
<div class="row">
<div class="col-md-9">
<?php
//Chiedo i dati realtime
$rt_val = WebServiceClient::get_instant_values();
$instant_value = explode(";", $rt_val);
?>
<h3>Last measurement at: <?php echo $instant_value[0]; ?></h3>
<table>
<tr style="border-top: 10px solid transparent; border-bottom: 10px solid transparent; border-color: transparent;">
<td width="100" heigth="1000"><img width="64" height="64" src="img/termometro.png"/></td>
<td width="1000" heigth="1000"><?php echo isset($instant_value[1]) ? $instant_value[1] : '20'?> °C</td>
</tr>
<tr style="border-top: 10px solid transparent; border-bottom: 10px solid transparent; border-color: transparent;">
<td width="100" heigth="1000"><img width="64" height="64" src="img/water.png"/></td>
<td width="1000" heigth="1000"><?php echo isset($instant_value[2]) ? $instant_value[2] : '50'?> %</td>
</tr>
<tr style="border-top: 10px solid transparent; border-bottom: 10px solid transparent; border-color: transparent;">
<td width="100" heigth="1000"><img width="64" height="64" src="img/pressure.png"/></td>
<td width="1000" heigth="1000"><?php echo isset($instant_value[3]) ? $instant_value[3] : '980.0'?> hPa</td>
</tr>
<tr style="border-top: 10px solid transparent; border-bottom: 10px solid transparent; border-color: transparent;">
<td width="100" heigth="1000"><img width="64" height="64" src="img/sun.png"/></td>
<td width="1000" heigth="1000"><?php echo isset($instant_value[4]) ? $instant_value[4] : '400'?> lux</td>
</tr>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</body>
</html>