Spaces:
Running
Running
do debugging After Clicking Confirm Booking, the app should present another form showing the car booking and booking information as a confirmation of the clients booking.
Browse files- admin-dashboard.html +53 -8
- index.html +50 -19
admin-dashboard.html
CHANGED
|
@@ -350,10 +350,42 @@
|
|
| 350 |
<i data-feather="check" class="text-green-600"></i>
|
| 351 |
</div>
|
| 352 |
<h3 class="text-lg font-medium text-gray-900 mb-2">Booking Confirmed!</h3>
|
| 353 |
-
<div class="mt-2 text-sm text-gray-500">
|
| 354 |
-
<
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 355 |
</div>
|
| 356 |
-
<
|
|
|
|
| 357 |
<button id="closeConfirmation" type="button" class="inline-flex justify-center rounded-md border border-transparent shadow-sm px-4 py-2 bg-primary text-base font-medium text-white hover:bg-blue-800 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 sm:text-sm">
|
| 358 |
Close
|
| 359 |
</button>
|
|
@@ -448,11 +480,24 @@
|
|
| 448 |
alert('Please select a courtesy car or uncheck the courtesy car option');
|
| 449 |
return;
|
| 450 |
}
|
| 451 |
-
|
| 452 |
-
|
| 453 |
-
// In a real app, you would send this data to your backend API
|
| 454 |
-
console.log('Booking submitted:', formData);
|
| 455 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 456 |
// Show confirmation modal
|
| 457 |
const confirmationModal = document.getElementById('confirmationModal');
|
| 458 |
confirmationModal.classList.remove('hidden');
|
|
@@ -464,7 +509,7 @@
|
|
| 464 |
card.classList.remove('border-primary', 'border-2');
|
| 465 |
card.querySelector('i').classList.add('hidden');
|
| 466 |
});
|
| 467 |
-
|
| 468 |
// Close confirmation modal
|
| 469 |
document.getElementById('closeConfirmation').addEventListener('click', function() {
|
| 470 |
const confirmationModal = document.getElementById('confirmationModal');
|
|
|
|
| 350 |
<i data-feather="check" class="text-green-600"></i>
|
| 351 |
</div>
|
| 352 |
<h3 class="text-lg font-medium text-gray-900 mb-2">Booking Confirmed!</h3>
|
| 353 |
+
<div class="mt-2 text-sm text-gray-500 bg-gray-50 p-4 rounded-lg">
|
| 354 |
+
<div class="space-y-2">
|
| 355 |
+
<div class="flex justify-between">
|
| 356 |
+
<span class="font-medium">Reference #:</span>
|
| 357 |
+
<span id="bookingRef"></span>
|
| 358 |
+
</div>
|
| 359 |
+
<div class="flex justify-between">
|
| 360 |
+
<span class="font-medium">Customer Name:</span>
|
| 361 |
+
<span id="confirmName"></span>
|
| 362 |
+
</div>
|
| 363 |
+
<div class="flex justify-between">
|
| 364 |
+
<span class="font-medium">Phone:</span>
|
| 365 |
+
<span id="confirmPhone"></span>
|
| 366 |
+
</div>
|
| 367 |
+
<div class="flex justify-between">
|
| 368 |
+
<span class="font-medium">Vehicle:</span>
|
| 369 |
+
<span id="confirmVehicle"></span>
|
| 370 |
+
</div>
|
| 371 |
+
<div class="flex justify-between">
|
| 372 |
+
<span class="font-medium">Service Type:</span>
|
| 373 |
+
<span id="confirmService"></span>
|
| 374 |
+
</div>
|
| 375 |
+
<div class="flex justify-between">
|
| 376 |
+
<span class="font-medium">Date:</span>
|
| 377 |
+
<span id="confirmDate"></span>
|
| 378 |
+
</div>
|
| 379 |
+
<div id="confirmCarSection" class="hidden">
|
| 380 |
+
<div class="flex justify-between">
|
| 381 |
+
<span class="font-medium">Courtesy Car:</span>
|
| 382 |
+
<span id="confirmCar"></span>
|
| 383 |
+
</div>
|
| 384 |
+
</div>
|
| 385 |
+
</div>
|
| 386 |
</div>
|
| 387 |
+
<p class="mt-3 text-sm text-gray-500">A confirmation email has been sent to your registered email address. Please bring this reference number when you visit us.</p>
|
| 388 |
+
<div class="mt-5">
|
| 389 |
<button id="closeConfirmation" type="button" class="inline-flex justify-center rounded-md border border-transparent shadow-sm px-4 py-2 bg-primary text-base font-medium text-white hover:bg-blue-800 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 sm:text-sm">
|
| 390 |
Close
|
| 391 |
</button>
|
|
|
|
| 480 |
alert('Please select a courtesy car or uncheck the courtesy car option');
|
| 481 |
return;
|
| 482 |
}
|
| 483 |
+
// Generate random reference number
|
| 484 |
+
const bookingRef = 'AS-' + Math.floor(100000 + Math.random() * 900000);
|
|
|
|
|
|
|
| 485 |
|
| 486 |
+
// Update confirmation modal fields
|
| 487 |
+
document.getElementById('bookingRef').textContent = bookingRef;
|
| 488 |
+
document.getElementById('confirmName').textContent = formData.name;
|
| 489 |
+
document.getElementById('confirmPhone').textContent = formData.phone;
|
| 490 |
+
document.getElementById('confirmVehicle').textContent = `${formData.make} ${formData.model} (${formData.reg})`;
|
| 491 |
+
document.getElementById('confirmService').textContent = formData.serviceType;
|
| 492 |
+
document.getElementById('confirmDate').textContent = new Date(formData.date).toLocaleDateString('en-ZA');
|
| 493 |
+
|
| 494 |
+
if (formData.courtesyCar) {
|
| 495 |
+
document.getElementById('confirmCarSection').classList.remove('hidden');
|
| 496 |
+
document.getElementById('confirmCar').textContent = document.querySelector('.courtesy-car-card.border-primary')?.querySelector('h5').textContent || 'Not specified';
|
| 497 |
+
} else {
|
| 498 |
+
document.getElementById('confirmCarSection').classList.add('hidden');
|
| 499 |
+
}
|
| 500 |
+
|
| 501 |
// Show confirmation modal
|
| 502 |
const confirmationModal = document.getElementById('confirmationModal');
|
| 503 |
confirmationModal.classList.remove('hidden');
|
|
|
|
| 509 |
card.classList.remove('border-primary', 'border-2');
|
| 510 |
card.querySelector('i').classList.add('hidden');
|
| 511 |
});
|
| 512 |
+
});
|
| 513 |
// Close confirmation modal
|
| 514 |
document.getElementById('closeConfirmation').addEventListener('click', function() {
|
| 515 |
const confirmationModal = document.getElementById('confirmationModal');
|
index.html
CHANGED
|
@@ -351,9 +351,40 @@
|
|
| 351 |
</div>
|
| 352 |
<h3 class="text-lg font-medium text-gray-900 mb-2">Booking Confirmed!</h3>
|
| 353 |
<div class="mt-2 text-sm text-gray-500 bg-gray-50 p-4 rounded-lg">
|
| 354 |
-
<
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 355 |
</div>
|
| 356 |
-
<p class="mt-3 text-sm text-gray-500">A confirmation email has been sent to your registered email address.</p>
|
| 357 |
<div class="mt-5">
|
| 358 |
<button id="closeConfirmation" type="button" class="inline-flex justify-center rounded-md border border-transparent shadow-sm px-4 py-2 bg-primary text-base font-medium text-white hover:bg-blue-800 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 sm:text-sm">
|
| 359 |
Close
|
|
@@ -450,24 +481,24 @@
|
|
| 450 |
alert('Please select a courtesy car or uncheck the courtesy car option');
|
| 451 |
return;
|
| 452 |
}
|
| 453 |
-
//
|
| 454 |
-
|
| 455 |
-
<h4 class="font-bold text-lg mb-2">Booking Confirmation</h4>
|
| 456 |
-
<div class="space-y-2 text-left">
|
| 457 |
-
<p><span class="font-medium">Name:</span> ${formData.name}</p>
|
| 458 |
-
<p><span class="font-medium">Phone:</span> ${formData.phone}</p>
|
| 459 |
-
<p><span class="font-medium">Email:</span> ${formData.email}</p>
|
| 460 |
-
<p><span class="font-medium">Vehicle:</span> ${formData.make} ${formData.model} (${formData.reg})</p>
|
| 461 |
-
<p><span class="font-medium">Service:</span> ${formData.serviceType}</p>
|
| 462 |
-
<p><span class="font-medium">Date:</span> ${formData.date}</p>
|
| 463 |
-
${formData.courtesyCar ? `<p><span class="font-medium">Courtesy Car:</span> ${document.querySelector('.courtesy-car-card.border-primary')?.querySelector('h5').textContent || 'Not specified'}</p>` : ''}
|
| 464 |
-
</div>
|
| 465 |
-
`;
|
| 466 |
-
|
| 467 |
-
// Update confirmation modal with booking details
|
| 468 |
-
document.getElementById('confirmationModal').querySelector('.text-sm').innerHTML = bookingDetails;
|
| 469 |
|
| 470 |
-
//
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 471 |
const confirmationModal = document.getElementById('confirmationModal');
|
| 472 |
confirmationModal.classList.remove('hidden');
|
| 473 |
|
|
|
|
| 351 |
</div>
|
| 352 |
<h3 class="text-lg font-medium text-gray-900 mb-2">Booking Confirmed!</h3>
|
| 353 |
<div class="mt-2 text-sm text-gray-500 bg-gray-50 p-4 rounded-lg">
|
| 354 |
+
<div class="space-y-2">
|
| 355 |
+
<div class="flex justify-between">
|
| 356 |
+
<span class="font-medium">Reference #:</span>
|
| 357 |
+
<span id="bookingRef"></span>
|
| 358 |
+
</div>
|
| 359 |
+
<div class="flex justify-between">
|
| 360 |
+
<span class="font-medium">Customer Name:</span>
|
| 361 |
+
<span id="confirmName"></span>
|
| 362 |
+
</div>
|
| 363 |
+
<div class="flex justify-between">
|
| 364 |
+
<span class="font-medium">Phone:</span>
|
| 365 |
+
<span id="confirmPhone"></span>
|
| 366 |
+
</div>
|
| 367 |
+
<div class="flex justify-between">
|
| 368 |
+
<span class="font-medium">Vehicle:</span>
|
| 369 |
+
<span id="confirmVehicle"></span>
|
| 370 |
+
</div>
|
| 371 |
+
<div class="flex justify-between">
|
| 372 |
+
<span class="font-medium">Service Type:</span>
|
| 373 |
+
<span id="confirmService"></span>
|
| 374 |
+
</div>
|
| 375 |
+
<div class="flex justify-between">
|
| 376 |
+
<span class="font-medium">Date:</span>
|
| 377 |
+
<span id="confirmDate"></span>
|
| 378 |
+
</div>
|
| 379 |
+
<div id="confirmCarSection" class="hidden">
|
| 380 |
+
<div class="flex justify-between">
|
| 381 |
+
<span class="font-medium">Courtesy Car:</span>
|
| 382 |
+
<span id="confirmCar"></span>
|
| 383 |
+
</div>
|
| 384 |
+
</div>
|
| 385 |
+
</div>
|
| 386 |
</div>
|
| 387 |
+
<p class="mt-3 text-sm text-gray-500">A confirmation email has been sent to your registered email address. Please bring this reference number when you visit us.</p>
|
| 388 |
<div class="mt-5">
|
| 389 |
<button id="closeConfirmation" type="button" class="inline-flex justify-center rounded-md border border-transparent shadow-sm px-4 py-2 bg-primary text-base font-medium text-white hover:bg-blue-800 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 sm:text-sm">
|
| 390 |
Close
|
|
|
|
| 481 |
alert('Please select a courtesy car or uncheck the courtesy car option');
|
| 482 |
return;
|
| 483 |
}
|
| 484 |
+
// Generate random reference number
|
| 485 |
+
const bookingRef = 'AS-' + Math.floor(100000 + Math.random() * 900000);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 486 |
|
| 487 |
+
// Update confirmation modal fields
|
| 488 |
+
document.getElementById('bookingRef').textContent = bookingRef;
|
| 489 |
+
document.getElementById('confirmName').textContent = formData.name;
|
| 490 |
+
document.getElementById('confirmPhone').textContent = formData.phone;
|
| 491 |
+
document.getElementById('confirmVehicle').textContent = `${formData.make} ${formData.model} (${formData.reg})`;
|
| 492 |
+
document.getElementById('confirmService').textContent = formData.serviceType;
|
| 493 |
+
document.getElementById('confirmDate').textContent = new Date(formData.date).toLocaleDateString('en-ZA');
|
| 494 |
+
|
| 495 |
+
if (formData.courtesyCar) {
|
| 496 |
+
document.getElementById('confirmCarSection').classList.remove('hidden');
|
| 497 |
+
document.getElementById('confirmCar').textContent = document.querySelector('.courtesy-car-card.border-primary')?.querySelector('h5').textContent || 'Not specified';
|
| 498 |
+
} else {
|
| 499 |
+
document.getElementById('confirmCarSection').classList.add('hidden');
|
| 500 |
+
}
|
| 501 |
+
// Show confirmation modal
|
| 502 |
const confirmationModal = document.getElementById('confirmationModal');
|
| 503 |
confirmationModal.classList.remove('hidden');
|
| 504 |
|