-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathreservation.php
65 lines (58 loc) · 1.81 KB
/
reservation.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
<?php
session_start();
ob_start();
$connexion= mysqli_connect("localhost", "root", "", "reservationsalles");
if ( isset($_GET["idresa"]) ) {
$idresa = $_GET["idresa"];
$requete = "SELECT titre,description,debut,fin FROM reservations WHERE id=$idresa";
$query = mysqli_query($connexion, $requete);
$resultat = mysqli_fetch_all($query, MYSQLI_ASSOC);
$taille = count($resultat) - 1;
}
?>
<html>
<head>
<meta charset="utf-8">
<link rel="stylesheet" type="text/css" href="reservation.css">
<title>Réservation</title>
</head>
<body class="bodyt">
<header>
<nav id="menu">
<div class="nav1">
<img class="img1" src="img/image1.png">
<a href="index.php"><img class="img2" src="https://i-love-png.com/images/paintball-png-photos.png"></a>
</div>
<div class="nav2">
<a href="index.php"><h2>Accueil</h2></a>
<a href="profil.php"><h2>Modification</h2></a>
<a href="planning.php"><h2>Planning</h2></a>
<a href="reservation-form.php"><h2>Réservation</h2></a>
<a href="index.php?deconnexion=true"><h2>Déconnexion</h2></a>
</div>
</nav>
</header>
<section>
<?php
$i = 0;
echo "<table border>";
echo "<thead><tr>";
foreach ($resultat[$taille] as $key => $value)
{
echo "<th>{$key}</th>";
}
echo "</tr></thead>";
echo "<tbody>";
while ($i <= $taille)
{
echo "<tr>";
foreach ($resultat[$i] as $key => $value)
{
echo "<td>{$value}</td>";
}
echo "</tr>";
$i++;
}
echo "</tbody></table>";
?>
</section>