2019-05-23 00:25:28 +02:00
|
|
|
<?php
|
2019-05-23 12:05:13 +02:00
|
|
|
|
|
|
|
function getError($code)
|
|
|
|
{
|
|
|
|
switch ($code) {
|
|
|
|
case 1:
|
|
|
|
return "Impossible de réserver ce trajet";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-05-23 00:25:28 +02:00
|
|
|
session_start();
|
|
|
|
require_once('../ressources/verifconnecte.php');
|
2019-05-23 17:06:08 +02:00
|
|
|
require_once('../ressources/trajet.php');
|
2019-05-23 00:25:28 +02:00
|
|
|
?>
|
|
|
|
|
|
|
|
<!DOCTYPE html>
|
|
|
|
|
|
|
|
<html>
|
|
|
|
<head>
|
|
|
|
<meta charset="utf-8"/>
|
|
|
|
<link rel="stylesheet" href="recherche.css"/>
|
|
|
|
<link rel="stylesheet" href="../ressources/navbarhtml.css"/>
|
|
|
|
<title>Rechercher trajet</title>
|
|
|
|
</head>
|
|
|
|
<body>
|
|
|
|
<?php
|
|
|
|
require_once("../ressources/navbarhtml.php");
|
|
|
|
?>
|
|
|
|
<div id="container">
|
2019-05-23 17:06:08 +02:00
|
|
|
<div id="formulaire">
|
|
|
|
<h1>Rechercher trajet</h1>
|
2019-05-23 00:25:28 +02:00
|
|
|
<form method="post" action="../liste_trajets/liste_trajet.php">
|
2019-05-23 17:06:08 +02:00
|
|
|
<div class="line">
|
|
|
|
<label class="label" for="villeDepart">Ville de départ : </label>
|
|
|
|
<input type="text" class="form, villeText" name="villeDepartText" id="villeDepartText">
|
|
|
|
<select class="form, villeSelect" name="villeDepart" id="villeDepart" required>
|
|
|
|
<option selected></option>
|
|
|
|
<?php afficherVilles($db); ?>
|
|
|
|
</select>
|
|
|
|
</div>
|
|
|
|
<div id="villeEtapeDiv" class="line">
|
|
|
|
<label class="label" for="villeArrive">Etape : </label>
|
|
|
|
<input type="text" class="form, villeText" id="villeArriveText" name="villeArriveText">
|
|
|
|
<select class="form, villeSelect" name="villeArrive" id="villeArrive" required>
|
|
|
|
<option selected></option>
|
|
|
|
<?php afficherVilles($db); ?>
|
|
|
|
</select>
|
|
|
|
</div>
|
|
|
|
<div class="line">
|
|
|
|
<label class="label" for="date">Date départ : </label>
|
|
|
|
<input id="date" class="form" name="date_heure" type="date" placeholder="Date et heure de départ" class="centrage"
|
2019-05-23 00:25:28 +02:00
|
|
|
required>
|
2019-05-23 17:06:08 +02:00
|
|
|
</div>
|
2019-05-23 00:25:28 +02:00
|
|
|
<br/>
|
|
|
|
<label>
|
2019-05-23 17:06:08 +02:00
|
|
|
<input id="submit" class="button" name="submit" type="submit" value="Rechercher" required>
|
2019-05-23 00:25:28 +02:00
|
|
|
</label>
|
|
|
|
</form>
|
2019-05-23 17:06:08 +02:00
|
|
|
<?php
|
|
|
|
if (isset($_GET['error'])) {
|
|
|
|
echo "<p class='error'>" . getError($_GET['error']) . "</p>";
|
|
|
|
}
|
|
|
|
?>
|
2019-05-23 00:25:28 +02:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</body>
|
2019-05-23 17:06:08 +02:00
|
|
|
<script type="application/javascript" src="../ressources/libs/jquery-3.4.1.js"></script>
|
|
|
|
<script type="application/javascript" src="../ressources/libs/jquery-ui.min.js"></script>
|
|
|
|
<script src="recherche.js"></script>
|
2019-05-23 00:25:28 +02:00
|
|
|
</html>
|