menu.php 1.49 KB
<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8"/>
		<title>Page principale</title>
		<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.1/dist/css/bootstrap.min.css"
		      rel="stylesheet"
		      integrity="sha384-+0n0xVW2eSR5OomGNYDnhzAbDsOXxcvSN1TPprVMTNDbiYZCxYbOOl7+AMvyTG2x"
		      crossorigin="anonymous">
		<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.0.1/dist/js/bootstrap.bundle.min.js"
			integrity="sha384-gtEjrD/SeCtmISkJkNUaaKMoLD0//E1J19smozuHV6z3Iehds+3Ulb9Bn9Plx0x4"
			crossorigin="anonymous">
		</script>
	</head>
	<body>
		<div>
			<?php	
				session_start();
				if(isset($_GET['deconnexion'])){
					if($_GET['deconnexion']==true){
						session_unset();
						echo "<meta http-equiv=\"refresh\" content=\"0;url=index.html\">";
						//header('Location : index.html');
					}
				}elseif(isset($_SESSION['identifiant'])){
					$identifiant = $_SESSION['identifiant'];
					echo "Bonjour $identifiant, vous êtes connecté<br>";
				}else{
					echo "<meta http-equiv=\"refresh\" content=\"0;url=index.html\">";
				}
			?>
			<form method="POST" action="menu.php?deconnexion=true"> 
				<button class="btn-lg btn-danger" type="submit">Deconnexion</button>
			</form>
			<form method="POST" action="reservation.php"> 
				<button class="btn-lg btn-primary" type="submit">Reserver un banc</button>
			</form>
			<form method="POST" action="mesReservations.php"> 
				<button class="btn-lg btn-success" type="submit">Mes Reservations</button>
			</form>
		</div>
	</body>
</html>