graphique.php 1.22 KB
<?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-8 col-md-8 offset-md-2 offset-2">
					<br/>
					<h1 style="margin-bottom:20px; margin-top:30px; border-bottom:1px solid #CCC; padding-bottom:20px;"><i class="fas fa-chart-line"></i> Graphe du capteur</h1>
					<?php
					echo "<img src='graphe.php?nom=$nom&nombre=$nombre&start=$start&end=$end' alt='graphe'>";
					?>
				</div>
			</div>
			<?php
                }
                else
                {
                        include("formConnexion.php");
                }
                ?>
        </body>
</html>