Spaces:
Build error
Build error
Download Dockerfile from Freespace12/README: direct link, hf CLI and curl.
- Browser
- Download file 76.7 kB
-
https://huggingface.co/spaces/Freespace12/README/resolve/main/Dockerfile
- Command line
-
hf download hf://spaces/Freespace12/README/Dockerfile
-
curl -L -o Dockerfile https://huggingface.co/spaces/Freespace12/README/resolve/main/Dockerfile
76.7 kB
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Hamilton Christian School - Booking System</title>
<script src="https://cdn.tailwindcss.com"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
<style>
/* Custom styles that can't be done with Tailwind */
.calendar-day {
transition: all 0.2s ease;
}
.calendar-day:hover:not(.disabled):not(.booked) {
transform: scale(1.05);
box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.5);
}
.time-slot {
transition: all 0.2s ease;
}
.time-slot:hover:not(.booked) {
transform: scale(1.02);
background-color: #eff6ff;
}
.tooltip {
position: relative;
}
.tooltip .tooltip-text {
visibility: hidden;
width: 120px;
background-color: #555;
color: #fff;
text-align: center;
border-radius: 6px;
padding: 5px;
position: absolute;
z-index: 1;
bottom: 125%;
left: 50%;
margin-left: -60px;
opacity: 0;
transition: opacity 0.3s;
}
.tooltip:hover .tooltip-text {
visibility: visible;
opacity: 1;
}
</style>
</head>
<body class="bg-gray-50 min-h-screen">
<!-- Login Page -->
<div id="login-page" class="flex flex-col items-center justify-center min-h-screen p-4">
<div class="w-full max-w-md bg-white rounded-lg shadow-md p-8">
<div class="text-center mb-8">
<img src="https://via.placeholder.com/150" alt="School Logo" class="mx-auto h-24 w-auto">
<h1 class="mt-4 text-3xl font-bold text-gray-900">Hamilton Christian School</h1>
<p class="mt-2 text-gray-600">Facility Booking System</p>
</div>
<form id="login-form" class="space-y-6">
<div>
<label for="email" class="block text-sm font-medium text-gray-700">School Email</label>
<div class="mt-1">
<input id="email" name="email" type="email" autocomplete="email" required
class="appearance-none block w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm placeholder-gray-400 focus:outline-none focus:ring-blue-500 focus:border-blue-500 sm:text-sm"
placeholder="you@hamiltonchristian.school.nz">
</div>
</div>
<div>
<button type="submit" class="w-full flex justify-center py-2 px-4 border border-transparent rounded-md shadow-sm text-sm font-medium text-white bg-blue-600 hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500">
Sign in
</button>
</div>
</form>
<!-- Error Modal -->
<div id="error-modal" class="hidden fixed inset-0 bg-gray-600 bg-opacity-50 flex items-center justify-center p-4 z-50">
<div class="bg-white rounded-lg shadow-xl max-w-sm w-full p-6">
<div class="flex items-center justify-between mb-4">
<h3 class="text-lg font-medium text-gray-900">Access Restricted</h3>
<button id="close-error-modal" class="text-gray-400 hover:text-gray-500">
<i class="fas fa-times"></i>
</button>
</div>
<div class="mb-4">
<p class="text-sm text-gray-600">Access is restricted to Hamilton Christian School accounts only.</p>
</div>
<div class="flex justify-end">
<button id="confirm-error-modal" type="button" class="px-4 py-2 bg-blue-600 text-white text-sm font-medium rounded-md hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500">
OK
</button>
</div>
</div>
</div>
</div>
</div>
<!-- Home Page (Booking Selection) -->
<div id="home-page" class="hidden min-h-screen">
<!-- Navigation Bar -->
<nav class="bg-blue-600 text-white shadow-lg sticky top-0 z-10">
<div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
<div class="flex justify-between h-16">
<div class="flex items-center">
<span class="text-xl font-semibold">HCS Booking System</span>
</div>
<div class="flex items-center space-x-4">
<button id="logout-btn" class="flex items-center text-white hover:text-blue-200">
<i class="fas fa-sign-out-alt mr-2"></i>
Logout
</button>
</div>
</div>
</div>
</nav>
<!-- Main Content -->
<main class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-8">
<h1 class="text-3xl font-bold text-gray-900 mb-8">Book a Facility</h1>
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6">
<!-- Classrooms Card -->
<div class="booking-card bg-white rounded-lg shadow-md overflow-hidden hover:shadow-lg transition-shadow duration-300">
<a href="#" id="classrooms-link" class="block">
<div class="h-48 bg-gray-200 flex items-center justify-center">
<i class="fas fa-chalkboard-teacher text-6xl text-blue-500"></i>
</div>
<div class="p-6">
<h3 class="text-xl font-semibold text-gray-900 mb-2">Classrooms</h3>
<p class="text-gray-600">Book classrooms in various blocks across the school</p>
</div>
</a>
</div>
<!-- Courts Card -->
<div class="booking-card bg-white rounded-lg shadow-md overflow-hidden hover:shadow-lg transition-shadow duration-300">
<a href="#" id="courts-link" class="block">
<div class="h-48 bg-gray-200 flex items-center justify-center">
<i class="fas fa-basketball-ball text-6xl text-green-500"></i>
</div>
<div class="p-6">
<h3 class="text-xl font-semibold text-gray-900 mb-2">Courts</h3>
<p class="text-gray-600">Book basketball, netball and other sports courts</p>
</div>
</a>
</div>
<!-- Fields Card -->
<div class="booking-card bg-white rounded-lg shadow-md overflow-hidden hover:shadow-lg transition-shadow duration-300">
<a href="#" id="fields-link" class="block">
<div class="h-48 bg-gray-200 flex items-center justify-center">
<i class="fas fa-futbol text-6xl text-yellow-500"></i>
</div>
<div class="p-6">
<h3 class="text-xl font-semibold text-gray-900 mb-2">Fields</h3>
<p class="text-gray-600">Book sports fields for games and practices</p>
</div>
</a>
</div>
<!-- MPR/Library Card -->
<div class="booking-card bg-white rounded-lg shadow-md overflow-hidden hover:shadow-lg transition-shadow duration-300">
<a href="#" id="mpr-link" class="block">
<div class="h-48 bg-gray-200 flex items-center justify-center">
<i class="fas fa-book-reader text-6xl text-purple-500"></i>
</div>
<div class="p-6">
<h3 class="text-xl font-semibold text-gray-900 mb-2">MPR/Library</h3>
<p class="text-gray-600">Book the Multi-Purpose Room or Library spaces</p>
</div>
</a>
</div>
</div>
</main>
<!-- Logout Confirmation Modal -->
<div id="logout-modal" class="hidden fixed inset-0 bg-gray-600 bg-opacity-50 flex items-center justify-center p-4 z-50">
<div class="bg-white rounded-lg shadow-xl max-w-sm w-full p-6">
<div class="flex items-center justify-between mb-4">
<h3 class="text-lg font-medium text-gray-900">Confirm Logout</h3>
<button id="close-logout-modal" class="text-gray-400 hover:text-gray-500">
<i class="fas fa-times"></i>
</button>
</div>
<div class="mb-4">
<p class="text-sm text-gray-600">Are you sure you want to log out?</p>
</div>
<div class="flex justify-end space-x-3">
<button id="cancel-logout" type="button" class="px-4 py-2 bg-gray-200 text-gray-800 text-sm font-medium rounded-md hover:bg-gray-300 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-gray-500">
Cancel
</button>
<button id="confirm-logout" type="button" class="px-4 py-2 bg-blue-600 text-white text-sm font-medium rounded-md hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500">
Logout
</button>
</div>
</div>
</div>
</div>
<!-- Classrooms Page -->
<div id="classrooms-page" class="hidden min-h-screen">
<!-- Navigation Bar -->
<nav class="bg-blue-600 text-white shadow-lg sticky top-0 z-10">
<div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
<div class="flex justify-between h-16">
<div class="flex items-center space-x-4">
<a href="#" id="home-link-classrooms" class="flex items-center text-white hover:text-blue-200">
<i class="fas fa-home mr-2"></i>
Home
</a>
</div>
<div class="flex items-center space-x-4">
<button id="logout-btn-classrooms" class="flex items-center text-white hover:text-blue-200">
<i class="fas fa-sign-out-alt mr-2"></i>
Logout
</button>
</div>
</div>
</div>
</nav>
<!-- Main Content -->
<main class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-8">
<h1 class="text-3xl font-bold text-gray-900 mb-8">Classroom Blocks</h1>
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6">
<!-- B Block -->
<div class="block-card bg-white rounded-lg shadow-md overflow-hidden hover:shadow-lg transition-shadow duration-300">
<a href="#" class="block" data-block="b">
<div class="h-48 bg-gray-200 flex items-center justify-center">
<i class="fas fa-building text-6xl text-blue-500"></i>
</div>
<div class="p-6">
<h3 class="text-xl font-semibold text-gray-900 mb-2">B Block</h3>
<p class="text-gray-600">Click to view classrooms in B Block</p>
</div>
</a>
</div>
<!-- C Block -->
<div class="block-card bg-white rounded-lg shadow-md overflow-hidden hover:shadow-lg transition-shadow duration-300">
<a href="#" class="block" data-block="c">
<div class="h-48 bg-gray-200 flex items-center justify-center">
<i class="fas fa-building text-6xl text-blue-500"></i>
</div>
<div class="p-6">
<h3 class="text-xl font-semibold text-gray-900 mb-2">C Block</h3>
<p class="text-gray-600">Click to view classrooms in C Block</p>
</div>
</a>
</div>
<!-- D Block -->
<div class="block-card bg-white rounded-lg shadow-md overflow-hidden hover:shadow-lg transition-shadow duration-300">
<a href="#" class="block" data-block="d">
<div class="h-48 bg-gray-200 flex items-center justify-center">
<i class="fas fa-building text-6xl text-blue-500"></i>
</div>
<div class="p-6">
<h3 class="text-xl font-semibold text-gray-900 mb-2">D Block</h3>
<p class="text-gray-600">Click to view classrooms in D Block</p>
</div>
</a>
</div>
<!-- E Block -->
<div class="block-card bg-white rounded-lg shadow-md overflow-hidden hover:shadow-lg transition-shadow duration-300">
<a href="#" class="block" data-block="e">
<div class="h-48 bg-gray-200 flex items-center justify-center">
<i class="fas fa-building text-6xl text-blue-500"></i>
</div>
<div class="p-6">
<h3 class="text-xl font-semibold text-gray-900 mb-2">E Block</h3>
<p class="text-gray-600">Click to view classrooms in E Block</p>
</div>
</a>
</div>
<!-- F Block -->
<div class="block-card bg-white rounded-lg shadow-md overflow-hidden hover:shadow-lg transition-shadow duration-300">
<a href="#" class="block" data-block="f">
<div class="h-48 bg-gray-200 flex items-center justify-center">
<i class="fas fa-building text-6xl text-blue-500"></i>
</div>
<div class="p-6">
<h3 class="text-xl font-semibold text-gray-900 mb-2">F Block</h3>
<p class="text-gray-600">Click to view classrooms in F Block</p>
</div>
</a>
</div>
<!-- I Block -->
<div class="block-card bg-white rounded-lg shadow-md overflow-hidden hover:shadow-lg transition-shadow duration-300">
<a href="#" class="block" data-block="i">
<div class="h-48 bg-gray-200 flex items-center justify-center">
<i class="fas fa-building text-6xl text-blue-500"></i>
</div>
<div class="p-6">
<h3 class="text-xl font-semibold text-gray-900 mb-2">I Block</h3>
<p class="text-gray-600">Click to view classrooms in I Block</p>
</div>
</a>
</div>
<!-- J Block -->
<div class="block-card bg-white rounded-lg shadow-md overflow-hidden hover:shadow-lg transition-shadow duration-300">
<a href="#" class="block" data-block="j">
<div class="h-48 bg-gray-200 flex items-center justify-center">
<i class="fas fa-building text-6xl text-blue-500"></i>
</div>
<div class="p-6">
<h3 class="text-xl font-semibold text-gray-900 mb-2">J Block</h3>
<p class="text-gray-600">Click to view classrooms in J Block</p>
</div>
</a>
</div>
<!-- S Block -->
<div class="block-card bg-white rounded-lg shadow-md overflow-hidden hover:shadow-lg transition-shadow duration-300">
<a href="#" class="block" data-block="s">
<div class="h-48 bg-gray-200 flex items-center justify-center">
<i class="fas fa-building text-6xl text-blue-500"></i>
</div>
<div class="p-6">
<h3 class="text-xl font-semibold text-gray-900 mb-2">S Block</h3>
<p class="text-gray-600">Click to view classrooms in S Block</p>
</div>
</a>
</div>
<!-- T Block -->
<div class="block-card bg-white rounded-lg shadow-md overflow-hidden hover:shadow-lg transition-shadow duration-300">
<a href="#" class="block" data-block="t">
<div class="h-48 bg-gray-200 flex items-center justify-center">
<i class="fas fa-building text-6xl text-blue-500"></i>
</div>
<div class="p-6">
<h3 class="text-xl font-semibold text-gray-900 mb-2">T Block</h3>
<p class="text-gray-600">Click to view classrooms in T Block</p>
</div>
</a>
</div>
</div>
</main>
<!-- Logout Confirmation Modal -->
<div id="logout-modal-classrooms" class="hidden fixed inset-0 bg-gray-600 bg-opacity-50 flex items-center justify-center p-4 z-50">
<div class="bg-white rounded-lg shadow-xl max-w-sm w-full p-6">
<div class="flex items-center justify-between mb-4">
<h3 class="text-lg font-medium text-gray-900">Confirm Logout</h3>
<button id="close-logout-modal-classrooms" class="text-gray-400 hover:text-gray-500">
<i class="fas fa-times"></i>
</button>
</div>
<div class="mb-4">
<p class="text-sm text-gray-600">Are you sure you want to log out?</p>
</div>
<div class="flex justify-end space-x-3">
<button id="cancel-logout-classrooms" type="button" class="px-4 py-2 bg-gray-200 text-gray-800 text-sm font-medium rounded-md hover:bg-gray-300 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-gray-500">
Cancel
</button>
<button id="confirm-logout-classrooms" type="button" class="px-4 py-2 bg-blue-600 text-white text-sm font-medium rounded-md hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500">
Logout
</button>
</div>
</div>
</div>
</div>
<!-- T Block Classrooms Page -->
<div id="tblock-page" class="hidden min-h-screen">
<!-- Navigation Bar -->
<nav class="bg-blue-600 text-white shadow-lg sticky top-0 z-10">
<div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
<div class="flex justify-between h-16">
<div class="flex items-center space-x-4">
<a href="#" id="home-link-tblock" class="flex items-center text-white hover:text-blue-200">
<i class="fas fa-home mr-2"></i>
Home
</a>
<a href="#" id="classrooms-link-tblock" class="flex items-center text-white hover:text-blue-200">
<i class="fas fa-building mr-2"></i>
Classrooms
</a>
</div>
<div class="flex items-center space-x-4">
<button id="logout-btn-tblock" class="flex items-center text-white hover:text-blue-200">
<i class="fas fa-sign-out-alt mr-2"></i>
Logout
</button>
</div>
</div>
</div>
</nav>
<!-- Main Content -->
<main class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-8">
<h1 class="text-3xl font-bold text-gray-900 mb-8">T Block Classrooms</h1>
<div class="grid grid-cols-1 md:grid-cols-2 gap-8">
<!-- T1 Classroom -->
<div class="bg-white rounded-lg shadow-md overflow-hidden">
<div class="flex flex-col md:flex-row">
<div class="w-full md:w-1/2">
<div class="h-48 bg-gray-200 flex items-center justify-center">
<i class="fas fa-chalkboard text-6xl text-blue-500"></i>
</div>
<div class="h-48 bg-gray-300 flex items-center justify-center">
<i class="fas fa-door-open text-6xl text-blue-400"></i>
</div>
</div>
<div class="w-full md:w-1/2 p-6">
<h3 class="text-xl font-semibold text-gray-900 mb-4">T1 Classroom</h3>
<!-- Mini Calendar -->
<div class="mb-6">
<div class="flex justify-between items-center mb-2">
<span class="text-sm font-medium text-gray-700">Today's Availability</span>
<span class="text-sm text-green-600 font-medium">Available</span>
</div>
<div class="grid grid-cols-7 gap-1 text-center text-xs">
<div class="py-1 text-gray-500">S</div>
<div class="py-1 text-gray-500">M</div>
<div class="py-1 text-gray-500">T</div>
<div class="py-1 text-gray-500">W</div>
<div class="py-1 text-gray-500">T</div>
<div class="py-1 text-gray-500">F</div>
<div class="py-1 text-gray-500">S</div>
<!-- Calendar days would be generated dynamically in a real app -->
<div class="py-1 text-gray-400">25</div>
<div class="py-1 text-gray-400">26</div>
<div class="py-1 text-gray-400">27</div>
<div class="py-1 text-gray-400">28</div>
<div class="py-1 text-gray-400">29</div>
<div class="py-1 text-gray-400">30</div>
<div class="py-1 rounded-full bg-green-100 text-green-800 font-medium">1</div>
</div>
</div>
<button class="w-full bg-blue-600 hover:bg-blue-700 text-white font-medium py-2 px-4 rounded-md transition duration-300 book-btn" data-room="t1">
Book T1
</button>
</div>
</div>
</div>
<!-- T2 Classroom -->
<div class="bg-white rounded-lg shadow-md overflow-hidden">
<div class="flex flex-col md:flex-row">
<div class="w-full md:w-1/2">
<div class="h-48 bg-gray-200 flex items-center justify-center">
<i class="fas fa-chalkboard text-6xl text-blue-500"></i>
</div>
<div class="h-48 bg-gray-300 flex items-center justify-center">
<i class="fas fa-door-open text-6xl text-blue-400"></i>
</div>
</div>
<div class="w-full md:w-1/2 p-6">
<h3 class="text-xl font-semibold text-gray-900 mb-4">T2 Classroom</h3>
<!-- Mini Calendar -->
<div class="mb-6">
<div class="flex justify-between items-center mb-2">
<span class="text-sm font-medium text-gray-700">Today's Availability</span>
<span class="text-sm text-red-600 font-medium">Booked</span>
</div>
<div class="grid grid-cols-7 gap-1 text-center text-xs">
<div class="py-1 text-gray-500">S</div>
<div class="py-1 text-gray-500">M</div>
<div class="py-1 text-gray-500">T</div>
<div class="py-1 text-gray-500">W</div>
<div class="py-1 text-gray-500">T</div>
<div class="py-1 text-gray-500">F</div>
<div class="py-1 text-gray-500">S</div>
<!-- Calendar days would be generated dynamically in a real app -->
<div class="py-1 text-gray-400">25</div>
<div class="py-1 text-gray-400">26</div>
<div class="py-1 text-gray-400">27</div>
<div class="py-1 text-gray-400">28</div>
<div class="py-1 text-gray-400">29</div>
<div class="py-1 text-gray-400">30</div>
<div class="py-1 rounded-full bg-red-100 text-red-800 font-medium">1</div>
</div>
</div>
<button class="w-full bg-blue-600 hover:bg-blue-700 text-white font-medium py-2 px-4 rounded-md transition duration-300 book-btn" data-room="t2">
Book T2
</button>
</div>
</div>
</div>
<!-- T3 Classroom -->
<div class="bg-white rounded-lg shadow-md overflow-hidden">
<div class="flex flex-col md:flex-row">
<div class="w-full md:w-1/2">
<div class="h-48 bg-gray-200 flex items-center justify-center">
<i class="fas fa-chalkboard text-6xl text-blue-500"></i>
</div>
<div class="h-48 bg-gray-300 flex items-center justify-center">
<i class="fas fa-door-open text-6xl text-blue-400"></i>
</div>
</div>
<div class="w-full md:w-1/2 p-6">
<h3 class="text-xl font-semibold text-gray-900 mb-4">T3 Classroom</h3>
<!-- Mini Calendar -->
<div class="mb-6">
<div class="flex justify-between items-center mb-2">
<span class="text-sm font-medium text-gray-700">Today's Availability</span>
<span class="text-sm text-green-600 font-medium">Available</span>
</div>
<div class="grid grid-cols-7 gap-1 text-center text-xs">
<div class="py-1 text-gray-500">S</div>
<div class="py-1 text-gray-500">M</div>
<div class="py-1 text-gray-500">T</div>
<div class="py-1 text-gray-500">W</div>
<div class="py-1 text-gray-500">T</div>
<div class="py-1 text-gray-500">F</div>
<div class="py-1 text-gray-500">S</div>
<!-- Calendar days would be generated dynamically in a real app -->
<div class="py-1 text-gray-400">25</div>
<div class="py-1 text-gray-400">26</div>
<div class="py-1 text-gray-400">27</div>
<div class="py-1 text-gray-400">28</div>
<div class="py-1 text-gray-400">29</div>
<div class="py-1 text-gray-400">30</div>
<div class="py-1 rounded-full bg-green-100 text-green-800 font-medium">1</div>
</div>
</div>
<button class="w-full bg-blue-600 hover:bg-blue-700 text-white font-medium py-2 px-4 rounded-md transition duration-300 book-btn" data-room="t3">
Book T3
</button>
</div>
</div>
</div>
<!-- T4 Classroom -->
<div class="bg-white rounded-lg shadow-md overflow-hidden">
<div class="flex flex-col md:flex-row">
<div class="w-full md:w-1/2">
<div class="h-48 bg-gray-200 flex items-center justify-center">
<i class="fas fa-chalkboard text-6xl text-blue-500"></i>
</div>
<div class="h-48 bg-gray-300 flex items-center justify-center">
<i class="fas fa-door-open text-6xl text-blue-400"></i>
</div>
</div>
<div class="w-full md:w-1/2 p-6">
<h3 class="text-xl font-semibold text-gray-900 mb-4">T4 Classroom</h3>
<!-- Mini Calendar -->
<div class="mb-6">
<div class="flex justify-between items-center mb-2">
<span class="text-sm font-medium text-gray-700">Today's Availability</span>
<span class="text-sm text-green-600 font-medium">Available</span>
</div>
<div class="grid grid-cols-7 gap-1 text-center text-xs">
<div class="py-1 text-gray-500">S</div>
<div class="py-1 text-gray-500">M</div>
<div class="py-1 text-gray-500">T</div>
<div class="py-1 text-gray-500">W</div>
<div class="py-1 text-gray-500">T</div>
<div class="py-1 text-gray-500">F</div>
<div class="py-1 text-gray-500">S</div>
<!-- Calendar days would be generated dynamically in a real app -->
<div class="py-1 text-gray-400">25</div>
<div class="py-1 text-gray-400">26</div>
<div class="py-1 text-gray-400">27</div>
<div class="py-1 text-gray-400">28</div>
<div class="py-1 text-gray-400">29</div>
<div class="py-1 text-gray-400">30</div>
<div class="py-1 rounded-full bg-green-100 text-green-800 font-medium">1</div>
</div>
</div>
<button class="w-full bg-blue-600 hover:bg-blue-700 text-white font-medium py-2 px-4 rounded-md transition duration-300 book-btn" data-room="t4">
Book T4
</button>
</div>
</div>
</div>
</div>
</main>
<!-- Booking Modal -->
<div id="booking-modal" class="hidden fixed inset-0 bg-gray-600 bg-opacity-50 flex items-center justify-center p-4 z-50">
<div class="bg-white rounded-lg shadow-xl max-w-2xl w-full p-6">
<div class="flex items-center justify-between mb-4">
<h3 class="text-lg font-medium text-gray-900" id="booking-modal-title">Book T1</h3>
<button id="close-booking-modal" class="text-gray-400 hover:text-gray-500">
<i class="fas fa-times"></i>
</button>
</div>
<div class="mb-6">
<label for="booking-date" class="block text-sm font-medium text-gray-700 mb-2">Select Date</label>
<input type="date" id="booking-date" class="appearance-none block w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm placeholder-gray-400 focus:outline-none focus:ring-blue-500 focus:border-blue-500 sm:text-sm">
</div>
<div class="mb-6">
<label class="block text-sm font-medium text-gray-700 mb-2">Available Time Slots</label>
<div class="grid grid-cols-3 gap-3" id="time-slots">
<!-- Time slots will be generated dynamically -->
</div>
</div>
<div class="flex justify-end space-x-3">
<button id="cancel-booking" type="button" class="px-4 py-2 bg-gray-200 text-gray-800 text-sm font-medium rounded-md hover:bg-gray-300 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-gray-500">
Cancel
</button>
<button id="confirm-booking" type="button" class="px-4 py-2 bg-blue-600 text-white text-sm font-medium rounded-md hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500">
Confirm Booking
</button>
</div>
</div>
</div>
<!-- Booking Confirmation Modal -->
<div id="confirmation-modal" class="hidden fixed inset-0 bg-gray-600 bg-opacity-50 flex items-center justify-center p-4 z-50">
<div class="bg-white rounded-lg shadow-xl max-w-sm w-full p-6">
<div class="flex items-center justify-between mb-4">
<h3 class="text-lg font-medium text-gray-900">Booking Confirmed</h3>
<button id="close-confirmation-modal" class="text-gray-400 hover:text-gray-500">
<i class="fas fa-times"></i>
</button>
</div>
<div class="mb-4">
<p class="text-sm text-gray-600" id="confirmation-message">Your booking has been confirmed.</p>
</div>
<div class="flex justify-end">
<button id="confirm-ok" type="button" class="px-4 py-2 bg-blue-600 text-white text-sm font-medium rounded-md hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500">
OK
</button>
</div>
</div>
</div>
<!-- Error Modal -->
<div id="booking-error-modal" class="hidden fixed inset-0 bg-gray-600 bg-opacity-50 flex items-center justify-center p-4 z-50">
<div class="bg-white rounded-lg shadow-xl max-w-sm w-full p-6">
<div class="flex items-center justify-between mb-4">
<h3 class="text-lg font-medium text-gray-900">Booking Error</h3>
<button id="close-booking-error-modal" class="text-gray-400 hover:text-gray-500">
<i class="fas fa-times"></i>
</button>
</div>
<div class="mb-4">
<p class="text-sm text-gray-600" id="booking-error-message">There was an error with your booking.</p>
</div>
<div class="flex justify-end">
<button id="confirm-booking-error" type="button" class="px-4 py-2 bg-blue-600 text-white text-sm font-medium rounded-md hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500">
OK
</button>
</div>
</div>
</div>
<!-- Logout Confirmation Modal -->
<div id="logout-modal-tblock" class="hidden fixed inset-0 bg-gray-600 bg-opacity-50 flex items-center justify-center p-4 z-50">
<div class="bg-white rounded-lg shadow-xl max-w-sm w-full p-6">
<div class="flex items-center justify-between mb-4">
<h3 class="text-lg font-medium text-gray-900">Confirm Logout</h3>
<button id="close-logout-modal-tblock" class="text-gray-400 hover:text-gray-500">
<i class="fas fa-times"></i>
</button>
</div>
<div class="mb-4">
<p class="text-sm text-gray-600">Are you sure you want to log out?</p>
</div>
<div class="flex justify-end space-x-3">
<button id="cancel-logout-tblock" type="button" class="px-4 py-2 bg-gray-200 text-gray-800 text-sm font-medium rounded-md hover:bg-gray-300 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-gray-500">
Cancel
</button>
<button id="confirm-logout-tblock" type="button" class="px-4 py-2 bg-blue-600 text-white text-sm font-medium rounded-md hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500">
Logout
</button>
</div>
</div>
</div>
</div>
<!-- Courts Page -->
<div id="courts-page" class="hidden min-h-screen">
<!-- Navigation Bar -->
<nav class="bg-blue-600 text-white shadow-lg sticky top-0 z-10">
<div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
<div class="flex justify-between h-16">
<div class="flex items-center space-x-4">
<a href="#" id="home-link-courts" class="flex items-center text-white hover:text-blue-200">
<i class="fas fa-home mr-2"></i>
Home
</a>
</div>
<div class="flex items-center space-x-4">
<button id="logout-btn-courts" class="flex items-center text-white hover:text-blue-200">
<i class="fas fa-sign-out-alt mr-2"></i>
Logout
</button>
</div>
</div>
</div>
</nav>
<!-- Main Content -->
<main class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-8">
<h1 class="text-3xl font-bold text-gray-900 mb-8">Sports Courts</h1>
<div class="grid grid-cols-1 md:grid-cols-2 gap-8">
<!-- Basketball Court -->
<div class="bg-white rounded-lg shadow-md overflow-hidden">
<div class="flex flex-col md:flex-row">
<div class="w-full md:w-1/2">
<div class="h-48 bg-gray-200 flex items-center justify-center">
<i class="fas fa-basketball-ball text-6xl text-orange-500"></i>
</div>
<div class="h-48 bg-gray-300 flex items-center justify-center">
<i class="fas fa-running text-6xl text-orange-400"></i>
</div>
</div>
<div class="w-full md:w-1/2 p-6">
<h3 class="text-xl font-semibold text-gray-900 mb-4">Basketball Court</h3>
<!-- Mini Calendar -->
<div class="mb-6">
<div class="flex justify-between items-center mb-2">
<span class="text-sm font-medium text-gray-700">Today's Availability</span>
<span class="text-sm text-green-600 font-medium">Available</span>
</div>
<div class="grid grid-cols-7 gap-1 text-center text-xs">
<div class="py-1 text-gray-500">S</div>
<div class="py-1 text-gray-500">M</div>
<div class="py-1 text-gray-500">T</div>
<div class="py-1 text-gray-500">W</div>
<div class="py-1 text-gray-500">T</div>
<div class="py-1 text-gray-500">F</div>
<div class="py-1 text-gray-500">S</div>
<!-- Calendar days would be generated dynamically in a real app -->
<div class="py-1 text-gray-400">25</div>
<div class="py-1 text-gray-400">26</div>
<div class="py-1 text-gray-400">27</div>
<div class="py-1 text-gray-400">28</div>
<div class="py-1 text-gray-400">29</div>
<div class="py-1 text-gray-400">30</div>
<div class="py-1 rounded-full bg-green-100 text-green-800 font-medium">1</div>
</div>
</div>
<button class="w-full bg-blue-600 hover:bg-blue-700 text-white font-medium py-2 px-4 rounded-md transition duration-300 book-btn" data-room="basketball">
Book Basketball Court
</button>
</div>
</div>
</div>
<!-- Netball Court -->
<div class="bg-white rounded-lg shadow-md overflow-hidden">
<div class="flex flex-col md:flex-row">
<div class="w-full md:w-1/2">
<div class="h-48 bg-gray-200 flex items-center justify-center">
<i class="fas fa-volleyball-ball text-6xl text-pink-500"></i>
</div>
<div class="h-48 bg-gray-300 flex items-center justify-center">
<i class="fas fa-running text-6xl text-pink-400"></i>
</div>
</div>
<div class="w-full md:w-1/2 p-6">
<h3 class="text-xl font-semibold text-gray-900 mb-4">Netball Court</h3>
<!-- Mini Calendar -->
<div class="mb-6">
<div class="flex justify-between items-center mb-2">
<span class="text-sm font-medium text-gray-700">Today's Availability</span>
<span class="text-sm text-red-600 font-medium">Booked</span>
</div>
<div class="grid grid-cols-7 gap-1 text-center text-xs">
<div class="py-1 text-gray-500">S</div>
<div class="py-1 text-gray-500">M</div>
<div class="py-1 text-gray-500">T</div>
<div class="py-1 text-gray-500">W</div>
<div class="py-1 text-gray-500">T</div>
<div class="py-1 text-gray-500">F</div>
<div class="py-1 text-gray-500">S</div>
<!-- Calendar days would be generated dynamically in a real app -->
<div class="py-1 text-gray-400">25</div>
<div class="py-1 text-gray-400">26</div>
<div class="py-1 text-gray-400">27</div>
<div class="py-1 text-gray-400">28</div>
<div class="py-1 text-gray-400">29</div>
<div class="py-1 text-gray-400">30</div>
<div class="py-1 rounded-full bg-red-100 text-red-800 font-medium">1</div>
</div>
</div>
<button class="w-full bg-blue-600 hover:bg-blue-700 text-white font-medium py-2 px-4 rounded-md transition duration-300 book-btn" data-room="netball">
Book Netball Court
</button>
</div>
</div>
</div>
</div>
</main>
<!-- Logout Confirmation Modal -->
<div id="logout-modal-courts" class="hidden fixed inset-0 bg-gray-600 bg-opacity-50 flex items-center justify-center p-4 z-50">
<div class="bg-white rounded-lg shadow-xl max-w-sm w-full p-6">
<div class="flex items-center justify-between mb-4">
<h3 class="text-lg font-medium text-gray-900">Confirm Logout</h3>
<button id="close-logout-modal-courts" class="text-gray-400 hover:text-gray-500">
<i class="fas fa-times"></i>
</button>
</div>
<div class="mb-4">
<p class="text-sm text-gray-600">Are you sure you want to log out?</p>
</div>
<div class="flex justify-end space-x-3">
<button id="cancel-logout-courts" type="button" class="px-4 py-2 bg-gray-200 text-gray-800 text-sm font-medium rounded-md hover:bg-gray-300 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-gray-500">
Cancel
</button>
<button id="confirm-logout-courts" type="button" class="px-4 py-2 bg-blue-600 text-white text-sm font-medium rounded-md hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500">
Logout
</button>
</div>
</div>
</div>
</div>
<!-- Fields Page -->
<div id="fields-page" class="hidden min-h-screen">
<!-- Navigation Bar -->
<nav class="bg-blue-600 text-white shadow-lg sticky top-0 z-10">
<div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
<div class="flex justify-between h-16">
<div class="flex items-center space-x-4">
<a href="#" id="home-link-fields" class="flex items-center text-white hover:text-blue-200">
<i class="fas fa-home mr-2"></i>
Home
</a>
</div>
<div class="flex items-center space-x-4">
<button id="logout-btn-fields" class="flex items-center text-white hover:text-blue-200">
<i class="fas fa-sign-out-alt mr-2"></i>
Logout
</button>
</div>
</div>
</div>
</nav>
<!-- Main Content -->
<main class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-8">
<h1 class="text-3xl font-bold text-gray-900 mb-8">Sports Fields</h1>
<div class="grid grid-cols-1 md:grid-cols-2 gap-8">
<!-- Field A -->
<div class="bg-white rounded-lg shadow-md overflow-hidden">
<div class="flex flex-col md:flex-row">
<div class="w-full md:w-1/2">
<div class="h-48 bg-gray-200 flex items-center justify-center">
<i class="fas fa-futbol text-6xl text-green-500"></i>
</div>
<div class="h-48 bg-gray-300 flex items-center justify-center">
<i class="fas fa-running text-6xl text-green-400"></i>
</div>
</div>
<div class="w-full md:w-1/2 p-6">
<h3 class="text-xl font-semibold text-gray-900 mb-4">Field A</h3>
<!-- Mini Calendar -->
<div class="mb-6">
<div class="flex justify-between items-center mb-2">
<span class="text-sm font-medium text-gray-700">Today's Availability</span>
<span class="text-sm text-green-600 font-medium">Available</span>
</div>
<div class="grid grid-cols-7 gap-1 text-center text-xs">
<div class="py-1 text-gray-500">S</div>
<div class="py-1 text-gray-500">M</div>
<div class="py-1 text-gray-500">T</div>
<div class="py-1 text-gray-500">W</div>
<div class="py-1 text-gray-500">T</div>
<div class="py-1 text-gray-500">F</div>
<div class="py-1 text-gray-500">S</div>
<!-- Calendar days would be generated dynamically in a real app -->
<div class="py-1 text-gray-400">25</div>
<div class="py-1 text-gray-400">26</div>
<div class="py-1 text-gray-400">27</div>
<div class="py-1 text-gray-400">28</div>
<div class="py-1 text-gray-400">29</div>
<div class="py-1 text-gray-400">30</div>
<div class="py-1 rounded-full bg-green-100 text-green-800 font-medium">1</div>
</div>
</div>
<button class="w-full bg-blue-600 hover:bg-blue-700 text-white font-medium py-2 px-4 rounded-md transition duration-300 book-btn" data-room="field-a">
Book Field A
</button>
</div>
</div>
</div>
<!-- Field B -->
<div class="bg-white rounded-lg shadow-md overflow-hidden">
<div class="flex flex-col md:flex-row">
<div class="w-full md:w-1/2">
<div class="h-48 bg-gray-200 flex items-center justify-center">
<i class="fas fa-futbol text-6xl text-green-500"></i>
</div>
<div class="h-48 bg-gray-300 flex items-center justify-center">
<i class="fas fa-running text-6xl text-green-400"></i>
</div>
</div>
<div class="w-full md:w-1/2 p-6">
<h3 class="text-xl font-semibold text-gray-900 mb-4">Field B</h3>
<!-- Mini Calendar -->
<div class="mb-6">
<div class="flex justify-between items-center mb-2">
<span class="text-sm font-medium text-gray-700">Today's Availability</span>
<span class="text-sm text-red-600 font-medium">Booked</span>
</div>
<div class="grid grid-cols-7 gap-1 text-center text-xs">
<div class="py-1 text-gray-500">S</div>
<div class="py-1 text-gray-500">M</div>
<div class="py-1 text-gray-500">T</div>
<div class="py-1 text-gray-500">W</div>
<div class="py-1 text-gray-500">T</div>
<div class="py-1 text-gray-500">F</div>
<div class="py-1 text-gray-500">S</div>
<!-- Calendar days would be generated dynamically in a real app -->
<div class="py-1 text-gray-400">25</div>
<div class="py-1 text-gray-400">26</div>
<div class="py-1 text-gray-400">27</div>
<div class="py-1 text-gray-400">28</div>
<div class="py-1 text-gray-400">29</div>
<div class="py-1 text-gray-400">30</div>
<div class="py-1 rounded-full bg-red-100 text-red-800 font-medium">1</div>
</div>
</div>
<button class="w-full bg-blue-600 hover:bg-blue-700 text-white font-medium py-2 px-4 rounded-md transition duration-300 book-btn" data-room="field-b">
Book Field B
</button>
</div>
</div>
</div>
</div>
</main>
<!-- Logout Confirmation Modal -->
<div id="logout-modal-fields" class="hidden fixed inset-0 bg-gray-600 bg-opacity-50 flex items-center justify-center p-4 z-50">
<div class="bg-white rounded-lg shadow-xl max-w-sm w-full p-6">
<div class="flex items-center justify-between mb-4">
<h3 class="text-lg font-medium text-gray-900">Confirm Logout</h3>
<button id="close-logout-modal-fields" class="text-gray-400 hover:text-gray-500">
<i class="fas fa-times"></i>
</button>
</div>
<div class="mb-4">
<p class="text-sm text-gray-600">Are you sure you want to log out?</p>
</div>
<div class="flex justify-end space-x-3">
<button id="cancel-logout-fields" type="button" class="px-4 py-2 bg-gray-200 text-gray-800 text-sm font-medium rounded-md hover:bg-gray-300 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-gray-500">
Cancel
</button>
<button id="confirm-logout-fields" type="button" class="px-4 py-2 bg-blue-600 text-white text-sm font-medium rounded-md hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500">
Logout
</button>
</div>
</div>
</div>
</div>
<!-- MPR/Library Page -->
<div id="mpr-page" class="hidden min-h-screen">
<!-- Navigation Bar -->
<nav class="bg-blue-600 text-white shadow-lg sticky top-0 z-10">
<div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
<div class="flex justify-between h-16">
<div class="flex items-center space-x-4">
<a href="#" id="home-link-mpr" class="flex items-center text-white hover:text-blue-200">
<i class="fas fa-home mr-2"></i>
Home
</a>
</div>
<div class="flex items-center space-x-4">
<button id="logout-btn-mpr" class="flex items-center text-white hover:text-blue-200">
<i class="fas fa-sign-out-alt mr-2"></i>
Logout
</button>
</div>
</div>
</div>
</nav>
<!-- Main Content -->
<main class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-8">
<h1 class="text-3xl font-bold text-gray-900 mb-8">MPR & Library</h1>
<div class="grid grid-cols-1 md:grid-cols-2 gap-8">
<!-- MPR -->
<div class="bg-white rounded-lg shadow-md overflow-hidden">
<div class="flex flex-col md:flex-row">
<div class="w-full md:w-1/2">
<div class="h-48 bg-gray-200 flex items-center justify-center">
<i class="fas fa-users text-6xl text-purple-500"></i>
</div>
<div class="h-48 bg-gray-300 flex items-center justify-center">
<i class="fas fa-door-open text-6xl text-purple-400"></i>
</div>
</div>
<div class="w-full md:w-1/2 p-6">
<h3 class="text-xl font-semibold text-gray-900 mb-4">Multi-Purpose Room</h3>
<!-- Mini Calendar -->
<div class="mb-6">
<div class="flex justify-between items-center mb-2">
<span class="text-sm font-medium text-gray-700">Today's Availability</span>
<span class="text-sm text-green-600 font-medium">Available</span>
</div>
<div class="grid grid-cols-7 gap-1 text-center text-xs">
<div class="py-1 text-gray-500">S</div>
<div class="py-1 text-gray-500">M</div>
<div class="py-1 text-gray-500">T</div>
<div class="py-1 text-gray-500">W</div>
<div class="py-1 text-gray-500">T</div>
<div class="py-1 text-gray-500">F</div>
<div class="py-1 text-gray-500">S</div>
<!-- Calendar days would be generated dynamically in a real app -->
<div class="py-1 text-gray-400">25</div>
<div class="py-1 text-gray-400">26</div>
<div class="py-1 text-gray-400">27</div>
<div class="py-1 text-gray-400">28</div>
<div class="py-1 text-gray-400">29</div>
<div class="py-1 text-gray-400">30</div>
<div class="py-1 rounded-full bg-green-100 text-green-800 font-medium">1</div>
</div>
</div>
<button class="w-full bg-blue-600 hover:bg-blue-700 text-white font-medium py-2 px-4 rounded-md transition duration-300 book-btn" data-room="mpr">
Book MPR
</button>
</div>
</div>
</div>
<!-- Library -->
<div class="bg-white rounded-lg shadow-md overflow-hidden">
<div class="flex flexocol md:flex-row">
<div class="w-full md:w-1/2">
<div class="h-48 bg-gray-200 flex items-center justify-center">
<i class="fas fa-book text-6xl text-indigo-500"></i>
</div>
<div class="h-48 bg-gray-300 flex items-center justify-center">
<i class="fas fa-door-open text-6xl text-indigo-400"></i>
</div>
</div>
<div class="w-full md:w-1/2 p-6">
<h3 class="text-xl font-semibold text-gray-900 mb-4">Library</h3>
<!-- Mini Calendar -->
<div class="mb-6">
<div class="flex justify-between items-center mb-2">
<span class="text-sm font-medium text-gray-700">Today's Availability</span>
<span class="text-sm text-red-600 font-medium">Booked</span>
</div>
<div class="grid grid-cols-7 gap-1 text-center text-xs">
<div class="py-1 text-gray-500">S</div>
<div class="py-1 text-gray-500">M</div>
<div class="py-1 text-gray-500">T</div>
<div class="py-1 text-gray-500">W</div>
<div class="py-1 text-gray-500">T</div>
<div class="py-1 text-gray-500">F</div>
<div class="py-1 text-gray-500">S</div>
<!-- Calendar days would be generated dynamically in a real app -->
<div class="py-1 text-gray-400">25</div>
<div class="py-1 text-gray-400">26</div>
<div class="py-1 text-gray-400">27</div>
<div class="py-1 text-gray-400">28</div>
<div class="py-1 text-gray-400">29</div>
<div class="py-1 text-gray-400">30</div>
<div class="py-1 rounded-full bg-red-100 text-red-800 font-medium">1</div>
</div>
</div>
<button class="w-full bg-blue-600 hover:bg-blue-700 text-white font-medium py-2 px-4 rounded-md transition duration-300 book-btn" data-room="library">
Book Library
</button>
</div>
</div>
</div>
</div>
</main>
<!-- Logout Confirmation Modal -->
<div id="logout-modal-mpr" class="hidden fixed inset-0 bg-gray-600 bg-opacity-50 flex items-center justify-center p-4 z-50">
<div class="bg-white rounded-lg shadow-xl max-w-sm w-full p-6">
<div class="flex items-center justify-between mb-4">
<h3 class="text-lg font-medium text-gray-900">Confirm Logout</h3>
<button id="close-logout-modal-mpr" class="text-gray-400 hover:text-gray-500">
<i class="fas fa-times"></i>
</button>
</div>
<div class="mb-4">
<p class="text-sm text-gray-600">Are you sure you want to log out?</p>
</div>
<div class="flex justify-end space-x-3">
<button id="cancel-logout-mpr" type="button" class="px-4 py-2 bg-gray-200 text-gray-800 text-sm font-medium rounded-md hover:bg-gray-300 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-gray-500">
Cancel
</button>
<button id="confirm-logout-mpr" type="button" class="px-4 py-2 bg-blue-600 text-white text-sm font-medium rounded-md hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500">
Logout
</button>
</div>
</div>
</div>
</div>
<script>
// DOM Elements
const loginPage = document.getElementById('login-page');
const homePage = document.getElementById('home-page');
const classroomsPage = document.getElementById('classrooms-page');
const tblockPage = document.getElementById('tblock-page');
const courtsPage = document.getElementById('courts-page');
const fieldsPage = document.getElementById('fields-page');
const mprPage = document.getElementById('mpr-page');
const loginForm = document.getElementById('login-form');
const emailInput = document.getElementById('email');
const errorModal = document.getElementById('error-modal');
const closeErrorModal = document.getElementById('close-error-modal');
const confirmErrorModal = document.getElementById('confirm-error-modal');
// Navigation buttons
const homeLinkClassrooms = document.getElementById('home-link-classrooms');
const homeLinkTblock = document.getElementById('home-link-tblock');
const homeLinkCourts = document.getElementById('home-link-courts');
const homeLinkFields = document.getElementById('home-link-fields');
const homeLinkMpr = document.getElementById('home-link-mpr');
const classroomsLinkTblock = document.getElementById('classrooms-link-tblock');
// Category links
const classroomsLink = document.getElementById('classrooms-link');
const courtsLink = document.getElementById('courts-link');
const fieldsLink = document.getElementById('fields-link');
const mprLink = document.getElementById('mpr-link');
// Block cards
const blockCards = document.querySelectorAll('.block-card a');
// Logout buttons
const logoutBtn = document.getElementById('logout-btn');
const logoutBtnClassrooms = document.getElementById('logout-btn-classrooms');
const logoutBtnTblock = document.getElementById('logout-btn-tblock');
const logoutBtnCourts = document.getElementById('logout-btn-courts');
const logoutBtnFields = document.getElementById('logout-btn-fields');
const logoutBtnMpr = document.getElementById('logout-btn-mpr');
// Logout modals
const logoutModal = document.getElementById('logout-modal');
const closeLogoutModal = document.getElementById('close-logout-modal');
const cancelLogout = document.getElementById('cancel-logout');
const confirmLogout = document.getElementById('confirm-logout');
const logoutModalClassrooms = document.getElementById('logout-modal-classrooms');
const closeLogoutModalClassrooms = document.getElementById('close-logout-modal-classrooms');
const cancelLogoutClassrooms = document.getElementById('cancel-logout-classrooms');
const confirmLogoutClassrooms = document.getElementById('confirm-logout-classrooms');
const logoutModalTblock = document.getElementById('logout-modal-tblock');
const closeLogoutModalTblock = document.getElementById('close-logout-modal-tblock');
const cancelLogoutTblock = document.getElementById('cancel-logout-tblock');
const confirmLogoutTblock = document.getElementById('confirm-logout-tblock');
const logoutModalCourts = document.getElementById('logout-modal-courts');
const closeLogoutModalCourts = document.getElementById('close-logout-modal-courts');
const cancelLogoutCourts = document.getElementById('cancel-logout-courts');
const confirmLogoutCourts = document.getElementById('confirm-logout-courts');
const logoutModalFields = document.getElementById('logout-modal-fields');
const closeLogoutModalFields = document.getElementById('close-logout-modal-fields');
const cancelLogoutFields = document.getElementById('cancel-logout-fields');
const confirmLogoutFields = document.getElementById('confirm-logout-fields');
const logoutModalMpr = document.getElementById('logout-modal-mpr');
const closeLogoutModalMpr = document.getElementById('close-logout-modal-mpr');
const cancelLogoutMpr = document.getElementById('cancel-logout-mpr');
const confirmLogoutMpr = document.getElementById('confirm-logout-mpr');
// Booking elements
const bookButtons = document.querySelectorAll('.book-btn');
const bookingModal = document.getElementById('booking-modal');
const closeBookingModal = document.getElementById('close-booking-modal');
const cancelBooking = document.getElementById('cancel-booking');
const bookingDate = document.getElementById('booking-date');
const timeSlots = document.getElementById('time-slots');
const confirmBooking = document.getElementById('confirm-booking');
const bookingModalTitle = document.getElementById('booking-modal-title');
// Confirmation modal
const confirmationModal = document.getElementById('confirmation-modal');
const closeConfirmationModal = document.getElementById('close-confirmation-modal');
const confirmOk = document.getElementById('confirm-ok');
const confirmationMessage = document.getElementById('confirmation-message');
// Error modal
const bookingErrorModal = document.getElementById('booking-error-modal');
const closeBookingErrorModal = document.getElementById('close-booking-error-modal');
const confirmBookingError = document.getElementById('confirm-booking-error');
const bookingErrorMessage = document.getElementById('booking-error-message');
// State variables
let currentUser = null;
let currentRoom = null;
let selectedDate = null;
let selectedTime = null;
// Show a specific page and hide others
function showPage(page) {
// Hide all pages
[loginPage, homePage, classroomsPage, tblockPage, courtsPage, fieldsPage, mprPage].forEach(p => {
p.classList.add('hidden');
});
// Show requested page
page.classList.remove('hidden');
}
// Initialize the app
function init() {
// Check if user is already logged in
const userEmail = localStorage.getItem('currentUser');
if (userEmail) {
currentUser = userEmail;
showPage(homePage);
} else {
showPage(loginPage);
}
// Set up event listeners
setupEventListeners();
// Set minimum date for booking (5 days from today)
const today = new Date();
const minDate = new Date(today);
minDate.setDate(today.getDate() + 5);
const minDateString = minDate.toISOString().split('T')[0];
bookingDate.setAttribute('min', minDateString);
}
// Set up all event listeners
function setupEventListeners() {
// Login form
loginForm.addEventListener('submit', handleLogin);
closeErrorModal.addEventListener('click', () => errorModal.classList.add('hidden'));
confirmErrorModal.addEventListener('click', () => errorModal.classList.add('hidden'));
// Navigation
classroomsLink.addEventListener('click', () => showPage(classroomsPage));
courtsLink.addEventListener('click', () => showPage(courtsPage));
fieldsLink.addEventListener('click', () => showPage(fieldsPage));
mprLink.addEventListener('click', () => showPage(mprPage));
homeLinkClassrooms.addEventListener('click', () => showPage(homePage));
homeLinkTblock.addEventListener('click', () => showPage(homePage));
homeLinkCourts.addEventListener('click', () => showPage(homePage));
homeLinkFields.addEventListener('click', () => showPage(homePage));
homeLinkMpr.addEventListener('click', () => showPage(homePage));
classroomsLinkTblock.addEventListener('click', () => showPage(classroomsPage));
// Block cards
blockCards.forEach(card => {
card.addEventListener('click', (e) => {
e.preventDefault();
// In a real app, we'd show the appropriate block page
// For this demo, we'll just show the T Block page
showPage(tblockPage);
});
});
// Logout buttons
logoutBtn.addEventListener('click', () => logoutModal.classList.remove('hidden'));
logoutBtnClassrooms.addEventListener('click', () => logoutModalClassrooms.classList.remove('hidden'));
logoutBtnTblock.addEventListener('click', () => logoutModalTblock.classList.remove('hidden'));
logoutBtnCourts.addEventListener('click', () => logoutModalCourts.classList.remove('hidden'));
logoutBtnFields.addEventListener('click', () => logoutModalFields.classList.remove('hidden'));
logoutBtnMpr.addEventListener('click', () => logoutModalMpr.classList.remove('hidden'));
// Logout modals
closeLogoutModal.addEventListener('click', () => logoutModal.classList.add('hidden'));
cancelLogout.addEventListener('click', () => logoutModal.classList.add('hidden'));
confirmLogout.addEventListener('click', handleLogout);
closeLogoutModalClassrooms.addEventListener('click', () => logoutModalClassrooms.classList.add('hidden'));
cancelLogoutClassrooms.addEventListener('click', () => logoutModal
</body>
</html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Hamilton Christian School - Booking System</title>
<script src="https://cdn.tailwindcss.com"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
<style>
/* Custom styles that can't be done with Tailwind */
.calendar-day {
transition: all 0.2s ease;
}
.calendar-day:hover:not(.disabled):not(.booked) {
transform: scale(1.05);
box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.5);
}
.time-slot {
transition: all 0.2s ease;
}
.time-slot:hover:not(.booked) {
transform: scale(1.02);
background-color: #eff6ff;
}
.tooltip {
position: relative;
}
.tooltip .tooltip-text {
visibility: hidden;
width: 120px;
background-color: #555;
color: #fff;
text-align: center;
border-radius: 6px;
padding: 5px;
position: absolute;
z-index: 1;
bottom: 125%;
left: 50%;
margin-left: -60px;
opacity: 0;
transition: opacity 0.3s;
}
.tooltip:hover .tooltip-text {
visibility: visible;
opacity: 1;
}
</style>
</head>
<body class="bg-gray-50 min-h-screen">
<!-- Login Page -->
<div id="login-page" class="flex flex-col items-center justify-center min-h-screen p-4">
<div class="w-full max-w-md bg-white rounded-lg shadow-md p-8">
<div class="text-center mb-8">
<img src="https://via.placeholder.com/150" alt="School Logo" class="mx-auto h-24 w-auto">
<h1 class="mt-4 text-3xl font-bold text-gray-900">Hamilton Christian School</h1>
<p class="mt-2 text-gray-600">Facility Booking System</p>
</div>
<form id="login-form" class="space-y-6">
<div>
<label for="email" class="block text-sm font-medium text-gray-700">School Email</label>
<div class="mt-1">
<input id="email" name="email" type="email" autocomplete="email" required
class="appearance-none block w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm placeholder-gray-400 focus:outline-none focus:ring-blue-500 focus:border-blue-500 sm:text-sm"
placeholder="you@hamiltonchristian.school.nz">
</div>
</div>
<div>
<button type="submit" class="w-full flex justify-center py-2 px-4 border border-transparent rounded-md shadow-sm text-sm font-medium text-white bg-blue-600 hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500">
Sign in
</button>
</div>
</form>
<!-- Error Modal -->
<div id="error-modal" class="hidden fixed inset-0 bg-gray-600 bg-opacity-50 flex items-center justify-center p-4 z-50">
<div class="bg-white rounded-lg shadow-xl max-w-sm w-full p-6">
<div class="flex items-center justify-between mb-4">
<h3 class="text-lg font-medium text-gray-900">Access Restricted</h3>
<button id="close-error-modal" class="text-gray-400 hover:text-gray-500">
<i class="fas fa-times"></i>
</button>
</div>
<div class="mb-4">
<p class="text-sm text-gray-600">Access is restricted to Hamilton Christian School accounts only.</p>
</div>
<div class="flex justify-end">
<button id="confirm-error-modal" type="button" class="px-4 py-2 bg-blue-600 text-white text-sm font-medium rounded-md hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500">
OK
</button>
</div>
</div>
</div>
</div>
</div>
<!-- Home Page (Booking Selection) -->
<div id="home-page" class="hidden min-h-screen">