<?php
session_start();
include ('conexion/config.php');
include ('php/funciones.php');
include ('php/funciones_clientes.php');
include ('php/funciones_head.php');

if (CheckSesion($_SESSION, 'emailUser') == "1") {

    $session_var = VariablesSession($_SESSION, ['nameUser', 'emailUser', 'UserAdmin']);
    ?>
    <!DOCTYPE html>
    <html lang="es">

    <?php MostrarHead(1); ?>
    <!--"/css2/estilo_cliente.css" -->

    <body>

        <div class="header sticky">
            <div class="container">
                <div>
                    <a href="#home" class="navbar-link">Clientes</a>
                </div>

                <nav class="menu-principal" data-navbar>
                    <div>
                        <button id="boton-salir" class="boton-menu" aria-label="Toggle Menu" title="Toggle Menu">
                            <a href="#" class="navbar-link">Salir</a>
                        </button>
                    </div>
                    <div>
                        <button id="boton-cliente" class="boton-menu" aria-label="Toggle Menu" title="Toggle Menu">
                            <a href="#" class="navbar-link">Ver Clientes</a>
                        </button>
                    </div>
                </nav>
            </div>
        </div>

        <div class="left" id="columna-izquierda">
            <div class="header sticky">Buscar</div>
            <div class="container">
                <?php MostrarTarjetaClientes(100); ?>
            </div>
        </div>

        <div class="left-boton" id="columna-izquierda-boton" style="display:none;">
            <div class="header sticky">Buscar</div>
            <div class="container">
                <?php MostrarTarjetaClientes(100); ?>
            </div>
        </div>

        <div class="right" id="columna-derecha">
            <div class="header sticky">
                <?php MostrarCabeceraTituloCliente(); ?>
            </div>


            <div class="m-parent">
                <div class="m-div5">
                    <?php MostrarDatosClienteContacto(); ?>
                    <?php MostrarDatosClienteContacto(); ?>
                    <?php MostrarDatosClienteContacto(); ?>
                    <?php MostrarDatosClienteContacto(); ?>
                </div>                
            </div>
        </div>

        <script src='https://cdnjs.cloudflare.com/ajax/libs/jquery/3.5.1/jquery.min.js'></script>
        <script src='https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.5.2/js/bootstrap.min.js'></script>
        <script src="assets/js/script.js"></script>

        <script>

            var colIzq = document.getElementById('columna-izquierda-boton');
            var colDch = document.getElementById('columna-derecha');

            const boton = document.getElementById("boton-cliente");
            boton.addEventListener("click", () => {
                if (colIzq.style.display == 'none') {
                    colIzq.style.display = 'block';
                } else {
                    colIzq.style.display = 'none';
                }
            });

        </script>

    </body>

    </html>

    <?php

} else {
    header("location:login/login.php");
}


