Advertisement
Guest User

Untitled

a guest
Apr 19th, 2018
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.64 KB | None | 0 0
  1. <!DOCTYPE html>
  2.  
  3. <html>
  4.  
  5. <head>
  6.  
  7. <meta charset="utf-8">
  8. <link rel="stylesheet" type="text/css" href="style.css">
  9.  
  10. <title>projet</title>
  11.  
  12. </head>
  13.  
  14. <body>
  15.  
  16. <div id="banner1">
  17. <p>Système de stockage</p>
  18. </div>
  19.  
  20. <div id="menu">
  21. <ul>
  22. <li><a href="Menu.html">Menu</a></li>
  23. <li><a href="simulation.php">Présentation</a></li>
  24. <li><a href="Docs.html">Contact</a></li>
  25. </ul>
  26. </div>
  27.  
  28. <div id="banner2">
  29. </div>
  30.  
  31. <div id="contenuprincipal">
  32.  
  33. <div id="image">
  34.  
  35. <?php
  36. include("bdd.inc.php");
  37. ?>
  38.  
  39.  
  40. <!-- SERRE-->
  41. <div class="left">
  42.  
  43. <p>Serre</p>
  44.  
  45. <form action="#" method="post">
  46. <table align="center">
  47. <tr>
  48. <td>
  49. <label> Date </label>
  50. </td>
  51. <td>
  52. <input type="text" placeholder="YYYY-MM-DD" name="dateserre">
  53. </td>
  54. </tr>
  55. <tr>
  56. <td>
  57. <label> Température </label>
  58. </td>
  59. <td>
  60. <input type="text" name="tempserre">
  61. </td>
  62. </tr>
  63. <tr>
  64. <td>
  65. <label> Hygrométrie </label>
  66. </td>
  67. <td>
  68. <input type="text" name="hygro">
  69. </td>
  70. </tr>
  71. <tr>
  72. <td>
  73. <input type="submit" name="send" value="envoyer">
  74. </td>
  75. </tr>
  76. <tr>
  77. <td>
  78. <input type="submit" name="send1" value="aléatoire">
  79. </td>
  80. </tr>
  81. </table>
  82. </form>
  83. </div>
  84.  
  85. <!-- RUCHE -->
  86.  
  87.  
  88. <div class="right">
  89.  
  90. <p>Ruche</p>
  91.  
  92. <form action="#" method="post">
  93.  
  94. <table align="center">
  95. <tr>
  96. <td>
  97. <label> Date </label>
  98. </td>
  99. <td>
  100. <input type="text" placeholder="YYYY-MM-DD" name="dateruche">
  101. </td>
  102. </tr>
  103. <tr>
  104. <td>
  105. <label> Température </label>
  106. </td>
  107. <td>
  108. <input type="text" name="tempruche">
  109. </td>
  110. </tr>
  111. <tr>
  112. <td>
  113. <label> Poids </label>
  114. </td>
  115. <td>
  116. <input type="text" name="poids">
  117. </td>
  118. </tr>
  119. <tr>
  120. <td>
  121. <input type="submit" name="send2" value="envoyer">
  122. </td>
  123. </tr>
  124. <tr>
  125. <td>
  126. <input type="submit" name="send3" value="aléatoire">
  127. </td>
  128. </tr>
  129. </table>
  130. </form>
  131.  
  132. </div>
  133.  
  134. <div class="clean">
  135. </div>
  136.  
  137. <?php //ENVOIE DES DONNES DE LA SERRE
  138.  
  139.  
  140. if(isset($_POST['send']))
  141.  
  142. {
  143. $dateserre = $_POST['dateserre'];
  144. $tempserre = $_POST['tempserre'];
  145. $hygro = $_POST['hygro'];
  146.  
  147. $SQL = "INSERT INTO serre VALUES (NULL, '$dateserre', '$tempserre', '$hygro')";
  148. $request = $conn->query($SQL);
  149. header('Location:#');
  150. exit;
  151. }
  152.  
  153.  
  154. if(isset($_POST['send1']))
  155.  
  156. {
  157. $x = 1;
  158. while ($x <= 6) {
  159. $dateserre = date('Y-m-d',time());
  160. $tempserre = rand(0,99);
  161. $hygro = rand(0,99);
  162.  
  163. $SQL = "INSERT INTO serre VALUES (NULL, '$dateserre', '$tempserre', '$hygro')";
  164. $request = $conn->query($SQL);
  165. header('Location:#');
  166. exit;
  167. $x++;
  168. }
  169.  
  170. //ENVOIE DES DONNES DE LA RUCHE
  171.  
  172. if(isset($_POST['send2']))
  173.  
  174. {
  175. $dateruche = $_POST['dateruche'];
  176. $tempruche = $_POST['tempruche'];
  177. $poids = $_POST['poids'];
  178.  
  179. $SQL = "INSERT INTO ruche VALUES (NULL, '$dateruche','$tempruche','$poids')";
  180. $request = $conn->query($SQL);
  181. header('Location:#');
  182. exit;
  183. }
  184.  
  185.  
  186. if(isset($_POST['send3']))
  187.  
  188. {
  189. $x = 1;
  190. while ($x <= 6) {
  191. $dateruche = date('Y-m-d',time());
  192. $tempruche = rand(0,99);
  193. $poids = rand(0,99);
  194.  
  195. $SQL = "INSERT INTO ruche VALUES (NULL, '$dateruche','$tempruche','$poids')";
  196. $request = $conn->query($SQL);
  197. header('Location:#');
  198. exit;
  199. $x++;
  200. }
  201. }
  202.  
  203. //AFFICHAGE DES DONNES DE LA SERRE ET DE LA RUCHE DANS DES TABLEAUX SÉPARÉS
  204.  
  205. $SQL = "SELECT * FROM serre";
  206. $request = $conn ->query($SQL);
  207.  
  208. $SQL1 = "SELECT * FROM ruche";
  209. $request1 = $conn ->query($SQL1);
  210. ?>
  211.  
  212. <div class="left">
  213. <table class="affichage" border="1" align="center">
  214. <caption>SERRE</caption>
  215. <tr>
  216. <th>
  217. Date
  218. </th>
  219. <th>
  220. Température
  221. </th>
  222. <th>
  223. Hygrométrie
  224. </th>
  225. </tr>
  226.  
  227. <?php
  228. while ($result = $request ->fetch())
  229. {
  230. ?>
  231.  
  232. <tr>
  233. <td>
  234. <?php echo $result['dateserre']; ?>
  235. </td>
  236. <td>
  237. <?php echo $result['tempserre']; ?>
  238. </td>
  239. <td>
  240. <?php echo $result['hygro']; ?>
  241. </td>
  242. </tr>
  243.  
  244. <?php
  245. }
  246. ?>
  247.  
  248. </table>
  249. </div>
  250.  
  251. <div class="right">
  252. <table class="affichage" border="1" align="center">
  253. <caption>RUCHE</caption>
  254. <tr>
  255. <th>
  256. Date
  257. </th>
  258. <th>
  259. Température
  260. </th>
  261. <th>
  262. Poids
  263. </th>
  264. </tr>
  265. <?php
  266. while ($result1 = $request1 ->fetch())
  267. {
  268. ?>
  269. <tr>
  270. <td>
  271. <?php echo $result1['dateruche']; ?>
  272. </td>
  273. <td>
  274. <?php echo $result1['tempruche']; ?>
  275. </td>
  276. <td>
  277. <?php echo $result1['poids']; ?>
  278. </td>
  279. </tr>
  280. <?php
  281. }
  282. ?>
  283. </table>
  284. </div>
  285.  
  286. <!-- FIN AFFICHAGE -->
  287.  
  288. <div class="clean">
  289. </div>
  290. </div>
  291.  
  292. <footer id="footer">
  293.  
  294. <p>Projet STI2D Lyon ORT</p>
  295.  
  296. </footer>
  297.  
  298. </body>
  299.  
  300. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement