<?php session_start();
if (isset($_SESSION['login']) && $_SESSION['login'] != '') { //Logeado
    $btnlog = $_SESSION['login'] . '<br><a href="logout.php"><img src="iconos/user-icon-on-transparent-background-free-png.png" onclick="" style="height:2em;"></a>';
} else { //No logeado
    $btnlog = '<br><a href="login.php"><img src="iconos/user-icon-on-transparent-background-free-png.png" onclick="" style="height:2em;"></a>';
} //Fin no logeado
?>



<!DOCTYPE html>
<html lang="es">

<head>
    <title>APP D.I</title>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="stylesheet" href="librerias/bootstrap-5.3.8-dist/css/bootstrap.min.css">
    <script src="librerias/bootstrap-5.3.8-dist/js/bootstrap.bundle.min.js"></script>
    <style>
        input {
            width: 100%;
        }
    </style>
</head>

<body>
    <div class="container-fluid">
        <div class="row">
            <div class="col-md-2 col-sm-9">
                Logotipo
            </div>
            <div class="col-md-8 d-none d-md-block">
                Aplicacion de Javier Lasheras
            </div>
            <div class="col-md-2 col-sm-3">
                <?php echo $btnlog; ?>
            </div>
        </div>
    </div>
    <nav class="navbar navbar-expand-lg bg-body-tertiary">
        <div class="container-fluid">
            <a class="navbar-brand" href="#">Navbar</a>
            <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav" aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
                <span class="navbar-toggler-icon"></span>
            </button>
            <div class="collapse navbar-collapse" id="navbarNav">
                <ul class="navbar-nav">
                    <li class="nav-item">
                        <a class="nav-link active" aria-current="page" href="#">Home</a>
                    </li>
                    <li class="nav-item">
                        <a class="nav-link" href="#">Features</a>
                    </li>
                    <li class="nav-item">
                        <a class="nav-link" href="#">Pricing</a>
                    </li>
                    <li class="nav-item dropdown">
                        <a class="nav-link dropdown-toggle" href="#" role="button" data-bs-toggle="dropdown">Mtto.Datos</a>
                        <ul class="dropdown-menu">
                            <li><a class="dropdown-item" onclick="obtenerVista('Usuarios', 'getVistaUsuariosPrincipal', 'capaContenido')">Usuarios</a></li>
                            <li><a class="dropdown-item" onclick="obtenerVista('Productos', 'getVistaProductosPrincipal', 'capaContenido')">Productos</a></li>
                            <li><a class="dropdown-item" href="#">Something else here</a></li>
                        </ul>
                    </li>
                </ul>
            </div>
        </div>
    </nav>
    <div class="container-fluid">
        Menú
    </div>
    <div class="container-fluid" id="capaContenido">
        Contenido
    </div>
    <script src="index.js" async></script>
    <script src="formularioUsuario.js" async></script>
    <script>
    </script>
</body>

</html>
<?php
require_once 'controladores/CUsuarios.php';
$controladorUsuario = new CUsuarios();
$controladorUsuario->insertarUsuario($_POST);
//$controladorUsuario->actualizarUsuario($_POST);
$controladorUsuario->eliminarUsuario($_POST);
?>

<script>
</script>