From abd4c7a33f8666a7d886c57c2db4105e48f8b726 Mon Sep 17 00:00:00 2001 From: Janis Steiner <89935073+jakani24@users.noreply.github.com> Date: Thu, 27 Jun 2024 13:57:01 +0000 Subject: [PATCH] Update reservations.php --- sys0-code/app/reservations.php | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/sys0-code/app/reservations.php b/sys0-code/app/reservations.php index 92e475d..2110757 100644 --- a/sys0-code/app/reservations.php +++ b/sys0-code/app/reservations.php @@ -53,9 +53,10 @@ if(isset($_POST["res"])){ $time_from=htmlspecialchars($_POST["time_from"]); $time_to=htmlspecialchars($_POST["time_to"]); $day=htmlspecialchars($_POST["date"]); - $sql="INSERT INTO reservations (time_from,time_to,day,set_by_userid) VALUES (?, ?, ?, ?);"; + $class=htmlspecialchars($_POST["class"]); + $sql="INSERT INTO reservations (time_from,time_to,day,set_by_userid,for_class) VALUES (?, ?, ?, ?, ?);"; $stmt = $link->prepare($sql); - $stmt->bind_param("sssi",$time_from, $time_to, $day,$userid); + $stmt->bind_param("sssii",$time_from, $time_to, $day,$userid,$class); $stmt->execute(); } if(isset($_GET["del"])){ @@ -82,20 +83,32 @@ if(isset($_GET["del"])){ +

Reservationen (Alte Reservationen werden automatisch gelöscht)

prepare($sql); $stmt->execute(); $result = $stmt->get_result(); echo(""); - echo(""); + echo(""); while($row = $result->fetch_assoc()) { - echo(""); + echo(""); } echo("
Zeit vonZeit bisDatumReservation löschen
Zeit vonZeit bisDatumKlasseReservation löschen
".$row["time_from"]."".$row["time_to"]."".$row["day"]."Löschen
".$row["time_from"]."".$row["time_to"]."".$row["day"]."".$row["name"]."Löschen
");