This commit is contained in:
2025-07-17 13:31:55 -06:00
parent 1960a52c36
commit 1900091b99
15 changed files with 2250 additions and 1292 deletions

View File

@@ -98,7 +98,7 @@
<td><?= htmlspecialchars(decrypt($ag['nombre_admin'] ?? '')) ?></td>
<td>
<?php if (isset($ag['activo']) && $ag['activo'] == 1): ?>
<a href="/IMPORTADORES/administrador/suspenderAgencia?id=<?= $ag['id_agencia'] ?>&success=1" class="btn btn-sm btn-danger mt-auto w-auto btn-animated">Suspender</a>
<a href="#" onclick="confirmSuspencion(<?= (int) ($ag['id_agencia'] ?? 0) ?>)" class="btn btn-sm btn-danger mt-auto w-auto btn-animated">Suspender</a>
<?php endif; ?>
</td>
</tr>
@@ -119,6 +119,21 @@
}
});
});
function confirmSuspencion(id) {
Swal.fire({
title: '¿Estás seguro?',
text: 'Solo se suspenderá el perfil del usuario.',
icon: 'warning',
showCancelButton: true,
confirmButtonText: 'Sí, suspender',
cancelButtonText: 'Cancelar'
}).then((result) => {
if (result.isConfirmed) {
window.location.href = `/IMPORTADORES/administrador/suspenderAgencia?id=${id}`;
}
});
}
</script>
<?php if (isset($_GET['success'])): ?>