Polish the reservation modification code.
[Project_webapp.git] / includes / modify.php
index aeb9741444e0b39a1df6028e9bab8c5f5b6f83ee..7915c48e53fe40688bb07bc288bb40c41839071e 100644 (file)
@@ -1,8 +1,16 @@
 <?php
+global $is_logged_in;
+if (!$is_logged_in) {
+    echo "Please login first. <br>";
+    $_SESSION['login_referer'] = $_SERVER['HTTP_REFERER'];
+    redirect("index.php?page=login", 2);
+    include('footer.html');
+    exit();
+}
 $flight_id = filter_input(INPUT_GET, "flight_id", FILTER_SANITIZE_STRING);
 $class_name = filter_input(INPUT_GET, "class_name", FILTER_SANITIZE_STRING);
 $client_id = get_client_id($_SESSION['email']);
-echo "<h1> Modification de la re&#769;servation sur le vol $flight_id</h2>\n";
+echo "<h1> Modification de la re&#769;servation sur le vol $flight_id </h2>\n";
 global $connection;
 $sql_pquery = "select NumCl, NumVol, Classe, NbPlaces
                from RESERVATIONS