connect_error) { die("Kapcsolódási hiba: " . $conn->connect_error); } $dayNames = [ 1 => $translations["Mon"], 2 => $translations["Tue"], 3 => $translations["Wed"], 4 => $translations["Thu"], 5 => $translations["Fri"], 6 => $translations["Sat"], 7 => $translations["Sun"] ]; $days = []; $result = $conn->query("SELECT * FROM opening_hours ORDER BY day ASC"); while ($row = $result->fetch_assoc()) { $days[] = $row; } $today = new DateTime('today'); $maxDate = (new DateTime('today'))->modify('+14 days'); $todayStr = $today->format('Y-m-d'); $maxDateStr = $maxDate->format('Y-m-d'); $exceptions = []; $stmt = $conn->prepare(" SELECT * FROM opening_hours_exceptions WHERE date BETWEEN ? AND ? ORDER BY date ASC "); $stmt->bind_param("ss", $todayStr, $maxDateStr); $stmt->execute(); $res = $stmt->get_result(); while ($row = $res->fetch_assoc()) { $exceptions[] = $row; } $stmt->close(); $months = [ 1 => $translations["Jan"], 2 => $translations["Feb"], 3 => $translations["Mar"], 4 => $translations["Apr"], 5 => $translations["May"], 6 => $translations["Jun"], 7 => $translations["Jul"], 8 => $translations["Aug"], 9 => $translations["Sep"], 10 => $translations["Oct"], 11 => $translations["Nov"], 12 => $translations["Dec"], ]; $sql = "SELECT COUNT(*) AS total FROM temp_loggeduser"; $result = $conn->query($sql); if ($result->num_rows > 0) { $row = $result->fetch_assoc(); $workoutpeoplenow = $row['total']; } else { $workoutpeoplenow = 0; } if ($capacity > 0) { $capacityPercent = ($workoutpeoplenow / $capacity) * 100; } else { $capacityPercent = 0; } $progresscolor = ''; if ($capacityPercent >= 0 && $capacityPercent < 70) { $progresscolor = 'success'; } elseif ($capacityPercent >= 70 && $capacityPercent < 90) { $progresscolor = 'warning'; } elseif ($capacityPercent >= 90) { $progresscolor = 'danger'; } ?>