From 83dd807ae7122f87f766e35d04277f7058acab31 Mon Sep 17 00:00:00 2001 From: lwadbled Date: Thu, 6 Jan 2022 15:40:09 +0100 Subject: [PATCH] fix(Reservation): correction de bugs --- html/ajoutReservation.php | 2 ++ html/gestionReservation.php | 10 +++++++--- html/supprReservation.php | 2 +- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/html/ajoutReservation.php b/html/ajoutReservation.php index 5831eb8..089c9d2 100644 --- a/html/ajoutReservation.php +++ b/html/ajoutReservation.php @@ -55,6 +55,8 @@ $heure = $_GET['heure']; $requete = "INSERT INTO reservation VALUES($banc,'$date','$login','$heure','$heurefin')"; $exec_requete = mysqli_query($db,$requete); + $requete = "INSERT INTO creneau VALUES('$date')"; + $exec_requete = mysqli_query($db,$requete); echo ""; }else{ //echo "L'ajout n'a pas fonctionné"; diff --git a/html/gestionReservation.php b/html/gestionReservation.php index 8479c89..8b1ca66 100644 --- a/html/gestionReservation.php +++ b/html/gestionReservation.php @@ -100,9 +100,13 @@ $requete = "SELECT personne FROM reservation WHERE moment='$new_date' AND reserve=$banc AND HEUREDEBUT='$heure'"; $exec_requete = mysqli_query($db,$requete); $reponse = mysqli_fetch_all($exec_requete); - $personne = $reponse[0][0]; - echo "$personne"; - if($reponse[0][0]==""){ + if($reponse!=null){ + $personne = $reponse[0][0]; + echo "$personne"; + }else{ + echo ""; + } + if($reponse==null){ echo "
"; }else if($reponse[0][0]=="admin"){ echo "
"; diff --git a/html/supprReservation.php b/html/supprReservation.php index 8751fb8..4f97e7b 100644 --- a/html/supprReservation.php +++ b/html/supprReservation.php @@ -14,7 +14,7 @@ if(isset($_GET['banc']) && isset($_GET['moment']) && isset($_GET['personne']) && $requete = "DELETE FROM reservation WHERE reserve=$banc and moment='$moment' and personne = '$personne' and heuredebut='$heuredebut'"; $exec_requete = mysqli_query($db,$requete); - $reponse = mysqli_fetch_array($exec_requete); + //$reponse = mysqli_fetch_array($exec_requete); if($identifiant=="admin"){ echo ""; }else{ -- libgit2 0.21.2