diff --git a/html/gestionReservation.php b/html/gestionReservation.php new file mode 100644 index 0000000..99575d2 --- /dev/null +++ b/html/gestionReservation.php @@ -0,0 +1,122 @@ + + + + + Gestion des reservations + + + + +
+ +
+ "; + } + include("connexion.php"); + $requete = "SELECT * FROM banc ORDER BY numero"; + $exec_requete = mysqli_query($db,$requete); + $reponse = mysqli_fetch_all($exec_requete); + if(isset($_POST['txtDate']) && isset($_POST['banc'])){ + $txtDate = $_POST['txtDate']; + $banc = $_POST['banc']; + }else{ + $txtDate = date("Y-n-j"); + $banc = $reponse[0][0]; + /* Verification de la syntaxe de la date */ + $explosion_date = explode("-",$txtDate); + $jour = $explosion_date[2]; + if($jour<10){ + $jour = "0$jour"; + $mois = $explosion_date[1]; + $annee = $explosion_date[0]; + $txtDate = "$annee-$mois-$jour"; + } + } + ?> + +
+
+ required> +
+ +
+ Banc choisi : + +
+
+
+ "; + echo ""; + echo ""; + echo "Heure de début"; + echo "Reservé par"; + echo ""; + echo ""; + echo ""; + echo ""; + for($i=0;$i<24;$i++){ + if($i<10){ + $heure = "0".$i.":00"; + }else{ + $heure = $i.":00"; + } + echo ""; + echo "$heure"; + /* Requete pour connaitre l'utilisateur reservant le creneau s'il y en a un */ + /* Reecriture de la date */ + $explosion_date = explode("-",$txtDate); + $jour = $explosion_date[2]; + $mois = $explosion_date[1]; + $annee = $explosion_date[0]; + $new_date = "$jour/$mois/$annee"; + /* Fin reecriture date */ + $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); + echo "".$reponse[0][0].""; + if($reponse[0][0]==""){ + /* TODO : Bonnes redirections vers les bons fichiers */ + echo "
"; + }else if($reponse[0][0]=="admin"){ + echo "
"; + }else{ + echo "
"; + } + echo ""; + } + echo ""; + echo ""; + echo ""; + mysqli_close($db); + ?> +
+ + + + diff --git a/html/menu.php b/html/menu.php index 592af18..52c8ada 100644 --- a/html/menu.php +++ b/html/menu.php @@ -46,6 +46,9 @@ echo "
"; echo ""; echo "
"; + echo "
"; + echo ""; + echo "
"; } ?> -- libgit2 0.21.2