CORRECCIONES - ALTA DE AGENCIAS - ADMINISTRADOR
This commit is contained in:
@@ -124,7 +124,7 @@
|
||||
<?php if (isset($_GET['success'])): ?>
|
||||
<script>
|
||||
<?php if ($_GET['success'] === 'status_deactivated'): ?>
|
||||
Swal.fire({ icon: 'success', title: 'Usuario desactivado', text: 'El usuario ha sido desactivado correctamente.', confirmButtonColor: '#198754' });
|
||||
Swal.fire({ icon: 'success', title: 'Agencia desactivada', text: 'La agencia ha sido desactivada correctamente.', confirmButtonColor: '#198754' });
|
||||
<?php endif; ?>
|
||||
</script>
|
||||
<?php endif; ?>
|
||||
@@ -134,11 +134,11 @@
|
||||
<?php if ($_GET['error'] === 'unauthorized'): ?>
|
||||
Swal.fire({ icon: 'error', title: 'No autorizado', text: 'No tienes permisos para realizar esta acción.', confirmButtonColor: '#dc3545' });
|
||||
<?php elseif ($_GET['error'] === 'invalid_id'): ?>
|
||||
Swal.fire({ icon: 'error', title: 'ID inválido', text: 'El identificador del usuario no es válido.', confirmButtonColor: '#dc3545' });
|
||||
Swal.fire({ icon: 'error', title: 'ID inválido', text: 'El identificador de la agencia no es válido.', confirmButtonColor: '#dc3545' });
|
||||
<?php elseif ($_GET['error'] === 'agencia_not_found'): ?>
|
||||
Swal.fire({ icon: 'error', title: 'Usuario no encontrado', text: 'No se encontró el usuario especificado.', confirmButtonColor: '#dc3545' });
|
||||
Swal.fire({ icon: 'error', title: 'Agencia no encontrada', text: 'No se encontró la agencia especificada.', confirmButtonColor: '#dc3545' });
|
||||
<?php elseif ($_GET['error'] === 'update_failed'): ?>
|
||||
Swal.fire({ icon: 'error', title: 'Error al actualizar', text: 'No se pudo actualizar el estado del usuario.', confirmButtonColor: '#dc3545' });
|
||||
Swal.fire({ icon: 'error', title: 'Error al actualizar', text: 'No se pudo actualizar el estado de la agencia.', confirmButtonColor: '#dc3545' });
|
||||
<?php endif; ?>
|
||||
</script>
|
||||
<?php endif; ?>
|
||||
|
||||
@@ -199,7 +199,7 @@
|
||||
</div>
|
||||
|
||||
<script>
|
||||
// Registro de Agencia
|
||||
// Registro de Agencia
|
||||
document.getElementById('formAltaAgencias').addEventListener('submit', function(e) {
|
||||
e.preventDefault();
|
||||
|
||||
@@ -280,7 +280,17 @@
|
||||
}
|
||||
// Si todas las validaciones pasan, el formulario se envía.
|
||||
this.submit();
|
||||
|
||||
// Validación del formulario
|
||||
let isValid = true;
|
||||
inputs.forEach(input => {
|
||||
if (!input.checkValidity()) {
|
||||
input.classList.add('shake');
|
||||
isValid = false;
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
// Script para manejar las animaciones de validación
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
const inputs = document.querySelectorAll('.form-control');
|
||||
@@ -304,30 +314,6 @@
|
||||
}, 500);
|
||||
});
|
||||
});
|
||||
|
||||
// Validación del formulario
|
||||
document.getElementById('formAltaAgencias').addEventListener('submit', function(e) {
|
||||
e.preventDefault();
|
||||
|
||||
let isValid = true;
|
||||
inputs.forEach(input => {
|
||||
if (!input.checkValidity()) {
|
||||
input.classList.add('shake');
|
||||
isValid = false;
|
||||
}
|
||||
});
|
||||
|
||||
if (isValid) {
|
||||
// Aquí puedes agregar tu lógica de envío
|
||||
Swal.fire({
|
||||
icon: 'success',
|
||||
title: '¡Éxito!',
|
||||
text: 'Agencia registrada correctamente',
|
||||
showConfirmButton: false,
|
||||
timer: 1500
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
@@ -335,7 +321,7 @@
|
||||
<script>
|
||||
<?php if ($_GET['success'] === 'created'): ?>
|
||||
Swal.fire({ icon: 'success', title: 'Agencia registrada',
|
||||
text: 'La agencia adunal se ha registrada correctamente y se ha enviado un correo con las credenciales de acceso al administrador.',
|
||||
text: 'La agencia aduanal se ha registrada correctamente y se ha enviado un correo con las credenciales de acceso al administrador.',
|
||||
confirmButtonColor: '#198754' });
|
||||
<?php endif; ?>
|
||||
</script>
|
||||
|
||||
@@ -8,6 +8,10 @@
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet">
|
||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js"></script>
|
||||
<link href="https://cdn.datatables.net/1.13.4/css/jquery.dataTables.min.css" rel="stylesheet">
|
||||
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script>
|
||||
<script src="https://code.jquery.com/jquery-3.7.0.min.js"></script>
|
||||
<script src="https://cdn.datatables.net/1.13.4/js/jquery.dataTables.min.js"></script>
|
||||
<!-- Font Awesome -->
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css">
|
||||
<!-- Animate.css para animaciones adicionales -->
|
||||
@@ -35,8 +39,8 @@
|
||||
.card-hover:hover { transform: translateY(-8px) scale(1.02); box-shadow: 0 1rem 2rem rgba(0, 0, 0, 0.15) !important; }
|
||||
.btn-pulse { animation: pulse 2s infinite; }
|
||||
@keyframes pulse {
|
||||
0% { transform: scale(1); }
|
||||
50% { transform: scale(1.05); }
|
||||
0% { transform: scale(1); }
|
||||
50% { transform: scale(1.05); }
|
||||
100% { transform: scale(1); }
|
||||
}
|
||||
.fade-in-up { animation: fadeInUp 0.8s ease-out; }
|
||||
@@ -106,16 +110,23 @@
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
<?php else: ?>
|
||||
<tr>
|
||||
<td colspan="8" class="text-center">No hay agencias registradas aún.</td>
|
||||
</tr>
|
||||
<?php endif; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
$(document).ready(function () {
|
||||
$('#tabla-agencias-pendientes').DataTable({
|
||||
order: [],
|
||||
language: {
|
||||
url: 'https://cdn.datatables.net/plug-ins/1.13.4/i18n/es-ES.json'
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user