<?php 
//header("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1
//header("Expires: Sat, 1 Jul 2000 05:00:00 GMT"); // Fecha en el pasado
session_start();
$html = "login.php";
if(!isset($_SESSION['usuario'])){
    echo "<script>location.href='$html?pagina=1';</script>";
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="icon" type="image/png" href="./img/favicon.png" sizes="16x16">
    <title>Administrador sitio</title>
    <link href="./css/select2.min.css" rel="stylesheet" />
    <link rel="stylesheet" href="./css/bootstrap.min.css" />
    <link rel="stylesheet" href="./css/bootstrap-icons.css" />
    <script src="./js/bootstrap.bundle.min.js"> </script>
    <script src="./js/jquery-3.6.1.js" ></script>
    <script src="./js/select2.min.js"></script>
    
</head>
<body>

    <div class="sticky-top">
    <nav class="navbar navbar-expand-lg navbar-dark bg-primary">
        <div class="container-fluid">
            <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarColor01" aria-controls="navbarColor01" aria-expanded="false" aria-label="Toggle navigation">
                <span class="navbar-toggler-icon"></span>
            </button>
            <div class="collapse navbar-collapse" id="navbarColor01">
                <ul class="navbar-nav me-auto ms-auto mb-2 mb-lg-0">
                    <li class="nav-item">
                        <a class="nav-link" href="index.php">Inicio </a>
                    </li>
                    <?php if(($_SESSION['perfil'] == 1) or ($_SESSION['perfil'] == 3)){ ?>
                        <li class="nav-item dropdown">
                            <a class="nav-link dropdown-toggle" data-bs-toggle="dropdown" href="#" role="button" 
                            aria-haspopup="true" aria-expanded="false">Administrar</a>
                            <div class="dropdown-menu">
                                <a class="dropdown-item" href="usuarios.php">Usuarios</a>
                                <a class="dropdown-item" href="clientes.php">Clientes</a>
                                <a class="dropdown-item" href="instalaciones.php">Instalaciones</a>
                                <a class="dropdown-item" href="accesoInstalacion.php">Acceso Instalaci&oacute;n</a>
                                <a class="dropdown-item" href="actividades.php">Actividades</a>
                                <a class="dropdown-item" href="segmentos.php">Categor&iacute;a</a>
                                <a class="dropdown-item" href="documentos.php">Documentos</a>
                                <a class="dropdown-item" href="planPrevencion.php">Plan anual</a>
                            </div>
                        </li>
                    <?php } ?>
                    <li class="nav-item dropdown">
                        <a class="nav-link dropdown-toggle" data-bs-toggle="dropdown" href="#" role="button" 
                        aria-haspopup="true" aria-expanded="false">Incorporar</a>
                        <div class="dropdown-menu">
                        <a class="dropdown-item" href="formularioIngreso.php">Formulario de ingreso</a>
                        </div>
                    </li>
                    <li class="nav-item dropdown">
                        <a class="nav-link dropdown-toggle" data-bs-toggle="dropdown" href="#" role="button" 
                        aria-haspopup="true" aria-expanded="false">Reportes</a>
                        <div class="dropdown-menu">
                            <a class="dropdown-item" href="reportePlan.php">Movimientos por plan</a>
                        </div>
                    </li>
                    <li class="nav-item">
                        <a class="nav-link" href="cerrar.php">Salir</a>
                    </li>
                    <li class="nav-item">
                        <a class="nav-link" href="proveedor/index.php" target="_blank">Acceso proveedor</a>
                    </li>
                    <?php if($_SESSION['perfil'] == 5 ){ 
                        session_destroy();
                        header("location:login.php");
                    }
                    ?>
                </ul>
            </div>
        </div>
    </nav>
    </div>

    <div class="container">
        <br/>
        <div class="row">