Blame view

site/recherche.php 3.01 KB
19ae2416   jnduwamu   MAJ du site
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
  <?php
  session_start();
  ?>
  <!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-6 col-md-6 offset-md-3 offset-3">
                  			<br/>
39579493   root   MAJ Site
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>
19ae2416   jnduwamu   MAJ du site
22
23
                  			<table class="table table-striped table-bordered">
                          			<tbody>
fccb88d3   grouille   MAJ
24
                                  			<th class="thead-dark">
19ae2416   jnduwamu   MAJ du site
25
26
27
28
29
30
                                  		        	<td>Nom</td>
                                          			<td>Raspberry</td>
                                          			<td>Type</td>
                                          			<td>Valeur</td>
                                          			<td>Unité</td>
                                          			<td>Date</td>
fccb88d3   grouille   MAJ
31
                                  			</th>
19ae2416   jnduwamu   MAJ du site
32
33
34
35
36
37
38
39
40
41
42
  
                                  			<div id="sensors">
                                          			<?php
  								$name = $_POST['nom'];
  								$type = $_POST['type'];
  								$raspberry = $_POST['raspberry'];
  								$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'];}
6b916214   Guillaume   Test Graphe
43
44
  								else $start = $start."  00:00:00";
  
19ae2416   jnduwamu   MAJ du site
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
  								$history = getHistory($name, $type, $raspberry, $start, $end, $_POST['nombre']);
                                          			foreach($history as $sensor){
                                                  			?>
                                                  			<tr>
                                                          			<td><?php echo $sensor['name'];?></td>
                                                          			<td><?php echo $sensor['raspberry'];?></td>
                                                          			<td><?php echo $sensor['type'];?></td>
                                                          			<td><?php echo $sensor['value'];?></td>
                                                          			<td><?php echo $sensor['unite'];?></td>
                                                          			<td><?php echo $sensor['date'];?></td>
                                                  			</tr>
                                                  			<?php
                                          			}
                                          			?>
                                  			</div>
                          			</tbody>
                  			</table>
          			</div>
  			</div>
  			<?php
                  }
                  else
                  {
                          include("formConnexion.php");
                  }
                  ?>
          </body>
  </html>