Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html>
- <head>
- <meta charset="utf-8">
- <link rel="stylesheet" type="text/css" href="style.css">
- <title>projet</title>
- </head>
- <body>
- <div id="banner1">
- <p>Système de stockage</p>
- </div>
- <div id="menu">
- <ul>
- <li><a href="Menu.html">Menu</a></li>
- <li><a href="simulation.php">Présentation</a></li>
- <li><a href="Docs.html">Contact</a></li>
- </ul>
- </div>
- <div id="banner2">
- </div>
- <div id="contenuprincipal">
- <div id="image">
- <?php
- include("bdd.inc.php");
- ?>
- <!-- SERRE-->
- <div class="left">
- <p>Serre</p>
- <form action="#" method="post">
- <table align="center">
- <tr>
- <td>
- <label> Date </label>
- </td>
- <td>
- <input type="text" placeholder="YYYY-MM-DD" name="dateserre">
- </td>
- </tr>
- <tr>
- <td>
- <label> Température </label>
- </td>
- <td>
- <input type="text" name="tempserre">
- </td>
- </tr>
- <tr>
- <td>
- <label> Hygrométrie </label>
- </td>
- <td>
- <input type="text" name="hygro">
- </td>
- </tr>
- <tr>
- <td>
- <input type="submit" name="send" value="envoyer">
- </td>
- </tr>
- <tr>
- <td>
- <input type="submit" name="send1" value="aléatoire">
- </td>
- </tr>
- </table>
- </form>
- </div>
- <!-- RUCHE -->
- <div class="right">
- <p>Ruche</p>
- <form action="#" method="post">
- <table align="center">
- <tr>
- <td>
- <label> Date </label>
- </td>
- <td>
- <input type="text" placeholder="YYYY-MM-DD" name="dateruche">
- </td>
- </tr>
- <tr>
- <td>
- <label> Température </label>
- </td>
- <td>
- <input type="text" name="tempruche">
- </td>
- </tr>
- <tr>
- <td>
- <label> Poids </label>
- </td>
- <td>
- <input type="text" name="poids">
- </td>
- </tr>
- <tr>
- <td>
- <input type="submit" name="send2" value="envoyer">
- </td>
- </tr>
- <tr>
- <td>
- <input type="submit" name="send3" value="aléatoire">
- </td>
- </tr>
- </table>
- </form>
- </div>
- <div class="clean">
- </div>
- <?php //ENVOIE DES DONNES DE LA SERRE
- if(isset($_POST['send']))
- {
- $dateserre = $_POST['dateserre'];
- $tempserre = $_POST['tempserre'];
- $hygro = $_POST['hygro'];
- $SQL = "INSERT INTO serre VALUES (NULL, '$dateserre', '$tempserre', '$hygro')";
- $request = $conn->query($SQL);
- header('Location:#');
- exit;
- }
- if(isset($_POST['send1']))
- {
- $x = 1;
- while ($x <= 6) {
- $dateserre = date('Y-m-d',time());
- $tempserre = rand(0,99);
- $hygro = rand(0,99);
- $SQL = "INSERT INTO serre VALUES (NULL, '$dateserre', '$tempserre', '$hygro')";
- $request = $conn->query($SQL);
- header('Location:#');
- exit;
- $x++;
- }
- //ENVOIE DES DONNES DE LA RUCHE
- if(isset($_POST['send2']))
- {
- $dateruche = $_POST['dateruche'];
- $tempruche = $_POST['tempruche'];
- $poids = $_POST['poids'];
- $SQL = "INSERT INTO ruche VALUES (NULL, '$dateruche','$tempruche','$poids')";
- $request = $conn->query($SQL);
- header('Location:#');
- exit;
- }
- if(isset($_POST['send3']))
- {
- $x = 1;
- while ($x <= 6) {
- $dateruche = date('Y-m-d',time());
- $tempruche = rand(0,99);
- $poids = rand(0,99);
- $SQL = "INSERT INTO ruche VALUES (NULL, '$dateruche','$tempruche','$poids')";
- $request = $conn->query($SQL);
- header('Location:#');
- exit;
- $x++;
- }
- }
- //AFFICHAGE DES DONNES DE LA SERRE ET DE LA RUCHE DANS DES TABLEAUX SÉPARÉS
- $SQL = "SELECT * FROM serre";
- $request = $conn ->query($SQL);
- $SQL1 = "SELECT * FROM ruche";
- $request1 = $conn ->query($SQL1);
- ?>
- <div class="left">
- <table class="affichage" border="1" align="center">
- <caption>SERRE</caption>
- <tr>
- <th>
- Date
- </th>
- <th>
- Température
- </th>
- <th>
- Hygrométrie
- </th>
- </tr>
- <?php
- while ($result = $request ->fetch())
- {
- ?>
- <tr>
- <td>
- <?php echo $result['dateserre']; ?>
- </td>
- <td>
- <?php echo $result['tempserre']; ?>
- </td>
- <td>
- <?php echo $result['hygro']; ?>
- </td>
- </tr>
- <?php
- }
- ?>
- </table>
- </div>
- <div class="right">
- <table class="affichage" border="1" align="center">
- <caption>RUCHE</caption>
- <tr>
- <th>
- Date
- </th>
- <th>
- Température
- </th>
- <th>
- Poids
- </th>
- </tr>
- <?php
- while ($result1 = $request1 ->fetch())
- {
- ?>
- <tr>
- <td>
- <?php echo $result1['dateruche']; ?>
- </td>
- <td>
- <?php echo $result1['tempruche']; ?>
- </td>
- <td>
- <?php echo $result1['poids']; ?>
- </td>
- </tr>
- <?php
- }
- ?>
- </table>
- </div>
- <!-- FIN AFFICHAGE -->
- <div class="clean">
- </div>
- </div>
- <footer id="footer">
- <p>Projet STI2D Lyon ORT</p>
- </footer>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement