You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
39 lines
1.4 KiB
39 lines
1.4 KiB
<!DOCTYPE html>
|
|
<html lang="fr">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<title>Les vols</title>
|
|
<style>
|
|
body { font-family:sans-serif; font-size:10px; }
|
|
h1 { font-size:1.8rem; }
|
|
h2 { font-size:1.6rem; }
|
|
dl { margin:8px; }
|
|
dt { font-style:italic; font-size:1.1rem; }
|
|
dd { font-weight:bold; font-size:1.4rem; padding-bottom:12px; }
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<h1>Les Vols</h1>
|
|
<?php
|
|
$mysqli = new mysqli("localhost", "root", "", "b1eval");
|
|
|
|
if ($mysqli->connect_errno) {
|
|
echo "Échec lors de la connexion à MySQL : (" . $mysqli->connect_errno . ") " . $mysqli->connect_error;
|
|
}
|
|
$resultat = $mysqli->query('SELECT * FROM `vol`');
|
|
|
|
$ligne_de_resultat = $resultat->fetch_array(MYSQLI_ASSOC);
|
|
|
|
echo "<h2>Vol n°" . $ligne_de_resultat['id_vol'] . "</h2>";
|
|
echo "<dl>";
|
|
echo "<dt>de</dt><dd>" . $ligne_de_resultat['de'] . "</dd>";
|
|
echo "<dt>à</dt><dd>" . $ligne_de_resultat['a'] . "</dd>";
|
|
echo "<dt>via</dt><dd>" . $ligne_de_resultat['via'] . "</dd>";
|
|
echo "<dt>Places restantes</dt><dd>" . ($ligne_de_resultat['places'] - $ligne_de_resultat['reservations']) . "</dd>";
|
|
echo "</dl>";
|
|
?>
|
|
<footer>
|
|
<a href="resa.php">réserver</a>
|
|
</footer>
|
|
</body>
|
|
</html>
|