Add the reservation modification feature.
[Project_webapp.git] / includes / formmodify.php
CommitLineData
c49f7219
JB
1<?php
2$form_flight_id = filter_input(INPUT_POST, "flight_id", FILTER_SANITIZE_STRING);
3$form_nb_place = filter_input(INPUT_POST, "nb_place", FILTER_VALIDATE_INT);
4$form_class_name = filter_input(INPUT_POST, "class_name", FILTER_SANITIZE_STRING);
5
6global $connection;
7$client_id = get_client_id($_SESSION['email']);
8$sql_pquery = "update RESERVATIONS
9 set NbPlaces = ?, Classe = ?
10 where NumCl = ? and NumVol = ?";
11$connection->prepare_query($sql_pquery);
12$connection->prepared_query_bind_param("isis", array($form_nb_place, $form_class_name, $client_id, $form_flight_id));
13$connection->run_prepared_query();
14$connection->close_prepared_query();
15echo "Modifications enregistre&#769;es. <br>";
16redirect("index.php?page=reservations", 3);
17?>