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

@@ -89,7 +89,7 @@
<td><?= htmlspecialchars($v['telefono']) ?></td>
<td><?= isset($v['fecha_vinculacion']) && $v['fecha_vinculacion'] instanceof DateTime ? $v['fecha_vinculacion']->format('Y-m-d H:i') : '' ?></td>
<td>
<a href="/IMPORTADORES/agentes/desvincularAgente?id=<?= $v['id_relacion'] ?>" class="btn btn-sm btn-danger mt-auto w-auto btn-animated">Desvincular</a>
<a href="#" onclick="confirmUnlink(<?= $v['id_relacion'] ?>)" class="btn btn-sm btn-danger mt-auto w-auto btn-animated">Desvincular</a>
</td>
</tr>
<?php endforeach; ?>
@@ -108,6 +108,21 @@
}
});
});
function confirmUnlink(id) {
Swal.fire({
title: '¿Estás seguro?',
text: 'Esta acción no se puede deshacer.',
icon: 'warning',
showCancelButton: true,
confirmButtonText: 'Sí, desvincular',
cancelButtonText: 'Cancelar'
}).then((result) => {
if (result.isConfirmed) {
window.location.href = `/IMPORTADORES/agentes/desvincularAgente?id=${id}`;
}
});
}
</script>
<?php if (isset($_GET['success'])): ?>