getConnection(); $school_id = session('school_id'); if (!$school_id) die("Nessuna scuola selezionata"); $stmt = $pdo->prepare("SELECT first_name FROM auth_users WHERE id = ?"); $stmt->execute([$iduserlogin]); $user = $stmt->fetch(); $stmt = $pdo->prepare("SELECT name, address_street, address_city, address_province FROM schools WHERE id = ?"); $stmt->execute([$school_id]); $school = $stmt->fetch(); $currentMonth = $_GET['month'] ?? date('Y-m'); $monthDate = DateTime::createFromFormat('Y-m', $currentMonth) ?: new DateTime(); $prevMonth = (clone $monthDate)->modify('-1 month')->format('Y-m'); $nextMonth = (clone $monthDate)->modify('+1 month')->format('Y-m'); setlocale(LC_TIME, 'it_IT.UTF-8', 'Italian'); $monthName = ucfirst(utf8_encode(strftime('%B %Y', $monthDate->getTimestamp()))); $startOfMonth = $monthDate->format('Y-m-01'); $endOfMonth = (clone $monthDate)->modify('first day of next month')->format('Y-m-d'); $stmt = $pdo->prepare(" SELECT sb.id as booking_id, sb.status, cs.session_date, cs.start_time, cs.end_time, cs.room_name, c.name as class_name, ct.level, o.available_entries, o.available_recoveries FROM session_bookings sb JOIN class_sessions cs ON sb.session_id = cs.id JOIN class_types ct ON cs.class_type_id = ct.id JOIN classes c ON ct.class_id = c.id JOIN orders o ON sb.order_id = o.id WHERE sb.user_id = ? AND cs.school_id = ? AND cs.session_date >= ? AND cs.session_date < ? ORDER BY cs.session_date ASC, cs.start_time ASC "); $stmt->execute([$iduserlogin, $school_id, $startOfMonth, $endOfMonth]); $bookings = $stmt->fetchAll(); ?> Le mie lezioni

Nessuna lezione prenotata

Le tue lezioni appariranno qui

Vedi i corsi

-

-
-
0 || $b['available_recoveries'] > 0): ?>
0): ?> Ingressi disponibili: 0): ?> 0 ? ' • ' : '' ?> Recuperi:
time() + 86400): ?>
Non modificabile (entro 24 ore)