-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbookings.html
240 lines (233 loc) · 8.97 KB
/
bookings.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
<!DOCTYPE html>
<html lang="en">
<head>
<!-- Google tag (gtag.js) -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-YS5DRCX89L"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'G-YS5DRCX89L');
</script>
<link rel="icon" href="./img/icon.ico" type="image/x-icon">
<link rel="apple-touch-icon" href="./img/icon.png">
<meta name="color-scheme" content="light only">
<meta name="msapplication-TileImage" content="./img/icon.png">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="description" content="Book CDC practical lesson and test slots quickly with our Automated Slots Booking System. Select your preferred slots and let our bot do the rest!">
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!-- Facebook Meta Tags -->
<meta property="og:url" content="https://bloodlusted.com/bookings">
<meta property="og:type" content="website">
<meta property="og:title" content="CDC Slots Booking System">
<meta property="og:description" content="Book CDC practical lesson and test slots quickly with our Automated Slots Booking System. Select your preferred slots and let our bot do the rest!">
<meta property="og:image" content="./img/icon.png">
<!-- Twitter Meta Tags -->
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:title" content="CDC Slots Booking System">
<meta name="twitter:description" content="Book CDC practical lesson and test slots quickly with our Automated Slots Booking System. Select your preferred slots and let our bot do the rest!">
<meta name="twitter:image" content="./img/icon.png">
<title>CDC Slots Booking System</title>
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
<!-- Google Fonts -->
<link href="https://fonts.googleapis.com/css2?family=Roboto:wght@400;500&display=swap" rel="stylesheet">
<style>
body {
font-family: 'Roboto', sans-serif;
background-color: #f8f9fa;
color: #333;
margin: 0;
padding: 20px;
}
h1 {
text-align: center;
color: #007bff;
margin-bottom: 30px;
font-weight: 500;
}
.table-container {
overflow-x: auto; /* Enable horizontal scrolling */
margin-bottom: 20px; /* Space below the table */
}
table {
border-collapse: collapse;
width: 100%;
background-color: #fff;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}
th, td {
border: 1px solid #dee2e6;
padding: 16px;
text-align: center;
font-size: 20px;
}
th {
background-color: #007bff;
color: #fff;
font-weight: 500;
}
tbody tr:nth-child(odd) {
background-color: #f9f9f9;
}
tbody tr:nth-child(even) {
background-color: #e9ecef;
}
tr:hover td {
background-color: #cce5ff;
}
input[type="checkbox"] {
width: 20px;
height: 20px;
margin: 0;
cursor: pointer;
}
.pagination {
margin-top: 40px;
display: flex;
justify-content: center;
align-items: center;
}
.pagination button {
background-color: #007bff;
color: #fff;
border: none;
padding:7.5px 15px;
font-size: 16px;
cursor: pointer;
transition: background-color 0.3s ease;
border-radius: 10px;
}
.pagination button:hover {
background-color: #0056b3;
}
.pagination span {
margin: 0 10px;
font-size: 18px;
vertical-align: middle;
}
.button-container {
display: flex;
justify-content: center;
gap: 30px; /* Space between the buttons */
margin-top: 30px;
}
button[type="submit"],
button[type="button"] {
background-color: #28a745;
color: #fff;
border: none;
padding: 12px 25px;
font-size: 18px;
cursor: pointer;
transition: background-color 0.3s ease;
border-radius: 5px;
font-weight: bold;
width: 120px; /* Set a fixed width for both buttons */
}
button[type="submit"]:hover {
background-color: #218838;
}
button[type="button"] {
background-color: #e74c3c;
}
button[type="button"]:hover {
background-color: #c0392b;
}
.arrow {
border: solid white;
border-width: 0 6px 6px 0;
display: inline-block;
padding: 6px;
margin-top: 5px;
}
.right {
transform: rotate(-45deg);
-webkit-transform: rotate(-45deg);
}
.left {
transform: rotate(135deg);
-webkit-transform: rotate(135deg);
}
@media (max-width: 768px) {
body {
padding: 10px; /* Less padding on mobile */
}
h1 {
font-size: 24px; /* Smaller font size for mobile */
width: 100%; /* Ensure it takes full width */
}
table {
box-shadow: none; /* Remove shadow on mobile */
}
th, td {
padding: 10px; /* Smaller padding for table cells */
font-size: 16px; /* Smaller font size for mobile */
}
input[type="checkbox"] {
width: 25px; /* Larger checkboxes for mobile */
height: 25px;
}
.pagination {
margin-top: 20px; /* Reduce margin on mobile */
flex-wrap: wrap; /* Allow buttons to wrap on smaller screens */
}
.pagination button {
padding: 8px 15px; /* Smaller button padding */
font-size: 14px; /* Smaller font size */
margin: 5px; /* Add margin for spacing */
}
}
</style>
</head>
<body>
<h1>Select Your Slots - <span id="username"></span></h1>
<script>
const user = localStorage.getItem('user');
if (!user) {
window.location.href = 'login.html';
} else {
document.getElementById('username').innerText = localStorage.getItem('username');
}
</script>
<form id="bookingForm">
<div class="table-container">
<table>
<thead>
<tr>
<th>Date</th>
<th>08:30 - 10:10</th>
<th>10:20 - 12:00</th>
<th>12:45 - 14:25</th>
<th>14:35 - 16:15</th>
<th>16:25 - 18:05</th>
<th>18:50 - 20:30</th>
<th>20:40 - 22:20</th>
</tr>
</thead>
<tbody>
<tr>
<td><input type="checkbox" name="{{ day.split(' ')[0] }}" value="Session1" {% if 'Session1' in bookings.get(day.split(' ')[0], []) %}checked{% endif %}></td>
<td><input type="checkbox" name="{{ day.split(' ')[0] }}" value="Session2" {% if 'Session2' in bookings.get(day.split(' ')[0], []) %}checked{% endif %}></td>
<td><input type="checkbox" name="{{ day.split(' ')[0] }}" value="Session3" {% if 'Session3' in bookings.get(day.split(' ')[0], []) %}checked{% endif %}></td>
<td><input type="checkbox" name="{{ day.split(' ')[0] }}" value="Session4" {% if 'Session4' in bookings.get(day.split(' ')[0], []) %}checked{% endif %}></td>
<td><input type="checkbox" name="{{ day.split(' ')[0] }}" value="Session5" {% if 'Session5' in bookings.get(day.split(' ')[0], []) %}checked{% endif %}></td>
<td><input type="checkbox" name="{{ day.split(' ')[0] }}" value="Session6" {% if 'Session6' in bookings.get(day.split(' ')[0], []) %}checked{% endif %}></td>
<td><input type="checkbox" name="{{ day.split(' ')[0] }}" value="Session7" {% if 'Session7' in bookings.get(day.split(' ')[0], []) %}checked{% endif %}></td>
</tr>
</tbody>
</table>
</div>
<div class="pagination">
<button id="prevPage"><i class="arrow left"></i></button>
<span>Page {{ page }} of {{ total_pages }}</span>
<button id="nextPage"><i class="arrow right"></i></button>
</div>
<div class="button-container">
<button type="button" id="clearSlots">Clear</button>
<button type="submit">Submit</button>
</div>
</form>
<script type="module" src="./js/bookings.js"></script>
</body>
</html>