Cambios
This commit is contained in:
@@ -98,9 +98,9 @@
|
||||
<td><?= $ag['creado_en'] ? $ag['creado_en']->format('Y-m-d H:i') : '' ?></td>
|
||||
<td>
|
||||
<?php if (!empty($ag['estado_solicitud']) && $ag['estado_solicitud'] === 'PENDIENTE'): ?>
|
||||
<a href="/IMPORTADORES/importadores/cancelarVinculacion?id=<?= $ag['id_agencia'] ?>" class="btn btn-sm btn-danger mt-auto w-auto btn-animated">Cancelar solicitud</a>
|
||||
<button onclick="confirmCancelRequest(<?= $ag['id_agencia'] ?>)" class="btn btn-sm btn-danger mt-auto w-auto btn-animated">Cancelar solicitud</button>
|
||||
<?php else: ?>
|
||||
<a href="/IMPORTADORES/importadores/vincular?id=<?= $ag['id_agencia'] ?>" class="btn btn-sm btn-success mt-auto w-auto btn-animated">Vincular</a>
|
||||
<button onclick="confirmLinkAgency(<?= $ag['id_agencia'] ?>)" class="btn btn-sm btn-success mt-auto w-auto btn-animated">Vincular</button>
|
||||
<?php endif; ?>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -121,6 +121,36 @@
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
function confirmLinkAgency(id) {
|
||||
Swal.fire({
|
||||
title: '¿Quieres vincularte a esta agencia?',
|
||||
text: 'Podrás usarla para tus operaciones.',
|
||||
icon: 'warning',
|
||||
showCancelButton: true,
|
||||
confirmButtonText: 'Sí, vincularme',
|
||||
cancelButtonText: 'Cancelar'
|
||||
}).then((result) => {
|
||||
if (result.isConfirmed) {
|
||||
window.location.href = `/IMPORTADORES/importadores/vincular?id=${id}`;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function confirmCancelRequest(id) {
|
||||
Swal.fire({
|
||||
title: '¿Quieres cancelar la solicitud?',
|
||||
text: 'Esta acción no se puede deshacer.',
|
||||
icon: 'warning',
|
||||
showCancelButton: true,
|
||||
confirmButtonText: 'Sí, cancelar solicitud',
|
||||
cancelButtonText: 'Cancelar'
|
||||
}).then((result) => {
|
||||
if (result.isConfirmed) {
|
||||
window.location.href = `/IMPORTADORES/importadores/cancelarVinculacion?id=${id}`;
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
||||
<?php if (isset($_GET['success'])): ?>
|
||||
|
||||
Reference in New Issue
Block a user