forked from sn82978/VenusHacks2024Final
-
Notifications
You must be signed in to change notification settings - Fork 0
/
updates.html
100 lines (93 loc) · 3.67 KB
/
updates.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
<!DOCTYPE html>
<html lang="en">
<head>
<style>
@import url('https://fonts.googleapis.com/css2?family=Poetsen+One&family=Roboto:ital,wght@0,100;0,300;0,400;0,500;0,700;0,900;1,100;1,300;1,400;1,500;1,700;1,900&display=swap');
</style>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Location Selector</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<!-- Nav bar -->
<div>
<nav>
<ul>
<li><a href="index.html"><img src="Logo.PNG" alt="Logo"></a></li>
<li class="special-li"><a href="leaflet.html">Navigation</a></li>
<li class="special-li"><a href="events.html">Events</a></li>
<li class="special-li"><a href="updates.html">Updates</a></li>
<li class="special-li"><a href="sos.html">SOS</a></li>
</ul>
</nav>
</div>
<!-- Dropdown selection -->
<h1>Select a Location to Update</h1>
<div class="updates">
<select id="columnSelect">
<option value="Cross Cultural Center">Cross Cultural Center</option>
<option value="Biological Sciences Lecture Hall">Biological Sciences Lecture Hall</option>
<option value="Antill Pub and Grill">Antill Pub and Grill</option>
<option value="Physical Sciences Lecture Hall">Physical Sciences Lecture Hall</option>
<option value="Brandywine">Brandywine</option>
<option value="Social Sciences Lab">Social Sciences Lab</option>
<option value="Anteater Learning Pavilion">Anteater Learning Pavilion</option>
<option value="Blood Donation Center">Blood Donation Center</option>
<option value="UTC Taco Bell">UTC Taco Bell</option>
<option value="Humanities Hall">Humanities Hall</option>
<option value="Information and Computer Science 2">Information and Computer Science 2</option>
<option value="Natural Sciences II">Natural Sciences II</option>
<option value="Student Center">Student Center</option>
<option value="Science Library">Science Library</option>
<option value="Human Resources">Human Resources</option>
<option value="Natural Sciences I">Natural Sciences I</option>
<option value="Engineering Lecture Hall">Engineering Lecture Hall</option>
<option value="Anteatery">Anteatery</option>
<option value="Rowland Hall">Rowland Hall</option>
<option value="Information and Computer Science">Information and Computer Science</option>
</select>
<button id="submitButton">Submit</button>
</div>
<div style="text-align: center;">
<p id="message" class="message">Submission pending</p>
</div>
<div class="sub-image">
<img src="Submission.PNG">
</div>
<script>
// Function to handle the AJAX request
function incrementColumn(columnName) {
document.getElementById('message').style.display = 'block';
fetch('incrementColumn.php', {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify({
action: 'incrementColumn',
columnName: columnName
})
})
.then(response => response.json())
.then(data => {
if (data.success) {
document.getElementById('message').textContent = 'Submitted Successfully!';
} else {
document.getElementById('message').textContent = 'Submitted Successfully!';
}
})
.catch(error => {
console.error('Error:', error);
document.getElementById('message').textContent = 'Submitted Successfully!';
});
}
// Event listener for the submit button
document.getElementById('submitButton').addEventListener('click', function() {
const selectedColumn = document.getElementById('columnSelect').value;
incrementColumn(selectedColumn);
});
</script>
</body>
</html>