Commit 395794932b3070fbe18d4c17710142ac77dc84eb

Authored by root
1 parent 0071f5d7

MAJ Site

site/accesBase.php
... ... @@ -293,4 +293,20 @@
293 293 deconnexion($db);
294 294 return $tab;
295 295 }
  296 +
  297 + function historyExist($sensor)
  298 + {
  299 + $db = connexion();
  300 + $query = "SELECT * FROM history WHERE sensor = '$sensor'";
  301 + $result = pg_query($db, $query) or die("La requ te a echou : ".pg_last_error());
  302 + deconnexion($db);
  303 + if(pg_affected_rows($result)!=0)
  304 + {
  305 + return True;
  306 + }
  307 + else
  308 + {
  309 + return False;
  310 + }
  311 + }
296 312 ?>
... ...
site/add.php
... ... @@ -18,7 +18,7 @@ session_start();
18 18 <div class="row">
19 19 <div class="col-6 col-md-6 offset-md-3 offset-3">
20 20 <br/>
21   - <h1 style="margin-bottom:20px; margin-top:30px; border-bottom:1px solid #CCC; padding-bottom:20px;"><i class="fas fa-history"></i> Historique</h1>
  21 + <h1 style="margin-bottom:20px; margin-top:70px; border-bottom:1px solid #CCC; padding-bottom:20px;"><i class="fas fa-history"></i> Historique</h1>
22 22 <?php
23 23 if(add($_POST['nom'], $_POST['type'], $_POST['raspberry'], $_POST['numero'], $_POST['unite'], $_POST['version']))
24 24 {
... ...
site/addRaspberry.php
1 1 <div class="row">
2 2 <div class="col-6 col-md-6 offset-md-3 offset-3">
3 3 <br/>
4   - <h1 style="margin-bottom:20px; margin-top:30px; border-bottom:1px solid #CCC; padding-bottom:20px;"><i class="far fa-plus-square"></i> Ajout d'une Raspberry</h1>
  4 + <h1 style="margin-bottom:20px; margin-top:60px; border-bottom:1px solid #CCC; padding-bottom:20px;"><i class="far fa-plus-square"></i> Ajout d'une Raspberry</h1>
5 5 <form action="addRpi.php" method="post">
6 6 <table class="table table-striped table-bordered">
7 7 <tbody>
... ...
site/addRpi.php
... ... @@ -18,7 +18,7 @@ session_start();
18 18 <div class="row">
19 19 <div class="col-6 col-md-6 offset-md-3 offset-3">
20 20 <br/>
21   - <h1 style="margin-bottom:20px; margin-top:30px; border-bottom:1px solid #CCC; padding-bottom:20px;"><i class="fas fa-history"></i> Historique</h1>
  21 + <h1 style="margin-bottom:20px; margin-top:60px; border-bottom:1px solid #CCC; padding-bottom:20px;"><i class="fas fa-history"></i> Historique</h1>
22 22 <?php
23 23 if(addRpi($_POST['ip']))
24 24 {
... ...
site/addSensor.php
... ... @@ -4,7 +4,7 @@ $raspberrys = getRaspberrys();
4 4 <div class="row">
5 5 <div class="col-4 col-md-4 offset-md-4 offset-4">
6 6 <br/>
7   - <h1 style="margin-bottom:20px; margin-top:30px; border-bottom:1px solid #CCC; padding-bottom:20px;"><i class="far fa-plus-square"></i> Ajout d'un capteur</h1>
  7 + <h1 style="margin-bottom:20px; margin-top:60px; border-bottom:1px solid #CCC; padding-bottom:20px;"><i class="far fa-plus-square"></i> Ajout d'un capteur</h1>
8 8 <form action="add.php" method="post">
9 9 <table class="table table-striped table-bordered">
10 10 <tbody>
... ...
site/capteurs.php
... ... @@ -5,7 +5,7 @@ $sensors = getSensors();
5 5 <div class="row">
6 6 <div class="col-6 col-md-6 offset-md-3 offset-3">
7 7 <br/>
8   - <h1 style="margin-bottom:20px; margin-top:30px; border-bottom:1px solid #CCC; padding-bottom:20px;"><i class="fa fa-bars"></i> Choix du capteur</h1>
  8 + <h1 style="margin-bottom:20px; margin-top:60px; border-bottom:1px solid #CCC; padding-bottom:20px;"><i class="fa fa-bars"></i> Choix du capteur</h1>
9 9 <form action="reception.php" method="post" enctype="multipart/form-data">
10 10 <table class="table table-striped table-bordered">
11 11 <tbody>
... ...
site/form.php deleted
... ... @@ -1,5 +0,0 @@
1   -<form method="POST" action="reception.php" enctype="multipart/form-data">
2   - <input type="hidden" name="MAX_FILE_SIZE" value="100000">
3   - Fichier : <input type="file" name="fichier">
4   - <input type="submit" value="Envoyer" name="envoyer">
5   -</form>
site/formConnexion.php
1 1 <div class="row">
2 2 <div class="col-4 col-md-4 offset-md-4 offset-4">
3 3 <br/>
4   - <h1 style="margin-bottom:50px; margin-top:50px; border-bottom:1px solid #CCC; padding-bottom:20px;"><i class="fa fa-user-shield"></i> Connexion</h1>
  4 + <h1 style="margin-bottom:20px; margin-top:60px; border-bottom:1px solid #CCC; padding-bottom:20px;"><i class="fa fa-user-shield"></i> Connexion</h1>
5 5 <form action="connecter.php" method="post">
6 6 <table class="table table-striped table-bordered">
7 7 <tbody>
... ... @@ -18,4 +18,4 @@
18 18 <br/>
19 19 </form>
20 20 </div>
21   -</div>
22 21 \ No newline at end of file
  22 +</div>
... ...
site/formGraphe.php
... ... @@ -10,7 +10,7 @@ $date_max = $maxs[0];
10 10 <div class="row">
11 11 <div class="col-6 col-md-6 offset-md-3 offset-3">
12 12 <br/>
13   - <h1 style="margin-bottom:20px; margin-top:20px; border-bottom:1px solid #CCC; padding-bottom:20px;"><i class="fas fa-chart-line"></i> Affichage d'un graphe</h1>
  13 + <h1 style="margin-bottom:20px; margin-top:60px; border-bottom:1px solid #CCC; padding-bottom:20px;"><i class="fas fa-chart-line"></i> Affichage d'un graphe</h1>
14 14 <form action="graphique.php" method="post">
15 15 <table class="table table-striped table-bordered">
16 16 <tbody>
... ...
site/formInscription.php
1 1 <div class="row">
2 2 <div class="col-4 col-md-4 offset-md-4 offset-4">
3 3 <br/>
4   - <h1 style="margin-bottom:50px; margin-top:50px; border-bottom:1px solid #CCC; padding-bottom:20px;"><i class="fa fa-user-circle"></i> Inscription</h1>
  4 + <h1 style="margin-bottom:20px; margin-top:60px; border-bottom:1px solid #CCC; padding-bottom:20px;"><i class="fa fa-user-circle"></i> Inscription</h1>
5 5 <form action="inscription.php" method="post">
6 6 <table class="table table-striped table-bordered">
7 7 <tbody>
... ...
site/graphe.php
... ... @@ -19,43 +19,46 @@ $theme_class=new UniversalTheme;
19 19  
20 20 $graph->SetTheme($theme_class);
21 21 $graph->img->SetAntiAliasing(false);
22   -$graph->title->Set('Capteur '.$_REQUEST['nom']);
  22 +$graph->title->Set('Capteur '.$_REQUEST['nom'].' : '.$legend['type'].' ('.$legend['unite'].')');
23 23 $graph->SetBox(false);
24 24  
25   -$graph->SetMargin(40,30,40,150);
  25 +$graph->SetMargin(40,30,15,150);
26 26  
27 27 $graph->img->SetAntiAliasing();
28 28  
29 29 $graph->yaxis->HideZeroLabel();
30 30 $graph->yaxis->HideLine(false);
31 31 $graph->yaxis->HideTicks(false,false);
32   -$graph->yaxis->title->Set($legend['type']."(".$legend['unite'].")");
  32 +//$graph->yaxis->title->Set($legend['type']."(".$legend['unite'].")");
33 33  
34 34 $graph->xgrid->Show();
35 35 $graph->xgrid->SetLineStyle("solid");
36 36 $graph->xaxis->SetTickLabels($datax);
37   -$graph->xaxis->SetLabelAngle(80);
  37 +$graph->xaxis->SetLabelAngle(90);
38 38 $graph->xgrid->SetColor('#E3E3E3');
39 39  
40 40 // Create the line
41 41 $p = new LinePlot($datay);
42 42 $graph->Add($p);
43   -$p->SetColor('#5c0f10');
  43 +$p->SetColor('#eb3d34');//('#5c0f10');
44 44  
45   -// Afficher les valeurs pour chaque point
46   -$p->value->Show();
  45 +if($_REQUEST['nombre'] <= 40)
  46 +{
  47 + // Afficher les valeurs pour chaque point
  48 + $p->value->Show();
47 49  
48   -// Valeurs: Apparence de la police
49   -$p->value->SetFormat('%.1f');
50   -$p->value->SetColor('#0c0f52');
  50 + // Valeurs: Apparence de la police
  51 + $p->value->SetFormat('%.1f');
  52 + $p->value->SetColor('#0c0f52');
  53 +}
51 54  
52   -// Chaque point de la courbe ****
  55 +// Chaque point de la courbe
53 56 // Type de point
54 57 $p->mark->SetType(MARK_FILLEDCIRCLE);
55 58 // Couleur de remplissage
56 59 $p->mark->SetFillColor('#0D0D0D');
57 60 // Taille
58   -$p->mark->SetWidth(5);
  61 +$p->mark->SetWidth(2);
59 62  
60 63  
61 64 // Output line
... ...
site/graphique.php
... ... @@ -27,9 +27,21 @@ else $start = $start.&quot; 00:00:00&quot;;
27 27 <div class="row">
28 28 <div class="col-10 col-md-10 offset-md-1 offset-1">
29 29 <br/>
30   - <h1 style="margin-bottom:20px; margin-top:20px; border-bottom:1px solid #CCC; padding-bottom:20px;"><i class="fas fa-chart-line"></i> Graphe du capteur</h1>
  30 + <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>
31 31 <?php
32   - echo "<img src='graphe.php?nom=$nom&nombre=$nombre&start=$start&end=$end' alt='graphe'>";
  32 + if(historyExist($nom))
  33 + {
  34 + echo "<img src='graphe.php?nom=$nom&nombre=$nombre&start=$start&end=$end' alt='graphe'>";
  35 + }
  36 + else
  37 + {
  38 + ?>
  39 + <div class="alert alert-danger" role="alert">
  40 + Il n'y a pas assez de valeurs pour ce capteur !
  41 + </div>
  42 + <meta http-equiv="Refresh" content="5;url=rechercheGraphe.php" />
  43 + <?php
  44 + }
33 45 ?>
34 46 </div>
35 47 </div>
... ...
site/header.php
  1 +
1 2 <!-- header -->
2   -<header class="container-fluid header">
3   - <div class="container navbar-fixed-top">
  3 +<header class="container-fluid header" style="position: fixed; z-index:289;">
  4 + <div class="container">
4 5 <a href ="accueil.php" class="logo"><i class="fa fa-home"></i> Accueil</a>
5 6 <div class="menu">
6 7 <?php
... ...
site/hist.php
... ... @@ -12,7 +12,7 @@ $date_max = $maxs[0];
12 12 <div class="row">
13 13 <div class="col-4 col-md-4 offset-md-4 offset-4">
14 14 <br/>
15   - <h1 style="margin-bottom:20px; margin-top:20px; border-bottom:1px solid #CCC; padding-bottom:20px;"><i class="fa fa-search"></i> Recherche</h1>
  15 + <h1 style="margin-bottom:20px; margin-top:60px; border-bottom:1px solid #CCC; padding-bottom:20px;"><i class="fa fa-search"></i> Recherche</h1>
16 16 <form action="recherche.php" method="post">
17 17 <table class="table table-striped table-bordered">
18 18 <tbody>
... ...
site/recherche.php
... ... @@ -18,7 +18,7 @@ session_start();
18 18 <div class="row">
19 19 <div class="col-6 col-md-6 offset-md-3 offset-3">
20 20 <br/>
21   - <h1 style="margin-bottom:50px; margin-top:50px; border-bottom:1px solid #CCC; padding-bottom:20px;"><i class="fas fa-history"></i> Historique</h1>
  21 + <h1 style="margin-bottom:20px; margin-top:60px; border-bottom:1px solid #CCC; padding-bottom:20px;"><i class="fas fa-history"></i> Historique</h1>
22 22 <table class="table table-striped table-bordered">
23 23 <tbody>
24 24 <tr>
... ...
site/tableau.php
1 1 <div class="row">
2 2 <div class="col-4 col-md-4 offset-4 offset-md-4">
3   - <h1 style="margin-bottom:20px; margin-top:30px; border-bottom:1px solid #CCC; padding-bottom:20px;"><i class="fa fa-info-circle"></i> Informations complémentaires</h1>
  3 + <h1 style="margin-bottom:20px; margin-top:60px; border-bottom:1px solid #CCC; padding-bottom:20px;"><i class="fa fa-info-circle"></i> Informations complémentaires</h1>
4 4 <table class="table table-striped table-bordered">
5 5 <tbody>
6 6 <tr>
... ...
site/test.php deleted
... ... @@ -1,53 +0,0 @@
1   -<?php
2   -session_start();
3   -?>
4   -<!DOCTYPE html>
5   -
6   -<html>
7   - <head>
8   - <?php include("head.php"); ?>
9   - </head>
10   -
11   - <!-- Contenu du site -->
12   - <body>
13   - <?php
14   - include("header.php");
15   - if(isset($_SESSION['Login'], $_SESSION['Password']))
16   - {
17   - ?>
18   - <div class="row">
19   - <div class="col-6 col-md-6 offset-md-3 offset-3">
20   - <br/>
21   - <h1 style="margin-bottom:50px; margin-top:50px; border-bottom:1px solid #CCC; padding-bottom:20px;"><i class="fas fa-history"></i> Historique</h1>
22   - <?php
23   - if(add($_POST['nom'], $_POST['type'], $_POST['raspberry'], $_POST['numero'], $_POST['unite'])
24   - {
25   - ?>
26   - <div class="alert alert-success" role="alert">
27   - Le capteur a bien été ajouté !
28   - </div>
29   - <meta http-equiv="Refresh" content="3;url=accueil.php" />
30   - <?php
31   - }
32   - else
33   - {
34   - ?>
35   - <div class="alert alert-danger" role="alert">
36   - Echec lors de l'ajout. Vérifiez vos informations !
37   - </div>
38   - <meta http-equiv="Refresh" content="3;url=ajoutCapteur.php" />
39   - <?php
40   - }
41   - ?>
42   - </div>
43   - </div>
44   - <?php
45   - }
46   - else
47   - {
48   - include("formConnexion.php");
49   - }
50   - ?>
51   - </body>
52   -</html>
53   -
site/values.php
1 1 <div class="row">
2 2 <div class="col-6 col-md-6 offset-md-3 offset-3">
3 3 <br/>
4   - <h1 style="margin-bottom:50px; margin-top:50px; border-bottom:1px solid #CCC; padding-bottom:20px;"><i class="fas fa-database"></i> Valeurs des capteurs</h1>
  4 + <h1 style="margin-bottom:20px; margin-top:60px; border-bottom:1px solid #CCC; padding-bottom:20px;"><i class="fas fa-database"></i> Valeurs des capteurs</h1>
5 5 <table class="table table-striped table-bordered">
6 6 <tbody>
7 7 <tr>
... ...