-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathrequestCourse.html
529 lines (496 loc) · 17.4 KB
/
requestCourse.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
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<!-- Standard Favicon -->
<link rel="icon" type="image/png" href="./assets/Color_Logo_Blue.png" />
<link
href="https://unpkg.com/[email protected]/css/boxicons.min.css"
rel="stylesheet"
/>
<!-- For Apple devices -->
<link
rel="apple-touch-icon"
sizes="512x512"
href="./assets/Color_Logo_Blue.png"
/>
<!-- For general use, like on Android -->
<link
rel="icon"
type="image/png"
sizes="256x256"
href="./assets/Color_Logo_Blue.png"
/>
<link
rel="icon"
type="image/png"
sizes="512x512"
href="./assets/Color_Logo_Blue.png"
/>
<!-- Web App Manifest -->
<link rel="manifest" href="/site.webmanifest" />
<title>DRN Inventory - Course Selection</title>
<link rel="stylesheet" href="css/bootstrap.min.css" />
<link rel="stylesheet" href="style.css" />
<link rel="stylesheet" href="./globals.css" />
<link
rel="stylesheet"
href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.1.1/css/all.min.css"
/>
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
<link
href="https://fonts.googleapis.com/css2?family=Bebas+Neue&display=swap"
rel="stylesheet"
/>
<script>
var stateTuples = [
["All", "All"],
["Alabama", "AL"],
["Alaska", "AK"],
["Arizona", "AZ"],
["Arkansas", "AR"],
["California", "CA"],
["Colorado", "CO"],
["Connecticut", "CT"],
["Delaware", "DE"],
["Florida", "FL"],
["Georgia", "GA"],
["Hawaii", "HI"],
["Idaho", "ID"],
["Illinois", "IL"],
["Indiana", "IN"],
["Iowa", "IA"],
["Kansas", "KS"],
["Kentucky", "KY"],
["Louisiana", "LA"],
["Maine", "ME"],
["Maryland", "MD"],
["Massachusetts", "MA"],
["Michigan", "MI"],
["Minnesota", "MN"],
["Mississippi", "MS"],
["Missouri", "MO"],
["Montana", "MT"],
["Nebraska", "NE"],
["Nevada", "NV"],
["New Hampshire", "NH"],
["New Jersey", "NJ"],
["New Mexico", "NM"],
["New York", "NY"],
["North Carolina", "NC"],
["North Dakota", "ND"],
["Ohio", "OH"],
["Oklahoma", "OK"],
["Oregon", "OR"],
["Pennsylvania", "PA"],
["Rhode Island", "RI"],
["South Carolina", "SC"],
["South Dakota", "SD"],
["Tennessee", "TN"],
["Texas", "TX"],
["Utah", "UT"],
["Vermont", "VT"],
["Virginia", "VA"],
["Washington", "WA"],
["West Virginia", "WV"],
["Wisconsin", "WI"],
["Wyoming", "WY"],
];
var courses = [
{ name: "Course Not Listed", city: "NA", state: "NA" },
{ name: "Maple Hill", city: "Leicester", state: "Massachusetts" },
{ name: "Tranquility Trails", city: "Woolwich", state: "New Jersey" },
{ name: "Blue Ribbon Pines", city: "East Bethel", state: "Minnesota" },
{ name: "Flip City", city: "Shelby", state: "Michigan" },
{ name: "Fox Run Meadows", city: "Smugglers' Notch", state: "Vermont" },
{ name: "Idlewild", city: "Burlington", state: "Kentucky" },
{ name: "The Beast", city: "Waco", state: "Texas" },
{ name: "DeLaveaga", city: "Santa Cruz", state: "California" },
{ name: "Hornets Nest", city: "Charlotte", state: "North Carolina" },
{ name: "Fountain Hills", city: "Fountain Hills", state: "Arizona" },
{ name: "Rollin Ridge", city: "Reedsville", state: "Wisconsin" },
{
name: "S.Y. Wilson Arlington Sports Complex",
city: "Arlington",
state: "Tennessee",
},
{ name: "10-3 at CB", city: "Mt. Crested Butte", state: "Colorado" },
{
name: "1000 Acres Ranch Disc Golf Course",
city: "Stony Creek",
state: "New York",
},
{
name: "2022 Lucky Disc Golf Open Freeman North",
city: "Idaho Falls",
state: "Idaho",
},
{ name: "3 Creeks", city: "Rising Sun", state: "Maryland" },
{ name: "50 Acre Park", city: "Evergreen", state: "Illinois" },
{ name: "501 Disc Golf", city: "Warren", state: "Massachusetts" },
{
name: "65th Infantry Veterans Disc Golf Course",
city: "Kissimmee",
state: "Florida",
},
{ name: "A. J. Jolly Park", city: "Alexandria", state: "Kentucky" },
{ name: "Stafford Woods", city: "Voorhees", state: "New Jersey" },
{ name: "Bellevue State Park", city: "Bellevue", state: "Delaware" },
{
name: "Inverness Disc Golf Park",
city: "Inverness",
state: "Florida",
},
{
name: "Girdwood Forest Fair Park",
city: "Girdwood",
state: "Alaska",
},
{
name: "Windy Ridge Disc Golf at Mitchusson Park",
city: "Huntsville",
state: "Arkansas",
},
{ name: "North Landing", city: "Virginia Beach", state: "Virginia" },
];
window.onload = function () {
// Placeholder names for remaining states not already in 'courses'
var remainingStates = [
"Alabama",
"Connecticut",
"Georgia",
"Hawaii",
"Iowa",
"Indiana",
"Kansas",
"Louisiana",
"Maine",
"Mississippi",
"Montana",
"Nebraska",
"Nevada",
"New Hampshire",
"New Mexico",
"North Dakota",
"Ohio",
"Oklahoma",
"Oregon",
"Rhode Island",
"South Carolina",
"South Dakota",
"Utah",
"Vermont",
"Washington",
"West Virginia",
"Wyoming",
];
remainingStates.forEach(function (state) {
if (!courses.some((course) => course.state === state)) {
courses.push({
name: state + " Disc Golf Course",
city: state + " City",
state: state,
});
}
});
// Function to populate states dropdown (unchanged)
function populateStates() {
var select = document.getElementById("inputState");
// Using stateTuples array
stateTuples.forEach(function (tuple) {
var option = document.createElement("option");
option.textContent = tuple[1]; // State name
option.value = tuple[0]; // State abbreviation
select.appendChild(option);
});
}
// Revised function to populate courses dropdown
function populateCourses() {
var select = document.getElementById("inputCourse");
courses.forEach(function (course) {
var option = document.createElement("option");
option.textContent = course.name; // Only display the course name
option.value = course.name; // You can change this if you need to store a different value
select.appendChild(option);
});
}
// Call the functions to populate the dropdowns
populateStates();
populateCourses();
};
</script>
<script>
function toggleFabMenu() {
const overlay = document.getElementById("overlay");
const fabMenuContainer = document.getElementById("fabMenuContainer");
const fabLogo = document.getElementById("fabLogo"); // Get the logo by its ID
const fabClose = document.getElementById("fabClose"); // Get the 'X' span by its ID
const fabContainer = document.getElementById("fabContainer"); // Get the 'X' span by its ID
const fab = document.getElementById("fab"); // Get the 'X' span by its ID
// Toggle the active class on the overlay and the FAB menu
overlay.classList.toggle("active");
fabMenuContainer.classList.toggle("active");
// Check if the menu is active or not
if (fabMenuContainer.classList.contains("active")) {
// Menu is active, show 'X' and hide logo
fabLogo.style.display = "none"; // Hide the logo
fabClose.style.display = "block"; // Show the 'X'
} else {
// Menu is not active, hide 'X' and show logo
fabLogo.style.display = "block"; // Show the logo
fabClose.style.display = "none"; // Hide the 'X'
}
}
function reportLostDisc() {
window.location.href = "reportLostDisc.html";
}
function requestCourse() {
window.location.href = "requestCourse.html";
}
function openSettings() {
window.location.href = "settings.html";
}
function goBack() {
if (document.referrer.startsWith(window.location.origin)) {
window.history.back();
} else {
// Handle the case when there is no history to go back to
// For example, redirect to a different page or display an error message
console.log("No page on the same domain to go back to.");
}
}
function refresh() {
window.location.href = "/";
}
function searchCourse() {
// Get the input value
const courseInputValue = document.getElementById("inputCourse").value;
const stateInputValue = document.getElementById("inputState").value;
if (courseInputValue.toLowerCase() === "select a course") {
alert("Please select a course to search.");
return;
}
// Check if a disc is found (you can modify this condition)
const disc_found = false; // Change this condition as needed
// alert("Implement Search Function.");
window.location.href = `searchCourse.html?course=${encodeURIComponent(
courseInputValue
)}`;
}
document.addEventListener("DOMContentLoaded", function () {
document
.getElementById("inputState")
.addEventListener("change", function () {
var selectedState = this.value;
var filteredCourses;
// Check if "All" is selected
if (selectedState === "All") {
// Use the entire courses array
filteredCourses = courses;
} else {
// Apply filtering for a specific state
console.log("filtering...");
console.log(selectedState);
filteredCourses = courses.filter(function (course) {
return course.state === selectedState;
});
console.log(filteredCourses);
}
var courseSelect = document.getElementById("inputCourse");
courseSelect.innerHTML = ""; // Clear existing options
filteredCourses.forEach(function (course) {
var option = document.createElement("option");
option.textContent = course.name;
console.log(course.name);
option.value = course.name;
courseSelect.appendChild(option);
});
});
document
.getElementById("inputCourse")
.addEventListener("change", function () {
var selectedCourseName = this.value;
if (selectedCourseName === "Course Not Listed") {
// Show a popup when "Course Not Listed" is selected
alert("Please request a course by providing additional details.");
// You can replace the above line with code to show a custom modal/dialog if needed
} else {
// Existing logic for when a course is selected
console.log("selected course: " + selectedCourseName);
var selectedCourse = courses.find(function (course) {
return course.name === selectedCourseName;
});
if (selectedCourse) {
document.getElementById("inputState").value =
selectedCourse.state;
}
}
});
});
</script>
</head>
<body>
<section class="main-section text-center">
<div class="page-container" id="container">
<i
class="fa fa-arrow-left"
style="
position: absolute;
top: 20px;
left: 20px;
font-size: 30px;
color: white;
padding: 5px;
"
aria-hidden="true"
onclick="goBack()"
></i>
<div class="d-flex align-items-center flex-column text-center mb-2">
<img
class="icon-logo"
src="./assets/icon_logo_transparent_fullsize.png"
alt="logo"
onclick="refresh()"
/>
</div>
<div
class="rescue d-flex align-items-center flex-column text-center mt-5 mb-0"
>
<h2 class="m-0 text-white">
Request a
<span class="fw-light" style="font-weight: 300 !important"
>Course</span
>
</h2>
</div>
<h4 class="mt-0 mb-6 text-white text-center where sub-header-smaller">
What are we
<span class="missingtext">Missing?</span>
</h4>
<div class="row mt-5 mb-3 select-box">
<div class="col-4 pe-0 arrow one" style="padding-left: 0px">
<select id="inputState" class="form-select">
<option selected>STATE</option>
<!-- States options will be populated by JavaScript -->
</select>
</div>
<!-- Disc Golf Courses Dropdown -->
<div class="col-8 pe-0">
<input
id="inputCourse"
class="form-select"
placeholder="Course Name"
/>
</div>
</div>
<div class="btn-container-request-course">
<button
class="btn red lessHeight fullWidth"
style="font-size: 1rem"
onclick="alert('This is a demo, courses cannot be added this way. Thank you for using the demo!')"
>
Request your course
</button>
</div>
</div>
</section>
<div class="fab-menu-container" id="fabMenuContainer">
<div class="fab-menu" id="fabMenu">
<div class="fab-menu-item">
<a
class="fab-menu-item-text-left"
href="/reportLostDisc.html"
style="text-decoration: none"
>Report <br />
Lost Disc</a
>
<i class="bx bxs-analyse bx-sm" onclick="reportLostDisc()"></i>
</div>
<div class="fab-menu-item">
<a
class="fab-menu-item-text"
href="/requestCourse.html"
style="text-decoration: none"
>Request a Course</a
>
<i class="bx bx-map-pin bx-sm" onclick="requestCourse()"></i>
</div>
<div class="fab-menu-item">
<i class="bx bx-cog bx-sm" onclick="openSettings()"></i>
<a
class="fab-menu-item-text-right"
href="/settings.html"
style="text-decoration: none"
>Settings</a
>
</div>
</div>
</div>
<footer class="footer">
<div class="overlay" id="overlay" onclick="toggleFabMenu()"></div>
<div class="container">
<div class="footer-content row">
<div class="col-2">
<a class="d-flex align-items-center flex-column" href="/home.html">
<span class="img">
<img src="./assets/home.png" alt="home" />
</span>
<span>HOME</span>
</a>
</div>
<div class="col-2">
<a
class="d-flex align-items-center flex-column"
href="/searchInventory.html"
>
<span class="img">
<img
class="search"
src="./assets/search.png"
alt="home"
width="18"
/>
</span>
<span>SEARCH ALL</span>
</a>
</div>
<div class="col-2">
<a class="d-flex align-items-center flex-column" href="/store.html">
<span class="img">
<img src="./assets/disk-store.png" alt="home" />
</span>
<span>DISC STORE</span>
</a>
</div>
<div class="col-2">
<a
class="d-flex align-items-center flex-column"
href="/courses.html"
>
<span class="img">
<img src="./assets/courses.png" alt="home" />
</span>
<span>COURSES</span>
</a>
</div>
</div>
<!-- <button class="btnaction"><img class="btnlogo" src="./assets/app_center_btn_logo.png" alt="btnlogo"></button> -->
</div>
</footer>
<div class="fab-container" onclick="toggleFabMenu()" id="fabContainer">
<button class="fab" id="fab">
<img
src="./assets/app_center_btn_logo.png"
alt="Disc Rescue Network Logo"
class="logo-fab"
id="fabLogo"
/>
<span id="fabClose" style="display: none; z-index: 15">X</span>
<!-- Hidden by default -->
</button>
</div>
<!-- <script src="js/bootstrap.bundle.min.js"></script> -->
</body>
</html>