-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathuser_dashboard.js
More file actions
20 lines (18 loc) · 844 Bytes
/
Copy pathuser_dashboard.js
File metadata and controls
20 lines (18 loc) · 844 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
function updateLiveBooking() {
const theaterId = document.getElementById('theaterSelect').value;
const showtimeId = document.getElementById('showtimeSelect').value;
// Make an AJAX request to fetch live booking status
fetch(`get_live_booking_status.php?theater_id=${theaterId}&showtime_id=${showtimeId}`)
.then(response => response.json())
.then(data => {
if (data.success) {
// Update UI with live seat availability
document.getElementById('seatContainer').innerHTML = data.seatsAvailable;
} else {
console.log('Error fetching live booking data');
}
})
.catch(error => console.error('Error:', error));
}
// Set an interval to refresh the booking status every 10 seconds
setInterval(updateLiveBooking, 10000);