From: Jérôme Benoit Date: Fri, 19 Jan 2018 21:57:10 +0000 (+0100) Subject: Add the reservation modification feature. X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=c49f721926f5d76a8eef80bd5174d68b5a151442;p=Project_webapp.git Add the reservation modification feature. Signed-off-by: Jérôme Benoit --- diff --git a/includes/booking.php b/includes/booking.php deleted file mode 100644 index e69de29..0000000 diff --git a/includes/config-example.php b/includes/config-example.php index a7edf02..ed4bf15 100644 --- a/includes/config-example.php +++ b/includes/config-example.php @@ -14,7 +14,8 @@ 'reservations', 'booking', 'search', - 'account' + 'account', + 'modify' ) ); diff --git a/includes/formmodify.php b/includes/formmodify.php new file mode 100644 index 0000000..20e53f6 --- /dev/null +++ b/includes/formmodify.php @@ -0,0 +1,17 @@ +prepare_query($sql_pquery); +$connection->prepared_query_bind_param("isis", array($form_nb_place, $form_class_name, $client_id, $form_flight_id)); +$connection->run_prepared_query(); +$connection->close_prepared_query(); +echo "Modifications enregistrées.
"; +redirect("index.php?page=reservations", 3); +?> diff --git a/includes/formreservations.php b/includes/formreservations.php index 4bca04c..0698900 100644 --- a/includes/formreservations.php +++ b/includes/formreservations.php @@ -1,12 +1,9 @@ Modification de la réservation sur le vol $flight_id\n"; +global $connection; +$sql_pquery = "select NumCl, NumVol, Classe, NbPlaces + from RESERVATIONS + where NumCl = ? and NumVol = ? and Classe = ?"; +$connection->prepare_query($sql_pquery); +$connection->prepared_query_bind_param("iss", array($client_id, $flight_id, $class_name)); +$connection->run_prepared_query(); +$connection->get_pquery_result(); +$rows = $connection->get_result_array(); +$connection->close_prepared_query(); +?> +
+ + + + + + + +
diff --git a/includes/reservations.php b/includes/reservations.php index 4314867..0416bd5 100644 --- a/includes/reservations.php +++ b/includes/reservations.php @@ -58,7 +58,7 @@ if (empty($rows)) { - + \n"; diff --git a/js/airpolytech.js b/js/airpolytech.js index 0f5a17a..8e62887 100644 --- a/js/airpolytech.js +++ b/js/airpolytech.js @@ -1,6 +1,6 @@ function ConfirmCancelFlight() { var oFormObject = document.forms['reservations']; - if (confirm("Voulez-vous vraiment annuler votre réservation sur le vol " + oFormObject.elements['flight_id'].value + " ?")) { + if (confirm("Voulez-vous vraiment annuler votre réservation sur le vol " + oFormObject.elements['flight_id'].value + " ?")) { var input = document.createElement("input"); input.setAttribute("type", "hidden"); input.setAttribute("name", "cancel");