From 0a87f4538a04b4dba4888a6abdb166ba8f465ba4 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Benoit?= Date: Wed, 17 Jan 2018 16:41:44 +0100 Subject: [PATCH] Fixlets to today coding session. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Jérôme Benoit --- includes/booking.php | 0 includes/formbooking.php | 2 ++ includes/formsearch.php | 2 +- includes/reservations.php | 26 ++++++++++++++++---------- includes/search.php | 2 +- 5 files changed, 20 insertions(+), 12 deletions(-) create mode 100644 includes/booking.php diff --git a/includes/booking.php b/includes/booking.php new file mode 100644 index 0000000..e69de29 diff --git a/includes/formbooking.php b/includes/formbooking.php index 3d55c50..2d47f81 100644 --- a/includes/formbooking.php +++ b/includes/formbooking.php @@ -35,6 +35,8 @@ if (!$input_failure && $is_logged_in && !empty($form_nb_place) && !empty($form_c if (!empty($nb_booked)) { echo "Vous avez déjà réservé ce vol, vous allez être redirigé vers la liste de vos réservations dans 2 secondes.
"; redirect("index.php?page=reservations", 2); + include('footer.html'); + exit(); } $sql_pquery = "insert into RESERVATIONS (NumCl, NumVol, Classe, NbPlaces) values (?, ?, ?, ?)"; diff --git a/includes/formsearch.php b/includes/formsearch.php index 7796f06..e40ab12 100644 --- a/includes/formsearch.php +++ b/includes/formsearch.php @@ -90,7 +90,7 @@ if (empty($form_arrival_date)) { /> - +
diff --git a/includes/reservations.php b/includes/reservations.php index f560b9a..15beeac 100644 --- a/includes/reservations.php +++ b/includes/reservations.php @@ -10,8 +10,9 @@ if (!$is_logged_in) {

Mes réservations

Actions\n"; echo " \n"; foreach ($rows as $row) { + $oDepartureDate = new DateTime($row['DateD']); echo " \n"; echo " " . $row['NumVol'] . "\n"; echo " " . $row['VilleD'] . "\n"; @@ -50,15 +52,19 @@ if (empty($rows)) { echo " " . $row['Classe'] . "\n"; echo " " . $row['NbPlaces'] . "\n"; echo " " . $row['Prix'] . "€\n"; - echo " -
- - - - - -
- \n"; + if ($oDepartureDate > $oDateNow) { + echo " +
+ + + + + +
+ \n"; + } else { + echo "Vol en cours"; + } echo " \n"; } echo ""; diff --git a/includes/search.php b/includes/search.php index 3365090..c7e761f 100644 --- a/includes/search.php +++ b/includes/search.php @@ -43,6 +43,6 @@ - +
-- 2.34.1