Make the reservation(s) code more readable.
[Project_webapp.git] / includes / formsearch.php
index cd12ee4a5b988b8aff76f592022ed64c1f77cd3e..5cdca0cc4322af26d8bfe9402bc0d26a009aa11f 100644 (file)
@@ -132,7 +132,7 @@ if (!$input_failure) {
          echo "    <th>Re&#769;server</th>\n";
          echo "  </tr>\n";
          foreach ($fligths as $fligth) {
-             $sql_pquery = "select sum(NbPlaces) from RESERVATIONS where NumVol = ?";
+             $sql_pquery = "select sum(NbPlaces) as BookedPlaces from RESERVATIONS where NumVol = ?";
              $connection->prepare_query($sql_pquery);
              $connection->prepared_query_bind_param("s", array($fligth['NumVol']));
              $connection->run_prepared_query();
@@ -157,7 +157,7 @@ if (!$input_failure) {
              echo "    <td>" . $fligth['Classe'] . "</td>\n";
              echo "    <td>" . $fligth['Prix'] . "&euro;</td>\n";
              echo "    <td>
-                        Places libres : " . $free_places . "
+                        Nombre de places libres : " . $free_places . "
                         <form action=\"index.php\" id=\"booking\" method=\"post\">
                           <input type=\"hidden\" name=\"form\" value=\"booking\" />
                           <input type=\"hidden\" name=\"flight_id\" value=\"" . $fligth['NumVol'] . "\" />