";
}
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";
}
}
?>
";
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);
$personne = $reponse[0][0];
echo "$personne | ";
if($reponse[0][0]==""){
echo "";
}else if($reponse[0][0]=="admin"){
echo " | ";
}else{
echo " | ";
}
echo " |
";
}
echo "";
echo "";
echo "";
mysqli_close($db);
?>