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

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

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

    <?php include ('php/head.php'); ?>

    <body>

        <nav class="SB-menu-horizontal">
            <div>
                <h2><a href="clientes.php">Clientes</a></h2>
            </div>
            <div>
                <p>
                    <?php $texto_admin = VarBoolIntToTexto($session_var[2], " (A)", "");
                    echo $session_var[0]. $texto_admin; ?>
                </p>
            </div>
            <div>
                <p><a href="login/salirSesion.php?email=<?php echo $session_var[1]; ?>">Salir</a></p>
            </div>
        </nav>
        <nav class="SB-sidebar-left">
            <div class="SB-scrollbox-left">
                <div class="SB-scrollbox-inner-left">
                    <?php CargarListaClientes($con); ?>
                </div>
            </div>
        </nav>

        <nav class="SB-sidebar-right">
            <div class="SB-scrollbox-right">
                <div class="SB-scrollbox-inner-right">
                    Contenido
                </div>
            </div>
        </nav>
    </body>

    </html>

    <?php

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


