Nessuna classe programmata per questo mese.
/ 0) : ?> in attesa 0) : ?> in coda
Nessuna prenotazione per questa classe.
getConnection(); function e($value): string { return htmlspecialchars((string) $value, ENT_QUOTES, 'UTF-8'); } function initials(string $first, string $last): string { $a = mb_substr(trim($first), 0, 1); $b = mb_substr(trim($last), 0, 1); $ini = strtoupper($a . $b); return $ini !== '' ? $ini : '?'; } function avatarColor(string $seed): string { $palette = ['#1ebf73', '#2980b9', '#8e44ad', '#e67e22', '#16a085', '#c0392b', '#2c3e50', '#d35400']; $idx = abs(crc32($seed)) % count($palette); return $palette[$idx]; } $optRow = $pdo->query("SELECT maxbeforetimecancell, show_teacher FROM `option` LIMIT 1")->fetch(); $timetocancel = $optRow ? (int) $optRow['maxbeforetimecancell'] : 24; $showTeacher = ($optRow['show_teacher'] ?? 'N') === 'Y'; $teachersById = []; if ($showTeacher) { foreach ($pdo->query("SELECT idemployee, nameemployee, surnameemployee, photo FROM employee")->fetchAll() as $t) { $teachersById[(int) $t['idemployee']] = $t; } } if (isset($_GET['prev_month'])) { $currentMonthStart = preg_replace('/[^0-9\-]/', '', $_GET['prev_month']) . '-01'; } elseif (isset($_GET['next_month'])) { $currentMonthStart = preg_replace('/[^0-9\-]/', '', $_GET['next_month']) . '-01'; } else { $currentMonthStart = date("Y-m-01"); } if (strtotime($currentMonthStart) === false) { $currentMonthStart = date("Y-m-01"); } $currentMonthEnd = date("Y-m-t", strtotime($currentMonthStart)); $sqlSchedule = "SELECT serviceschedule.*, service.servicename, service.colorclass, service.maxcapacity, service.idservice, service.idteacher FROM serviceschedule LEFT JOIN service ON serviceschedule.idservice = service.idservice WHERE serviceschedule.dateschedule BETWEEN :start AND DATE_ADD(:end, INTERVAL 1 DAY) ORDER BY serviceschedule.dateschedule"; $stmtSchedule = $pdo->prepare($sqlSchedule); $stmtSchedule->execute([':start' => $currentMonthStart, ':end' => $currentMonthEnd]); $scheduleRows = $stmtSchedule->fetchAll(); // Tipologie di classe presenti nel mese (per la barra filtri), con relativo colore $classTypes = []; foreach ($scheduleRows as $r) { $name = $r['servicename'] ?? ''; if ($name !== '' && !isset($classTypes[$name])) { $classTypes[$name] = $r['colorclass'] ?: '#1ebf73'; } } ksort($classTypes); $bookingsBySchedule = []; $scheduleIds = array_filter(array_map(fn($r) => (int) $r['idserviceschedule'], $scheduleRows)); if (!empty($scheduleIds)) { $ph = implode(',', array_fill(0, count($scheduleIds), '?')); $sqlBookings = "SELECT bookingclass.idbookingclass, bookingclass.idserviceschedule, bookingclass.lostlesson, bookingclass.status, auth_users.first_name, auth_users.last_name, auth_users.id AS iduser FROM bookingclass LEFT JOIN auth_users ON bookingclass.iduser = auth_users.id WHERE bookingclass.idserviceschedule IN ($ph) AND bookingclass.status IN ('booked', 'pending', 'waiting') ORDER BY bookingclass.created_at, auth_users.last_name, auth_users.first_name"; $stmtBookings = $pdo->prepare($sqlBookings); $stmtBookings->execute(array_values($scheduleIds)); foreach ($stmtBookings->fetchAll() as $b) { $bookingsBySchedule[(int) $b['idserviceschedule']][] = $b; } } $italianMonths = [ "January" => "Gennaio", "February" => "Febbraio", "March" => "Marzo", "April" => "Aprile", "May" => "Maggio", "June" => "Giugno", "July" => "Luglio", "August" => "Agosto", "September" => "Settembre", "October" => "Ottobre", "November" => "Novembre", "December" => "Dicembre" ]; ?>
Nessuna classe programmata per questo mese.