Update lugar.php
This commit is contained in:
@@ -748,6 +748,20 @@ function actualizarEstadoBadge(estado) {
|
|||||||
const [cls, lbl] = mapa[estado] || ['bg-secondary-subtle text-secondary border', estado];
|
const [cls, lbl] = mapa[estado] || ['bg-secondary-subtle text-secondary border', estado];
|
||||||
el.className = 'ms-auto badge ' + cls;
|
el.className = 'ms-auto badge ' + cls;
|
||||||
el.textContent = lbl;
|
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) {
|
function escHtml(str) {
|
||||||
|
|||||||
Reference in New Issue
Block a user