Sidebars
This commit is contained in:
@@ -103,7 +103,8 @@
|
||||
<?php endif; ?>
|
||||
</td>
|
||||
<td>
|
||||
<a href="/IMPORTADORES/administrador/aprobar_usuario?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; ?>
|
||||
@@ -123,14 +124,46 @@
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
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_usuario?id=${id}`;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function denegateRequest(id) {
|
||||
Swal.fire({
|
||||
title: '¿Estás seguro?',
|
||||
text: 'Se denegara la solicitud de registro del usuario.',
|
||||
icon: 'warning',
|
||||
showCancelButton: true,
|
||||
confirmButtonText: 'Sí, denegar',
|
||||
cancelButtonText: 'Cancelar'
|
||||
}).then((result) => {
|
||||
if (result.isConfirmed) {
|
||||
window.location.href = `/IMPORTADORES/administrador/denegar_usuario?id=${id}`;
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
||||
<?php if (isset($_GET['success'])): ?>
|
||||
<script>
|
||||
<?php if ($_GET['success'] === 'approved'): ?>
|
||||
Swal.fire({ icon: 'success', title: 'Usuario aprobado',
|
||||
text: 'El usuario ha sido aprobado correctamente y se ha enviado un correo con las credenciales.',
|
||||
confirmButtonColor: '#198754' });
|
||||
Swal.fire({ icon: 'success', title: 'Usuario aprobado', text: 'El usuario ha sido aprobado correctamente y se ha enviado un correo con las credenciales.', confirmButtonColor: '#198754' });
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ($_GET['success'] === 'denied'): ?>
|
||||
Swal.fire({ icon: 'success', title: 'Registro de Usuario denegado', text: 'La solicitud fue denegada.', confirmButtonColor: '#198754' });
|
||||
<?php endif; ?>
|
||||
</script>
|
||||
<?php endif; ?>
|
||||
|
||||
Reference in New Issue
Block a user