Sidebars
This commit is contained in:
@@ -106,7 +106,8 @@
|
||||
<?php endif; ?>
|
||||
</td>
|
||||
<td>
|
||||
<a href="/IMPORTADORES/administrador/aprobar_agencia?id=<?= $s['request_id'] ?>" class="btn btn-sm btn-success mt-auto w-auto btn-animated">Aprobar</a>
|
||||
<a href="#" onclick="confirmAprobacion(<?= $s['request_id'] ?>)" class="btn btn-sm btn-success mt-auto w-auto btn-animated">Aprobar</a>
|
||||
<a href="#" onclick="denegateRequest(<?= $s['request_id'] ?>)" class="btn btn-sm btn-danger mt-auto w-auto btn-animated">Denegar</a>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
@@ -117,6 +118,14 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php if (isset($_GET['success'])): ?>
|
||||
<script>
|
||||
<?php if ($_GET['success'] === 'denied'): ?>
|
||||
Swal.fire({ icon: 'success', title: 'Registro de Agencia denegado', text: 'La solicitud fue denegada.', confirmButtonColor: '#198754' });
|
||||
<?php endif; ?>
|
||||
</script>
|
||||
<?php endif; ?>
|
||||
|
||||
<script>
|
||||
$(document).ready(function () {
|
||||
$('#tabla-agencias-pendientes').DataTable({
|
||||
@@ -126,6 +135,36 @@
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
function confirmAprobacion(id) {
|
||||
Swal.fire({
|
||||
title: '¿Estás seguro?',
|
||||
text: 'Se creará el perfil y se notificará al usuario.',
|
||||
icon: 'warning',
|
||||
showCancelButton: true,
|
||||
confirmButtonText: 'Sí, aprobar',
|
||||
cancelButtonText: 'Cancelar'
|
||||
}).then((result) => {
|
||||
if (result.isConfirmed) {
|
||||
window.location.href = `/IMPORTADORES/administrador/aprobar_agencia?id=${id}`;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function denegateRequest(id) {
|
||||
Swal.fire({
|
||||
title: '¿Estás seguro?',
|
||||
text: 'Se denegara la solicitud de registro de la agencia.',
|
||||
icon: 'warning',
|
||||
showCancelButton: true,
|
||||
confirmButtonText: 'Sí, denegar',
|
||||
cancelButtonText: 'Cancelar'
|
||||
}).then((result) => {
|
||||
if (result.isConfirmed) {
|
||||
window.location.href = `/IMPORTADORES/administrador/denegar_agencia?id=${id}`;
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
||||
<?php if (isset($_GET['error'])): ?>
|
||||
|
||||
Reference in New Issue
Block a user