Apr 06 2026: enhanced - update the dynamic QR code

This commit is contained in:
2026-04-06 09:28:58 -04:00
parent 28bcd13c7f
commit f9aa07716b
12 changed files with 727 additions and 74 deletions
+22
View File
@@ -238,6 +238,18 @@ function proceedWithCheckin() {
return;
}
// ADDED: For dynamic QR codes, require a location to be selected before proceeding
var selLocField = document.getElementById("selected_location_name");
var locationSelectCard = document.getElementById("locationSelectCard");
if (locationSelectCard && selLocField && !selLocField.value.trim()) {
// No location selected — redirect employee back to Step 1
document.getElementById("checkinFormCard").style.display = "none";
locationSelectCard.style.display = "block";
showLocalizedStatusMessage("invalidId", "error");
console.log("❌ Dynamic QR: no location selected, returning to Step 1");
return;
}
const employeeId = document.getElementById("employee_id")?.value?.trim();
if (!employeeId) {
@@ -309,6 +321,16 @@ function submitCheckin() {
formData.append("location_source", userLocation.source || "manual");
formData.append("address", userLocation.address || "");
// ADDED: Forward the employee-selected location for dynamic QR check-in
const selLocName = document.getElementById("selected_location_name");
const selLocAddr = document.getElementById("selected_location_address");
if (selLocName && selLocName.value.trim()) {
formData.append("selected_location_name", selLocName.value.trim());
}
if (selLocAddr && selLocAddr.value.trim()) {
formData.append("selected_location_address", selLocAddr.value.trim());
}
const currentUrl = window.location.pathname;
const checkinUrl = `${currentUrl}/checkin`;