From c1606691e1d88445ee5c9bd32a9fa49b786d0554 Mon Sep 17 00:00:00 2001 From: lwadbled Date: Mon, 6 Dec 2021 14:19:20 +0100 Subject: [PATCH] feat(gestionBanc.php): ajout de la gestion des bancs par un administrateur --- html/ajoutBanc.php | 36 ++++++++++++++++++++++++++++++++++++ html/gestionAppareil.php | 2 +- html/gestionBanc.php | 73 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ html/menu.php | 3 +++ html/supprBanc.php | 13 +++++++++++++ 5 files changed, 126 insertions(+), 1 deletion(-) create mode 100644 html/ajoutBanc.php create mode 100644 html/gestionBanc.php create mode 100644 html/supprBanc.php diff --git a/html/ajoutBanc.php b/html/ajoutBanc.php new file mode 100644 index 0000000..abb4596 --- /dev/null +++ b/html/ajoutBanc.php @@ -0,0 +1,36 @@ + + + + + Page principale + + + + + "; + } + include("connexion.php"); + if(isset($_GET['banc'])){ + $banc = $_GET['banc']; + echo "banc = ".$banc."
"; + $requete = "INSERT INTO banc VALUES($banc)"; + $exec_requete = mysqli_query($db,$requete); + echo ""; + }else{ + //echo "L'ajout n'a pas fonctionné"; + echo ""; + } + mysqli_close($db); + ?> + + diff --git a/html/gestionAppareil.php b/html/gestionAppareil.php index 3646b93..83f1337 100644 --- a/html/gestionAppareil.php +++ b/html/gestionAppareil.php @@ -2,7 +2,7 @@ - Mes réservations + Gestion des appareils + + + + Gestion des bancs + + + + +
+ +
+ "; + } + include("connexion.php"); + $requete = "SELECT * FROM banc"; + $exec_requete = mysqli_query($db,$requete); + $banc = mysqli_fetch_all($exec_requete); + $requete = "SELECT count(*) FROM banc"; + $exec_requete = mysqli_query($db,$requete); + $nb_banc = mysqli_fetch_all($exec_requete); + $nouv_banc = $nb_banc[0][0]+1; + /* Affichage des appareils */ + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + foreach($banc as $value){ + echo ""; + echo ""; + $requete = "SELECT count(*) FROM equipement WHERE num=$value[0]"; + $exec_requete = mysqli_query($db,$requete); + $reponse = mysqli_fetch_all($exec_requete); + echo ""; + echo ""; + echo ""; + } + /* Ajout appareil */ + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo "
BancNombre d'appareil
".$value[0]."".$reponse[0][0].""; + if($value[0]==$nouv_banc-1){ + echo "
"; + } + echo "
$nouv_banc
"; + echo ""; + mysqli_close($db); + ?> + + + + diff --git a/html/menu.php b/html/menu.php index 724007f..592af18 100644 --- a/html/menu.php +++ b/html/menu.php @@ -40,6 +40,9 @@ "; + echo ""; + echo ""; echo "
"; echo ""; echo "
"; diff --git a/html/supprBanc.php b/html/supprBanc.php new file mode 100644 index 0000000..82920a9 --- /dev/null +++ b/html/supprBanc.php @@ -0,0 +1,13 @@ +"; + mysqli_close($db); +} +?> -- libgit2 0.21.2