graphique.php
1.5 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
<?php
session_start();
require_once("accesBase.php");
$nom = $_POST['nom'];
$nombre = $_POST['nombre'];
$start = $_POST['start-date'];
$end = $_POST['end-date'];
if(($end == NULL) || ($end < $start)) {$e = date_max(); $end = $e['max'];}
else $end = $end." 23:59:59";
if($start == NULL) {$s = date_min(); $start = $s['min'];}
else $start = $start." 00:00:00";
?>
<!DOCTYPE html>
<html>
<head>
<?php include("head.php"); ?>
</head>
<!-- Contenu du site -->
<body>
<?php
include("header.php");
if(isset($_SESSION['Login'], $_SESSION['Password']))
{
?>
<div class="row">
<div class="col-10 col-md-10 offset-md-1 offset-1">
<br/>
<h1 style="margin-bottom:20px; margin-top:60px; border-bottom:1px solid #CCC; padding-bottom:20px;"><i class="fas fa-chart-line"></i> Graphe du capteur</h1>
<?php
if(historyExist($nom))
{
echo "<img src='graphe.php?nom=$nom&nombre=$nombre&start=$start&end=$end' alt='graphe'>";
}
else
{
?>
<div class="alert alert-danger" role="alert">
Il n'y a pas assez de valeurs pour ce capteur !
</div>
<meta http-equiv="Refresh" content="5;url=rechercheGraphe.php" />
<?php
}
?>
</div>
</div>
<?php
}
else
{
include("formConnexion.php");
}
?>
</body>
</html>