<!DOCTYPE html>
<html lang="es">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
 
    <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css">
    <link href="https://fonts.googleapis.com/css2?family=Poppins:wght@300;500&display=swap" rel="stylesheet">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.3/css/all.min.css">
    <style>
        /* Fondo con gradiente y ajuste general */
        body {
            font-family: 'Poppins', sans-serif;
            background-image: linear-gradient(to right, #ffecd2, #fcb69f);
            background-size: cover;
            background-attachment: fixed;
            color: #333;
        }
        /* Estilos del contenedor principal */
        .container {
            background-color: #ffffffcc;
            border-radius: 15px;
            padding: 30px;
            box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
            margin-top: 50px;
            animation: fadeIn 1s ease-in-out;
            backdrop-filter: blur(5px);
        }
        /* Campos de entrada con transparencia */
        .form-control, .input-group-text {
            background-color: #ffffffcc;
            border-radius: 8px;
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
            border: 1px solid #ddd;
            transition: transform 0.3s, box-shadow 0.3s;
        }
        .form-control:focus {
            box-shadow: 0 0 10px rgba(50, 150, 250, 0.5);
            transform: scale(1.02);
            outline: none;
        }
        .input-group-text i {
            color: #007bff;
        }
        /* Título con icono y emoji */
        .title-icon {
            color: #ff6f61;
            font-size: 1.5rem;
            vertical-align: middle;
            margin-right: 5px;
        }
        .table-title {
            font-weight: bold;
            font-size: 1.5rem;
            color: #007bff;
            text-align: center;
            margin-bottom: 15px;
        }
        /* Estilos de la tabla */
        .table {
            background-color: #ffffffcc;
            border-radius: 8px;
            overflow: hidden;
        }
        .table thead {
            background-color: #007bff;
            color: white;
        }
        .table tbody tr:hover {
            background-color: #e3f2fd;
            transition: background-color 0.3s;
        }
        .table td, .table th {
            text-align: center;
            padding: 10px;
            position: relative;
        }
        /* Microinteracción en hover para celdas */
        .table td:hover::after {
            content: "👀";
            font-size: 1.2em;
            position: absolute;
            right: 10px;
            color: #007bff;
        }
        /* Scroll horizontal para tablas grandes */
        .scroll {
            overflow-x: auto;
        }
        /* Animación de entrada */
        @keyframes fadeIn {
            from { opacity: 0; }
            to { opacity: 1; }
        }
    </style>
</head>
<body>
<div class="container">
   
    <div class="row">
        <div class="col">
            <?php
                date_default_timezone_set("America/Lima"); 
                include 'conexion1.php';

                if(!empty($_GET["columna"])) { $designa1 = $_GET["columna"]; }
                if(!empty($_GET["buscarfecha"])) { $columna2 = $_GET["buscarfecha"]; }
                if(!empty($_GET["codigo"])) { $columna2 = $_GET["codigo"]; }

                $conectar = mysqli_connect($servidor, $nombre, $clave, $base);
                $sql = "SELECT * FROM almacen WHERE $designa1='$columna2'";
                $result = mysqli_query($conectar, $sql);
            ?>
            <!-- Tabla de resultados -->
            <div class="scroll">
                <table class="table table-striped table-bordered table-hover">
                    <thead>
                        <tr>
                            <th>ID</th>
                            <th>FECHA_REGISTRO</th>
                            <th>HORA_REGISTRO</th>
                            <th>CÓDIGO</th>
                            <th>MEDIDA</th>
                            <th>DESCRIPCIÓN</th>
                            <th>STOCK</th>
                        </tr>
                    </thead>
                    <tbody>
                        <?php while ($mostrar = mysqli_fetch_array($result)) { ?>
                        <tr>
                            <td><?php echo $mostrar["ID"]; ?></td>
                            <td><?php echo $mostrar["FECHA_REGISTRO"]; ?></td>
                            <td><?php echo $mostrar["HORA_REGISTRO"]; ?></td>
                            <td><?php echo $mostrar["CODIGO"]; ?></td>
                            <td><?php echo $mostrar["MEDIDA"]; ?></td>
                            <td><?php echo $mostrar["DESCRIPCION"]; ?></td>
                            <td><?php echo $mostrar["STOCK"]; ?></td>
                        </tr>
                        <?php } ?>
                    </tbody>
                </table>
            </div>
        </div>
    </div>
</div>

<script src="https://code.jquery.com/jquery-3.4.1.slim.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/popper.js@1.16.0/dist/umd/popper.min.js"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/js/bootstrap.min.js"></script>
</body>
</html>
