File "noProgramado.php.bak"

Full Path: C:/wamp64/www/porteria/Vehiculos/noProgramado.php.bak
File size: 9.89 KB
MIME-type: text/x-php
Charset: utf-8

<?php 
include("connection.php");
$con = connection();
$estado = '0';
$sql = "SELECT * FROM vehiculos WHERE ESTADO='$estado' ORDER BY REG DESC";
$query = mysqli_query($con, $sql);
$count = mysqli_num_rows($query);
?>
<!DOCTYPE html>
<html lang="es">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="description" content="Vehículos pendientes por dar salida">
    <meta name="keywords" content="html, css, bases de datos, php">
    <meta name="author" content="Sebastian Obando">
    <meta name="copyright" content="Sebastian Obando">
    <meta name="google" content="notranslate">
    <title>Vehículos Pendientes Por Cerrar Planilla </title>
    <link rel="icon" type="image/png" href="../img/icono.png">

    <!-- Carga de jQuery y DataTables -->
    <script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
    <script src="https://cdn.datatables.net/1.11.5/js/jquery.dataTables.js"></script>
    <link rel="stylesheet" href="https://cdn.datatables.net/1.11.5/css/jquery.dataTables.css">
    <style>
        body {
            font-family: Arial, sans-serif;
            margin: 0;
            padding: 20px;
            background-color: #f5f5f5;
        }
        .container {
            max-width: 1400px;
            margin: 0 auto;
            background-color: white;
            padding: 20px;
            border-radius: 8px;
            box-shadow: 0 0 10px rgba(0,0,0,0.1);
        }
        .header {
            background-color: #f8f9fa;
            padding: 20px;
            border-radius: 5px;
            margin-bottom: 20px;
            box-shadow: 0 2px 4px rgba(0,0,0,0.1);
            display: flex;
            justify-content: space-between;
            align-items: center;
        }
        .header h2 {
            margin: 0;
            color: #333;
        }
        .button-container {
            margin: 15px 0;
        }
        .button-container input[type="button"] {
            padding: 8px 15px;
            margin-right: 10px;
            cursor: pointer;
            background-color: coral;
            color: white;
            border: none;
            border-radius: 4px;
            transition: background-color 0.3s;
        }
        .button-container input[type="button"]:hover {
            background-color: coral;
        }
        .users-table {
            width: 100%;
            overflow-x: auto;
            margin-bottom: 20px;
        }
        table.display {
            width: 100%;
            border-collapse: collapse;
        }
        table.display th, table.display td {
            padding: 12px 8px;
            text-align: left;
            border: 1px solid #ddd;
        }
        table.display th {
            background-color: #f2f2f2;
            font-weight: bold;
        }
        table.display tr:nth-child(even) {
            background-color: #f9f9f9;
        }
        table.display tr:hover {
            background-color: #f1f1f1;
        }
        .btn-salida {
            background-color: coral;
            border: 1px solid coral;
            color: white;
            padding: 8px 12px;
            cursor: pointer;
            border-radius: 4px;
            transition: all 0.3s ease;
            text-decoration: none;
            display: inline-block;
            text-align: center;
        }
        .btn-salida:hover {
            background-color: #ff6347;
            transform: scale(1.05);
        }
        .no-records {
            padding: 20px;
            background-color: #d1ecf1;
            color: #0c5460;
            border-radius: 5px;
            text-align: center;
            margin-top: 20px;
        }
        .copyright {
            text-align: center;
            margin-top: 30px;
            color: #666;
            font-size: 14px;
            padding: 10px;
        }
        .refresh-btn {
            background-color: #007bff;
            color: white;
            border: none;
            padding: 8px 15px;
            border-radius: 4px;
            cursor: pointer;
            margin-left: 10px;
            transition: background-color 0.3s;
        }
        .refresh-btn:hover {
            background-color: #0069d9;
        }
        .status-indicator {
            display: inline-block;
            width: 12px;
            height: 12px;
            border-radius: 50%;
            background-color: #dc3545;
            margin-right: 8px;
            animation: pulse 1.5s infinite;
        }
        @keyframes pulse {
            0% { transform: scale(0.95); }
            50% { transform: scale(1.1); }
            100% { transform: scale(0.95); }
        }
        .status-text {
            font-weight: bold;
            color: #dc3545;
        }
        .header-info {
            display: flex;
            align-items: center;
        }
        .badge {
            display: inline-block;
            padding: 3px 7px;
            font-size: 12px;
            font-weight: bold;
            line-height: 1;
            color: #fff;
            text-align: center;
            white-space: nowrap;
            vertical-align: middle;
            background-color: #6c757d;
            border-radius: 10px;
            margin-left: 5px;
        }
    </style>
</head>
<body>
    <div class="container">
        <div class="header">
            <div class="header-info">
                <h2>Vehículos Pendientes Por Cerrar Planilla</h2>
                <span class="status-indicator"></span>
                <span class="status-text">
                    <?= $count ?> <?= ($count == 1 ? 'registro pendiente' : 'registros pendientes') ?>
                </span>
            </div>
            <button class="refresh-btn" onclick="location.reload()">
                <i class="fas fa-sync-alt"></i> Actualizar
            </button>
        </div>
        
        <div class="button-container">
            <input type="button" onclick="window.location.href='../index.php';" value="Menú Principal">
            <input type="button" onclick="window.location.href='generarExcelVehiculo.php';" value="Generar Excel">
        </div>
        
        <?php if($count > 0): ?>
            <div class="users-table">
                <div style="overflow-x: auto;">
                    <table id="tablaVehiculos" class="display">
                        <thead>
                            <tr>
                                <th>ID</th>
                                <th>Fecha</th>
                                <th>Conductor</th>
                                <th>Placa</th>
                                <th>Grupo</th>
                                <th>Hora Llegada</th>
                                <th>Canastas Ent</th>
                                <th>KM Entrada</th>
                                <th>Observaciones</th>
                                <th>Acción</th>
                            </tr>
                        </thead>
                        <tbody>
                            <?php while ($row = mysqli_fetch_array($query)): ?>
                                <tr>
                                    <td><?= $row['REG'] ?></td>
                                    <td><?= $row['FECHA'] ?></td>
                                    <td><?= $row['CONDUCTOR'] ?></td>
                                    <td><?= $row['PLACA'] ?></td>
                                    <td><?= $row['GRUPO'] ?></td>
                                    <td><?= $row['HORAL'] ?></td>
                                    <td><?= $row['CANASTAASENT'] ?></td>
                                    <td><?= $row['KILOMETRAJEENT'] ?></td>
                                    <td><?= $row['OBSERVACIONES'] ?></td>
                                    <td>
                                        <a href="Salida.php?REG=<?= $row['REG'] ?>" class="btn-salida">
                                            Cerrar Planilla
                                        </a>
                                    </td>
                                </tr>
                            <?php endwhile; ?>
                        </tbody>
                    </table>
                </div>
            </div>
        <?php else: ?>
            <div class="no-records">
                <h3>¡No hay vehículos pendientes por salida!</h3>
                <p>Todos los vehículos han registrado su salida correctamente.</p>
            </div>
        <?php endif; ?>
    </div>

    <!-- Script para inicializar DataTables -->
    <script>
        $(document).ready(function () {
            $('#tablaVehiculos').DataTable({
                "paging": true,
                "lengthMenu": [[10, 25, 50, -1], [10, 25, 50, "Todos"]],
                "searching": true,
                "language": {
                    "url": "//cdn.datatables.net/plug-ins/1.11.5/i18n/Spanish.json"
                },
                "order": [[0, 'desc']],
                "autoWidth": false,
                "responsive": true,
                "columnDefs": [
                    { "width": "5%", "targets": 0 },
                    { "width": "8%", "targets": 1 },
                    { "width": "15%", "targets": 2 },
                    { "width": "5%", "targets": 3 },
                    { "width": "5%", "targets": 4 },
                    { "width": "5%", "targets": 5 },
                    { "width": "5%", "targets": 6 },
                    { "width": "5%", "targets": 7 },
                    { "width": "20%", "targets": 8 },
                    { "width": "10%", "targets": 9 }
                ]
            });
        });
    </script>
    
    <!-- CopyRight-->
    <div class="copyright">
        &#169; <?= date('Y') ?> Avicampo
    </div>
</body>
</html>