Update lugar.php

This commit is contained in:
Lizandro Guarnizo
2026-04-21 20:59:02 -05:00
parent 1720a34ead
commit f485c0abf3
+14
View File
@@ -748,6 +748,20 @@ function actualizarEstadoBadge(estado) {
const [cls, lbl] = mapa[estado] || ['bg-secondary-subtle text-secondary border', estado];
el.className = 'ms-auto badge ' + cls;
el.textContent = lbl;
// Sincronizar botones según estado
const btnIni = document.getElementById('btn-iniciar');
const btnFin = document.getElementById('btn-finalizar');
const btnReg = document.getElementById('btn-regresar');
if (estado === 'en_espera_lugar') {
btnIni.classList.remove('d-none'); btnIni.disabled = hayPendientes;
btnFin.classList.add('d-none');
btnReg.classList.add('d-none');
} else if (estado === 'en_servicio') {
btnIni.classList.add('d-none');
btnFin.classList.remove('d-none');
btnReg.classList.remove('d-none');
}
}
function escHtml(str) {