Add password change feature.
[Project_webapp.git] / includes / formreservations.php
1 <?php
2 $form_flight_id = filter_input(INPUT_POST, "flight_id", FILTER_SANITIZE_STRING);
3 $form_class_name = filter_input(INPUT_POST, "class_name", FILTER_SANITIZE_STRING);
4 $form_modify = filter_input(INPUT_POST, "modify", FILTER_SANITIZE_STRING);
5 $form_cancel = filter_input(INPUT_POST, "cancel", FILTER_SANITIZE_STRING);
6
7 if (isset($form_modify) && isset($form_flight_id) && isset($form_class_name)) {
8 echo $form_modify;
9 } elseif (isset($form_cancel) && isset($form_flight_id) && isset($form_class_name)) {
10 $client_id = get_client_id($_SESSION['email']);
11 global $connection;
12 $sql_pquery = "delete from RESERVATIONS
13 where NumCl = ? and NumVol = ? and Classe = ?";
14 $connection->prepare_query($sql_pquery);
15 $connection->prepared_query_bind_param("iss", array($client_id, $form_flight_id, $form_class_name));
16 $connection->run_prepared_query();
17 $connection->close_prepared_query();
18 echo "Votre re&#769;servation a e&#769;te&#769; annule&#769;e. <br>";
19 redirect("index.php?page=reservations", 3);
20 } else {
21 echo "Make an error message. <br>";
22 echo "<a href=\"javascript:history.go(-1)\">Retour</a>";
23 }
24
25 ?>