-
Notifications
You must be signed in to change notification settings - Fork 0
/
scripts.js
33 lines (29 loc) · 998 Bytes
/
scripts.js
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
function login(role) {
if (role === 'restaurant') {
window.location.href = 'restaurant.html';
} else if (role === 'customer') {
window.location.href = 'customer.html';
}
}
function showSection(sectionId) {
document.querySelectorAll('.section').forEach(section => {
section.classList.remove('active');
});
document.getElementById(sectionId).classList.add('active');
}
document.addEventListener('DOMContentLoaded', () => {
const dishForm = document.getElementById('dish-form');
const orderForm = document.getElementById('order-form-content');
if (dishForm) {
dishForm.addEventListener('submit', (event) => {
event.preventDefault();
alert('Dish added successfully!');
});
}
if (orderForm) {
orderForm.addEventListener('submit', (event) => {
event.preventDefault();
alert('Order placed successfully!');
});
}
});