X-Git-Url: https://git.piment-noir.org/?p=Project_webapp.git;a=blobdiff_plain;f=includes%2Fformsearch.php;h=cd12ee4a5b988b8aff76f592022ed64c1f77cd3e;hp=3c6e0ea3f1ce224ff39421be44b1025a88c4ddad;hb=68cee0ac3fe728566e16dc0460416c77022f4b22;hpb=a0e7c679474abba8e61aa6241f7a5293ab631cc1
diff --git a/includes/formsearch.php b/includes/formsearch.php
index 3c6e0ea..cd12ee4 100644
--- a/includes/formsearch.php
+++ b/includes/formsearch.php
@@ -99,20 +99,19 @@ if (empty($form_arrival_date)) {
= ? and VilleD = ? and DateA <= ? and VilleA = ?
+ $sql_pquery = "select VOLS.NumVol as NumVol, VilleD, DateD, VilleA, DateA, DEFCLASSES.Classe, round(CoutVol*CoeffPrix, 2) as Prix, CapAv
+ from VOLS join DEFCLASSES on DEFCLASSES.NumVol = VOLS.NumVol
+ join AVIONS on AVIONS.NumAv = VOLS.NumAv
+ where DateD >= ? and VilleD = ? and DateA <= ? and VilleA = ?
order by DateD, NumVol, Prix";
$connection->prepare_query($sql_pquery);
$connection->prepared_query_bind_param("ssss", array($form_departure_date, $form_departure_city, $form_arrival_date, $form_arrival_city));
$connection->run_prepared_query();
$connection->get_pquery_result();
- $rows = $connection->get_result_array();
+ $fligths = $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)) {
+ //var_dump($fligths);
+ if (empty($fligths)) {
echo "Aucun vol ne correspond aux critères de recherche.
";
} else {
if ($action === "return_flight" && isset($_SESSION['return_flight_nb_place'])) {
@@ -132,28 +131,47 @@ if (!$input_failure) {
echo "