X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=includes%2Fformsearch.php;h=66c57c94b8412c8c0bbe6d654acaff78b6a5ad8b;hb=22f1dc6402dbc9a9c5d2ed2f17ef54044d35ec2a;hp=7796f0691ae75452042e1ee02ae7906e228a46bf;hpb=a2f7a7290d0b54650c249a0bf59e66d8d7691135;p=Project_webapp.git diff --git a/includes/formsearch.php b/includes/formsearch.php index 7796f06..66c57c9 100644 --- a/includes/formsearch.php +++ b/includes/formsearch.php @@ -4,6 +4,7 @@ $form_departure_date = filter_input(INPUT_POST, "departure_date", FILTER_SANITIZ $form_arrival_city = filter_input(INPUT_POST, "arrival_city", FILTER_SANITIZE_STRING); $form_arrival_date = filter_input(INPUT_POST, "arrival_date", FILTER_SANITIZE_STRING); $form_date_now = filter_input(INPUT_POST, "date_now", FILTER_SANITIZE_STRING); +$action = filter_input(INPUT_POST, "action", FILTER_SANITIZE_STRING); $oDepartureDate = new DateTime($form_departure_date); $oArrivalDate = new DateTime($form_arrival_date); @@ -25,7 +26,7 @@ if ($oDepartureDate < $oDateNow) { $input_failure = true; } -if ($oArrivalDate <= $oDepartureDate) { +if (!($action === "return_flight") && $oArrivalDate <= $oDepartureDate) { echo "Arrival date is before departure date.
"; $input_failure = true; } @@ -39,10 +40,11 @@ if (empty($form_arrival_date)) { ?> -

Rechercher un vol

+

Rechercher un vol


= ? and VilleD = ? and DateA <= ? and VilleA = ? order by DateD, NumVol, Prix"; @@ -107,6 +109,7 @@ if (!$input_failure) { $connection->get_pquery_result(); $rows = $connection->get_result_array(); $connection->close_prepared_query(); + //FIXME: Use NumAv to see if a flight is fully booked. //var_dump($rows); if (empty($rows)) { echo "Aucun vol ne correspond aux critères de recherche.
"; @@ -139,14 +142,16 @@ if (!$input_failure) { - - - - - \n"; + \n"; + if (!($action === "return_flight")) { + echo " \n"; + } + echo " \n"; + echo " + \n"; echo " \n"; } - echo ""; + echo "\n"; } }