Spaces:
Build error
Build error
Create Dockerfile
Browse files1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309<!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>DockerfileAdded+1309