diff --git a/sys0-code/app/print.php b/sys0-code/app/print.php index a2320f0..b845c18 100644 --- a/sys0-code/app/print.php +++ b/sys0-code/app/print.php @@ -72,6 +72,7 @@ function is_time_between($startTime, $endTime, $checkTime) { @@ -318,21 +319,27 @@ function is_time_between($startTime, $endTime, $checkTime) { date_default_timezone_set('Europe/Zurich'); $reservation_conflict=false; $today=date("Y-m-d"); - $sql="select time_from, time_to from reservations where day='$today';"; + $sql="select time_from, time_to, for_class from reservations where day='$today';"; $stmt = $link->prepare($sql); $stmt->execute(); $result = $stmt->get_result(); //$row = $result->fetch_assoc(); $time_now=date("H:i"); + while ($row = $result->fetch_assoc()) { if (is_time_between($row["time_from"], $row["time_to"], $time_now)) { $reservation_conflict = true; + $for_class[]=$row["for_class"]; break; } } - - if ($reservation_conflict) { - echo "