Advertisement
Guest User

antoine

a guest
Apr 9th, 2018
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.42 KB | None | 0 0
  1. <!DOCTYPE html>
  2.  
  3. <?php include "connexion.php"; ?>
  4.  
  5.  
  6. <?php
  7. $db_host = 'localhost'; // Server Name
  8. $db_user = 'root'; // Username
  9. $db_pass = 'Km55kLQL97'; // Password
  10. $db_name = 'gestion_de_cles'; // Database Name
  11.  
  12. $conn = mysqli_connect($db_host, $db_user, $db_pass, $db_name);
  13. if (!$conn) {
  14. die ('Failed to connect to MySQL: ' . mysqli_connect_error());
  15. }
  16.  
  17. if(isset($_GET['recherche']))
  18. {
  19. $rec = htmlentities($_GET['recherche']);
  20. }
  21. else
  22. {
  23. $rec = '';
  24. }
  25.  
  26. $sql = 'SELECT *
  27. FROM stock,repertorier WHERE num_Armoire LIKE"%'.$rec.'%" OR nbrTotal_Armoire LIKE "%'.$rec.'%" AND reference_Cles LIKE"%'.$rec.'%"';
  28.  
  29.  
  30.  
  31. $query = mysqli_query($conn, $sql);
  32.  
  33. if (!$query) {
  34. die ('SQL Error: ' . mysqli_error($conn));
  35. }
  36.  
  37.  
  38. ?>
  39.  
  40. <html>
  41.  
  42.  
  43. <head>
  44. <meta charset="utf-8" />
  45. <link rel="stylesheet" href="../style/stock6.css" />
  46. <title>GESTION DE CLES</title>
  47.  
  48. </head>
  49.  
  50.  
  51. <div class="page-container">
  52. <div class="content">
  53. <?php include "menu.php";?>
  54. </div>
  55. </div>
  56.  
  57. <h1>STOCK DE CLES</h1>
  58.  
  59.  
  60. <div class="div-head">
  61. <table class="data-table-head">
  62. <caption class="title">Stock en temps réel de vos clés</caption>
  63. <thead>
  64. <tr>
  65. <th class="text">N°</th>
  66. <th class="text">N° D' Armoire</th>
  67. <th class="text">Clés Disponible</th>
  68. <th class="text">Clés Total</th>
  69. <th class="text">Référence Clé</th>
  70. </tr>
  71. </thead>
  72. </table>
  73. </div>
  74.  
  75.  
  76. <div class="div-body">
  77. <table class="data-table">
  78. <tbody>
  79. <?php
  80. $no = 1;
  81. $total = 0;
  82. while ($row = mysqli_fetch_array($query))
  83. {
  84. echo '<tr>
  85. <td>'.$no.'</td>
  86. <td>'.$row['num_Armoire'].'</td>
  87. <td>'.$row['nbrDisponible_Armoire'].'</td>
  88. <td>'.$row['nbrTotal_Armoire'].'</td>
  89. <td>'.$row['reference_Cles'].'</td>
  90. </tr>';
  91. $total += $row['nbrTotal_Armoire'];
  92. $no++;
  93. }?>
  94. </tbody>
  95. </table>
  96. </div>
  97.  
  98. <div class="div-foot">
  99. <table class="data-table-foot">
  100. <tfoot>
  101. <tr>
  102. <th colspan="3">TOTAL</th>
  103. <th class="resultat"><?=number_format($total)?></th>
  104. <th></th>
  105. </tr>
  106. </tfoot>
  107. </table>
  108. </div>
  109.  
  110. <div class="rechercher">
  111. <form action="" method="get">
  112. <input class="recherche" type="search" placeholder="Entrer votre recherche" name="recherche" value="<?php echo $rec; ?>">
  113. <input type="checkbox" name="fb" id="fb" value="Football" /> <label for="fb">TOUT</label>
  114. </form>
  115. </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement