Update navigation links to point to employee-login.php and enhance login error handling

This commit is contained in:
vista-man
2025-04-10 17:13:49 +02:00
parent d5779156d2
commit c7300a2b0a
12 changed files with 168 additions and 74 deletions

View File

@@ -1,49 +1,51 @@
document.getElementById('ticketForm').addEventListener('submit', function (e) {
e.preventDefault();
// Check if the ticket form exists before adding an event listener
const ticketForm = document.getElementById('ticketForm');
if (ticketForm) {
ticketForm.addEventListener('submit', function (e) {
e.preventDefault();
const name = document.getElementById('name').value;
const email = document.getElementById('email').value;
const category = document.getElementById('ticketCategory').value;
const quantity = document.getElementById('ticketQuantity').value;
const name = document.getElementById('name').value;
const email = document.getElementById('email').value;
const category = document.getElementById('ticketCategory').value;
const quantity = document.getElementById('ticketQuantity').value;
const ticketId = `TICKET-${Date.now()}`;
const ticketId = `TICKET-${Date.now()}`;
const qrContent = `Name: ${name}, Email: ${email}, Category: ${category}, Quantity: ${quantity}, Ticket ID: ${ticketId}`;
const qrContent = `Name: ${name}, Email: ${email}, Category: ${category}, Quantity: ${quantity}, Ticket ID: ${ticketId}`;
const qrCodeContainer = document.getElementById('qrCodeContainer');
qrCodeContainer.innerHTML = '';
const qrCode = new QRCode(qrCodeContainer, {
text: qrContent,
width: 200,
height: 200,
const qrCodeContainer = document.getElementById('qrCodeContainer');
qrCodeContainer.innerHTML = '';
const qrCode = new QRCode(qrCodeContainer, {
text: qrContent,
width: 200,
height: 200,
});
alert('Ticket(s) successfully generated!');
});
}
alert('Ticket(s) successfully generated!');
});
// Function to toggle video playback
function toggleVideo() {
const video = document.getElementById('myVideo');
if (video.paused) {
video.play();
} else {
video.pause();
if (video) {
if (video.paused) {
video.play();
} else {
video.pause();
}
}
}
}
document.getElementById('loginForm').addEventListener('submit', function (e) {
document.getElementById('loginForm').addEventListener('submit', function (e) {
e.preventDefault();
const username = document.getElementById('username').value;
const password = document.getElementById('password').value;
if (username === 'admin' && password === 'password') {
alert('Succesvol ingelogd!');
window.location.href = '../qr/qr.html';
window.location.href = '../qr/qr.html';
} else {
alert('Ongeldige inloggegevens.');
}