<?php include_once "encabezado1.php"; ?>

<!DOCTYPE html>
<html lang="es">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Estética Avanzada en Formularios</title>
    <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@400;600&display=swap" rel="stylesheet">
    <style>
        body {
            font-family: 'Poppins', sans-serif;
            background: linear-gradient(to right, rgba(236, 233, 230, 0.8), rgba(255, 255, 255, 0.8)), url('desk.jpg');
            background-size: cover;
            background-position: center;
            background-attachment: fixed;
            color: #333;
            overflow-x: hidden;
        }
        .container {
            background-color: transparent; /* Fondo completamente transparente */
            border-radius: 10px;
            padding: 20px;
            margin-top: 50px;
            box-shadow: 0px 4px 20px rgba(0, 0, 0, 0.1);
        }
        .title {
            font-size: 1.5em;
            font-weight: 600;
            text-align: center;
            margin-bottom: 20px;
            display: flex;
            align-items: center;
            justify-content: center;
            color: #007bff;
        }
        .title span {
            font-size: 2em;
            margin-right: 10px;
        }
        .form-control, .input-group-text {
            background-color: rgba(255, 255, 255, 0.8); /* Fondo semitransparente para los inputs */
            border: none;
            box-shadow: inset 0px 0px 5px rgba(0, 0, 0, 0.1);
            transition: all 0.3s ease;
        }
        .form-control:focus {
            box-shadow: 0px 0px 8px rgba(0, 123, 255, 0.5);
        }
        .input-group-text {
            font-size: 1.2em;
            color: #495057;
            background: transparent;
        }
        .table-responsive {
            max-height: 300px;
            overflow-x: auto;
            border: 1px solid #ddd;
            margin-top: 20px;
            border-radius: 5px;
            background: rgba(255, 255, 255, 0.8); /* Fondo semitransparente en la tabla */
        }
        .table-hover tbody tr:hover {
            background-color: rgba(0, 123, 255, 0.1);
            transition: background-color 0.3s ease;
        }
        .scroll {
            min-height: 100px;
            margin-top: 20px;
            background: rgba(241, 241, 241, 0.8); /* Fondo semitransparente para la sección de scroll */
            border-radius: 5px;
            padding: 10px;
            font-size: 0.9em;
        }
        .animated-icon {
            font-size: 2em;
            transition: transform 0.3s ease;
        }
        .animated-icon:hover {
            transform: rotate(360deg);
        }
    </style>
</head>
<body>
<div class="container">
    <div class="title"><span class="animated-icon">🛒</span> Registro de Compras</div>
    <div class="input-group mb-3">
        <div class="input-group-prepend">
            <span class="input-group-text">📅</span>
        </div>
        <input type="date" class="form-control" id="buscarfecha" name="buscarfecha" onchange="fecha_registro()" placeholder="Selecciona una fecha">
    </div>
    <div class="input-group mb-3">
        <div class="input-group-prepend">
            <span class="input-group-text">🔢</span>
        </div>
        <input type="text" class="form-control" id="dni" name="dni" placeholder="SERIE-CORRELATIVO" onchange="dni()">
    </div>
    <div class="table-responsive">
        <!-- Aquí puedes colocar el contenido de la tabla, según sea necesario -->
    </div>
</div>

<div class="scroll" id="paso1"></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>
<script>
    function fecha_registro() {
        var mio = document.getElementById("buscarfecha").value;
        var mio2 = "FECHA_REGISTRO";
        var xmlhttp = new XMLHttpRequest();
        xmlhttp.onreadystatechange = function() {
            document.getElementById("paso1").innerHTML = this.responseText;
        };
        xmlhttp.open("GET", "registrabase/buscargasto2.php?buscarfecha=" + mio + "&columna=" + mio2, true);
        xmlhttp.send();
    }

    function dni() {
        var mio = document.getElementById("dni").value;
        var mio2 = "SERIE_CORRELATIVO";
        var xmlhttp = new XMLHttpRequest();
        xmlhttp.onreadystatechange = function() {
            document.getElementById("paso1").innerHTML = this.responseText;
        };
        xmlhttp.open("GET", "registrabase/buscargasto2.php?serie_correlativo=" + mio + "&columna=" + mio2, true);
        xmlhttp.send();
    }
</script>
</body>
</html>