Commit | Line | Data |
---|---|---|
a96fefe1 JB |
1 | <h1> Rechercher un vol </h1> |
2 | ||
33eb6f2a JB |
3 | <?php if (isset($_SESSION['return_flight'])) ?> |
4 | ||
a96fefe1 JB |
5 | <form action="index.php" id="search" method="post"> |
6 | <input type="hidden" name="form" value="search" /> | |
a2f7a729 | 7 | <input type="hidden" name="date_now" value="<?php echo date('Y-m-d\TH:i', time() - 600); ?>" /> |
a96fefe1 | 8 | <label> Départ : Ville -> </label> |
a2f7a729 JB |
9 | <select size="1" name="departure_city" required> |
10 | <optgroup label="Sélectionner une ville"> | |
11 | <?php | |
12 | $sql_pquery = "select distinct VilleD from VOLS"; | |
13 | global $connection; | |
14 | $connection->prepare_query($sql_pquery); | |
15 | $connection->run_prepared_query(); | |
16 | $connection->get_pquery_result(); | |
17 | $cities = $connection->get_result_array(); | |
18 | $connection->close_prepared_query(); | |
19 | foreach ($cities as $city) { | |
20 | echo "<option value=\"$city[0]\">$city[0]</option>\n"; | |
21 | } | |
22 | ?> | |
23 | </optgroup> | |
24 | </select> | |
a96fefe1 | 25 | <label> Date -> </label> |
db6cae90 | 26 | <input type="datetime-local" name="departure_date" value="<?php echo date('Y-m-d\TH:i'); ?>" required/> |
a96fefe1 | 27 | <label> Arrivée : Ville -> </label> |
a2f7a729 JB |
28 | <select size="1" name="arrival_city" required> |
29 | <optgroup label="Sélectionner une ville"> | |
30 | <?php | |
31 | $sql_pquery = "select distinct VilleA from VOLS"; | |
32 | global $connection; | |
33 | $connection->prepare_query($sql_pquery); | |
34 | $connection->run_prepared_query(); | |
35 | $connection->get_pquery_result(); | |
36 | $cities = $connection->get_result_array(); | |
37 | $connection->close_prepared_query(); | |
38 | foreach ($cities as $city) { | |
39 | echo "<option value=\"$city[0]\">$city[0]</option>\n"; | |
40 | } | |
41 | ?> | |
42 | </optgroup> | |
43 | </select> | |
a96fefe1 | 44 | <label> Date -> </label> |
a2f7a729 | 45 | <input type="datetime-local" name="arrival_date" /> |
a96fefe1 JB |
46 | <input type="submit" value="Valider"> |
47 | </form> | |
01135b89 | 48 | <br> |