Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <?php include "connexion.php"; ?>
- <?php
- $db_host = 'localhost'; // Server Name
- $db_user = 'root'; // Username
- $db_pass = 'Km55kLQL97'; // Password
- $db_name = 'gestion_de_cles'; // Database Name
- $conn = mysqli_connect($db_host, $db_user, $db_pass, $db_name);
- if (!$conn) {
- die ('Failed to connect to MySQL: ' . mysqli_connect_error());
- }
- if(isset($_GET['recherche']))
- {
- $rec = htmlentities($_GET['recherche']);
- }
- else
- {
- $rec = '';
- }
- $sql = 'SELECT *
- FROM stock,repertorier WHERE num_Armoire LIKE"%'.$rec.'%" OR nbrTotal_Armoire LIKE "%'.$rec.'%" AND reference_Cles LIKE"%'.$rec.'%"';
- $query = mysqli_query($conn, $sql);
- if (!$query) {
- die ('SQL Error: ' . mysqli_error($conn));
- }
- ?>
- <html>
- <head>
- <meta charset="utf-8" />
- <link rel="stylesheet" href="../style/stock6.css" />
- <title>GESTION DE CLES</title>
- </head>
- <div class="page-container">
- <div class="content">
- <?php include "menu.php";?>
- </div>
- </div>
- <h1>STOCK DE CLES</h1>
- <div class="div-head">
- <table class="data-table-head">
- <caption class="title">Stock en temps réel de vos clés</caption>
- <thead>
- <tr>
- <th class="text">N°</th>
- <th class="text">N° D' Armoire</th>
- <th class="text">Clés Disponible</th>
- <th class="text">Clés Total</th>
- <th class="text">Référence Clé</th>
- </tr>
- </thead>
- </table>
- </div>
- <div class="div-body">
- <table class="data-table">
- <tbody>
- <?php
- $no = 1;
- $total = 0;
- while ($row = mysqli_fetch_array($query))
- {
- echo '<tr>
- <td>'.$no.'</td>
- <td>'.$row['num_Armoire'].'</td>
- <td>'.$row['nbrDisponible_Armoire'].'</td>
- <td>'.$row['nbrTotal_Armoire'].'</td>
- <td>'.$row['reference_Cles'].'</td>
- </tr>';
- $total += $row['nbrTotal_Armoire'];
- $no++;
- }?>
- </tbody>
- </table>
- </div>
- <div class="div-foot">
- <table class="data-table-foot">
- <tfoot>
- <tr>
- <th colspan="3">TOTAL</th>
- <th class="resultat"><?=number_format($total)?></th>
- <th></th>
- </tr>
- </tfoot>
- </table>
- </div>
- <div class="rechercher">
- <form action="" method="get">
- <input class="recherche" type="search" placeholder="Entrer votre recherche" name="recherche" value="<?php echo $rec; ?>">
- <input type="checkbox" name="fb" id="fb" value="Football" /> <label for="fb">TOUT</label>
- </form>
- </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement