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

@@ -10,6 +10,9 @@
<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>
<style>
table.dataTable thead th { background: #343a40; color: #fff; }
@@ -86,6 +89,7 @@
<div class="content">
<h4>🚛 Mis Choferes</h4>
<a href="/IMPORTADORES/choferes/crear" class="btn btn-success mb-3"> Nuevo Chofer</a>
<div class="table-responsive">
<table class="table table-striped" id="tabla-choferes">
<thead>
<tr>
@@ -126,6 +130,7 @@
</tbody>
</table>
</div>
</div>
<script>
function confirmDeleteChofer(id) {
@@ -143,6 +148,15 @@
}
});
}
$(document).ready(function () {
$('#tabla-choferes').DataTable({
language: {
url: '//cdn.datatables.net/plug-ins/1.13.4/i18n/es-ES.json'
}
});
});
<?php if(isset($_GET['deleted'])): ?>
Swal.fire('¡Hecho!','Chofer eliminado.','success');
<?php endif; ?>

View File

@@ -7,8 +7,7 @@ header("X-Frame-Options: DENY");
header("X-Content-Type-Options: nosniff");
header("X-XSS-Protection: 1; mode=block");
header("Referrer-Policy: no-referrer");
header("Content-Security-Policy: default-src 'self'; style-src 'self' 'unsafe-inline' https://cdn.jsdelivr.net https://cdnjs.cloudflare.com; script-src 'self' https://cdn.jsdelivr.net https://cdnjs.cloudflare.com; img-src 'self' data:;");
header("Content-Security-Policy: default-src 'self'; style-src 'self' 'unsafe-inline' https://cdn.jsdelivr.net https://cdnjs.cloudflare.com https://fonts.googleapis.com; script-src 'self' https://cdn.jsdelivr.net https://cdnjs.cloudflare.com; img-src 'self' data:; font-src 'self' https://fonts.gstatic.com https://cdnjs.cloudflare.com;");
$sql = "SELECT TOP 1 * FROM configuracion_sistema";
$stmt = sqlsrv_prepare($conn, $sql);
if (!$stmt || !sqlsrv_execute($stmt)) {

View File

@@ -116,11 +116,11 @@ $mensajeMantenimiento = $config['mensaje_mantenimiento'] ?? 'El sistema se encue
<form action="/IMPORTADORES/login/validar" method="POST">
<div class="mb-3">
<label class="form-label">Correo electrónico</label>
<input type="email" name="email" class="form-control" required>
<input type="email" name="email" class="form-control" required autocomplete="username" value="">
</div>
<div class="mb-3">
<label class="form-label">Contraseña</label>
<input type="password" name="password" class="form-control" required>
<input type="password" name="password" class="form-control" required autocomplete="current-password" value="">
</div>
<div class="d-grid">
<button type="submit" class="btn btn-primary">Iniciar sesión</button>

View File

@@ -8,6 +8,9 @@
<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>
<style>
table.dataTable thead th { background: #343a40; color: #fff; }
body { font-family: 'Segoe UI', sans-serif; background-color: #f4f6f9; }
@@ -79,6 +82,7 @@
<div class="content">
<h4>📄 Solicitudes de Importación</h4>
<a href="/IMPORTADORES/solicitud_importacion/crear" class="btn btn-success mb-3"> Nueva Solicitud</a>
<div class="table-responsive">
<table class="table table-striped" id="tabla-solicitudes">
<thead>
<tr>
@@ -134,6 +138,7 @@
</tbody>
</table>
</div>
</div>
<script>
function confirmDelete(id) {
@@ -151,6 +156,15 @@
}
});
}
$(document).ready(function () {
$('#tabla-solicitudes').DataTable({
language: {
url: '//cdn.datatables.net/plug-ins/1.13.4/i18n/es-ES.json'
}
});
});
<?php if(isset($_GET['deleted'])): ?>
Swal.fire('¡Hecho!','Solicitud eliminada.','success');
<?php endif; ?>

View File

@@ -9,6 +9,8 @@
<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>
<style>
table.dataTable thead th { background:#343a40; color:#fff; }
@@ -86,7 +88,8 @@
<div class="content">
<h4>🚚 Mis Transportes</h4>
<a href="/IMPORTADORES/transportes/crear" class="btn btn-success mb-3"> Nuevo Transporte</a>
<table class="table table-striped">
<div class="table-responsive">
<table class="table table-striped" id="tabla-transportes">
<thead>
<tr>
<th>#</th><th>Vehículo</th><th>Ident. Fiscal</th>
@@ -120,6 +123,7 @@
</tbody>
</table>
</div>
</div>
<script>
function confirmDelete(id) {
@@ -137,6 +141,15 @@
}
});
}
$(document).ready(function () {
$('#tabla-transportes').DataTable({
language: {
url: '//cdn.datatables.net/plug-ins/1.13.4/i18n/es-ES.json'
}
});
});
<?php if(isset($_GET['deleted'])): ?>
Swal.fire('¡Hecho!','Transporte eliminado.','success');
<?php endif; ?>

View File

@@ -2,10 +2,11 @@
<?php
// Al principio de la vista, inicia sesión para leer los errores
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,6 +92,7 @@
<br>
<h4 class="mb-4">🚚 Mis Transportistas</h4>
<div class="card p-3 shadow-sm">
<div class="table-responsive">
<table id="transportistas-table" class="display nowrap" style="width:100%">
<thead>
<tr>
@@ -107,6 +108,7 @@
</table>
</div>
</div>
</div>
<!-- jQuery -->
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
@@ -153,8 +155,6 @@
});
});
function confirmDelete(id) {
Swal.fire({
title: '¿Eliminar transportista?',
@@ -181,7 +181,6 @@ Swal.fire({
});
<?php endif; ?>
</script>