Responsividad de tablas

This commit is contained in:
2025-05-13 08:06:54 -06:00
parent 3a9b7fa520
commit 01929847c0
7 changed files with 208 additions and 168 deletions

View File

@@ -2,10 +2,11 @@
<?php
// Al principio de la vista, inicia sesión para leer los errores
session_start();
if (session_status() === PHP_SESSION_NONE) {
session_start();
}
$errors = $_SESSION['import_errors'] ?? [];
$success = $_SESSION['import_success'] ?? false;
// Limpiar para que no se repitan
unset($_SESSION['import_errors'], $_SESSION['import_success']);
?>

View File

@@ -92,19 +92,21 @@
<br>
<h4 class="mb-4">🚚 Mis Transportistas</h4>
<div class="card p-3 shadow-sm">
<table id="transportistas-table" class="display nowrap" style="width:100%">
<thead>
<tr>
<th>#</th>
<th>Clave</th>
<th>Nombre</th>
<th>RFC</th>
<th>Ciudad</th>
<th>Fecha Alta</th>
<th>Acciones</th>
</tr>
</thead>
</table>
<div class="table-responsive">
<table id="transportistas-table" class="display nowrap" style="width:100%">
<thead>
<tr>
<th>#</th>
<th>Clave</th>
<th>Nombre</th>
<th>RFC</th>
<th>Ciudad</th>
<th>Fecha Alta</th>
<th>Acciones</th>
</tr>
</thead>
</table>
</div>
</div>
</div>
@@ -153,34 +155,31 @@
});
});
function confirmDelete(id) {
Swal.fire({
title: '¿Eliminar transportista?',
text: 'Esto sólo lo desactivará; no se podrá volver a usar.',
icon: 'warning',
showCancelButton: true,
confirmButtonText: 'Sí, eliminar',
cancelButtonText: 'Cancelar',
confirmButtonColor: '#d33'
}).then(result => {
if (result.isConfirmed) {
window.location = `/IMPORTADORES/transportistas/eliminar?id=${id}`;
Swal.fire({
title: '¿Eliminar transportista?',
text: 'Esto sólo lo desactivará; no se podrá volver a usar.',
icon: 'warning',
showCancelButton: true,
confirmButtonText: 'Sí, eliminar',
cancelButtonText: 'Cancelar',
confirmButtonColor: '#d33'
}).then(result => {
if (result.isConfirmed) {
window.location = `/IMPORTADORES/transportistas/eliminar?id=${id}`;
}
});
}
});
}
// Mostrar alert de “borrado” al volver de la acción
<?php if (isset($_GET['deleted']) && $_GET['deleted']==='ok'): ?>
Swal.fire({
icon: 'success',
title: 'Transportista eliminado',
text: 'Ya no aparecerá en tu lista.',
confirmButtonColor: '#198754'
});
<?php endif; ?>
// Mostrar alert de “borrado” al volver de la acción
<?php if (isset($_GET['deleted']) && $_GET['deleted']==='ok'): ?>
Swal.fire({
icon: 'success',
title: 'Transportista eliminado',
text: 'Ya no aparecerá en tu lista.',
confirmButtonColor: '#198754'
});
<?php endif; ?>
</script>