Add return flight booking cinematic and personal informations editing.
[Project_webapp.git] / lib / utils.php
index 9955458cffd1c7b8420082dec60dd75c1ceb7496..5ab99b599fa7301b864bec195c1c717917f3efa7 100644 (file)
@@ -95,12 +95,12 @@ function get_client_id($email)
  * @param  [type] $flight_id [description]
  * @return [type]            [description]
  */
-function nb_booked($client_id, $flight_id)
+function nb_booked($client_id, $flight_id, $class_name)
 {
     global $connection;
-    $sql_pquery = "select SUM(NbPlaces) from RESERVATIONS where NumCl = ? and NumVol = ?";
+    $sql_pquery = "select SUM(NbPlaces) from RESERVATIONS where NumCl = ? and NumVol = ? and Classe = ?";
     $connection->prepare_query($sql_pquery);
-    $connection->prepared_query_bind_param("is", array($client_id, $flight_id));
+    $connection->prepared_query_bind_param("iss", array($client_id, $flight_id, $class_name));
     $connection->run_prepared_query();
     $connection->get_pquery_result();
     $row = $connection->get_result_array();