"; } include("connexion.php"); $requete = "SELECT count(*) FROM reservation WHERE personne = '".$identifiant."'"; $exec_requete = mysqli_query($db,$requete); $reponse = mysqli_fetch_array($exec_requete); $count = $reponse['count(*)']; if($count == 0){ echo "Aucun banc d'essai n'a été réservé"; }else{ echo "
"; echo "Vos reservations ($identifiant) :
"; echo "
"; $requete = "SELECT * FROM reservation WHERE personne = '".$identifiant."'"; $exec_requete = mysqli_query($db,$requete); $reponse = mysqli_fetch_all($exec_requete); foreach($reponse as $creneau){ echo "
"; echo "Banc : $creneau[0] | Date : $creneau[1] $creneau[3]-$creneau[4]"; echo "
"; echo ""; echo "
"; /* Utilisation pour accès aux reservations */ echo "
"; echo ""; date_default_timezone_set('Europe/Paris'); $ActualDate = date("d/m/Y",time()); if($ActualDate==$creneau[1]){ $ActualHour = date("h:i",time()); $Periode = date("a",time()); if($Periode=="pm"){ $newHour = explode(":",$ActualHour); $Heure = $newHour[0]+12; $ActualHour = "".$Heure.":".$newHour[1]; } if(!($creneau[3]<=$ActualHour && $ActualHour<$creneau[4])){ echo ""; echo "
"; echo "
"; } } mysqli_close($db); ?>