<?PHP

date_default_timezone_set('America/Lima');
session_start();
if(!$_SESSION["verificar"]){
  header("location: ../views/page-login");
}

?>
<!doctype html>
<!--[if lt IE 7]>      <html class="no-js lt-ie9 lt-ie8 lt-ie7" lang=""> <![endif]-->
<!--[if IE 7]>         <html class="no-js lt-ie9 lt-ie8" lang=""> <![endif]-->
<!--[if IE 8]>         <html class="no-js lt-ie9" lang=""> <![endif]-->
<!--[if gt IE 8]><!-->
<html class="no-js" lang="en">
<!--<![endif]-->

<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>VehiTracker | Sistema de Gestión Vehicular</title>
    <meta name="description" content="Smart Card">
    <meta name="viewport" content="width=device-width, initial-scale=1">

    <link rel="apple-touch-icon" href="../public/img/coche.png">
    <link rel="shortcut icon" href="../public/img/coche.png">

    <link rel="stylesheet" href="../public/vendors/bootstrap/dist/css/bootstrap.min.css">
    <link rel="stylesheet" href="../public/vendors/font-awesome/css/font-awesome.min.css">
    <link rel="stylesheet" href="../public/vendors/themify-icons/css/themify-icons.css">
    <link rel="stylesheet" href="../public/vendors/flag-icon-css/css/flag-icon.min.css">
    <link rel="stylesheet" href="../public/vendors/selectFX/css/cs-skin-elastic.css">
    <link rel="stylesheet" href="../public/vendors/jqvmap/dist/jqvmap.min.css">

    <link rel="stylesheet" href="../public/assets/css/style.css">
    <link rel="stylesheet" href="https://cdn.datatables.net/2.2.2/css/dataTables.dataTables.css">
    <link rel="stylesheet" href="https://cdn.datatables.net/buttons/3.2.2/css/buttons.dataTables.css">
    <link rel="stylesheet" href="../public/vendors/datatables.net-bs4/css/dataTables.bootstrap4.min.css">
    <link rel="stylesheet" href="../public/vendors/datatables.net-buttons-bs4/css/buttons.bootstrap4.min.css">
    <link href='https://fonts.googleapis.com/css?family=Open+Sans:400,600,700,800' rel='stylesheet' type='text/css'>
    <script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script>

</head>

<body>


    <!-- Left Panel -->

    <aside id="left-panel" class="left-panel">
        <nav class="navbar navbar-expand-sm navbar-default">

            <div class="navbar-header">
    <button class="navbar-toggler" type="button" data-toggle="collapse" 
        data-target="#main-menu" aria-controls="main-menu" 
        aria-expanded="false" aria-label="Toggle navigation">
        <i class="fa fa-bars"></i>
    </button>
    <a class="navbar-brand" href="#" style="font-weight:bold; font-size:1.5rem; color:#fff;">
        VehiTracker
    </a>
</div>

            <div id="main-menu" class="main-menu collapse navbar-collapse">
                <ul class="nav navbar-nav">
                    <?php if (in_array('ver_dashboard_principal', $_SESSION['permisos'])): ?>
                    <li class="active">
                        <a href="dashboard"><i class="menu-icon fa fa-line-chart" aria-hidden="true"></i> Dashboard</a>
                    </li>
                     <?php endif; ?>
                              <?php if (in_array('ver_dashboard_principal', $_SESSION['permisos'])): ?>
                    <li class="menu-item-has-children dropdown">
                        <a href="#" class="dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> <i class="menu-icon fa fa-key" aria-hidden="true"></i>Admin</a>
                        <ul class="sub-menu children dropdown-menu">
                            <li><i class="fa fa-user-plus" aria-hidden="true"></i><a href="usuario">Usuarios</a></li>
                             <li><i class="fa fa-user-plus" aria-hidden="true"></i><a href="roles">Roles de Sistema</a></li>
 
                        </ul>
                    </li>
                     <?php endif; ?>
                      <?php if (in_array('ver_conductor', $_SESSION['permisos'])): ?>
                    <li class="menu-item-has-children dropdown">
                        <a href="#" class="dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> <i class="menu-icon fa fa-laptop"></i>Conductor</a>
                        <ul class="sub-menu children dropdown-menu">
                            <li><i class="fa fa-car" aria-hidden="true"></i><a href="flotas">Vehiculos</a></li>
                            <li><i class="fa fa-id-card-o"></i><a href="conductor">Conductores</a></li>
                            <li><i class="fa fa-user-md" aria-hidden="true"></i><a href="seguro">Seguro Vehícular</a></li>
                         <li><i class="fa fa-user-md" aria-hidden="true"></i><a href="registrar_placa">Activar Geolocalización</a></li>
                          
                             
                            
                        </ul>
                    </li>
                     <?php endif; ?>
                                           <?php if (in_array('ver_seguridad', $_SESSION['permisos'])): ?>
                    <li class="menu-item-has-children dropdown">
                        <a href="#" class="dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> <i class="menu-icon fa fa-laptop"></i>Seguridad</a>
                        <ul class="sub-menu children dropdown-menu">
                            
                            <li><i class="fa fa-user-md" aria-hidden="true"></i><a href="registro_unidad">Registrar Ingreso</a></li>
                            <li><i class="fa fa-car" aria-hidden="true"></i><a href="view_mapa_seguridad">Ver Mapa Registro</a></li>
                               <li><i class="fa fa-file-excel-o" aria-hidden="true"></i><a href="reporte_seguridad">Reporte Ingresos y Salidas</a></li>
                                <li><i class="fa fa-file-excel-o" aria-hidden="true"></i><a href="realtime">Geolocalización Real Time</a></li>
                               
                        </ul>
                    </li>
                     <?php endif; ?>
                      <?php if (in_array('ver_reportes', $_SESSION['permisos'])): ?>
                    <li class="menu-item-has-children dropdown">
                        <a href="#" class="dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> <i class="menu-icon fa fa-table"></i>Reportes</a>
                        <ul class="sub-menu children dropdown-menu">
                            <li><i class="fa fa-file-excel-o" aria-hidden="true"></i><a href="reporte_general">Reporte Ingresos y Salidas</a></li>
                            
                        </ul>
                    </li>
                      <?php endif; ?>
               
                  

                    <li>
                        <a href="logout"> <i class="menu-icon ti-power-off"></i>Cerrar Sesión </a>
                    </li>
                  

                </ul>
            </div><!-- /.navbar-collapse -->
        </nav>
    </aside><!-- /#left-panel -->

    <!-- Left Panel -->

    <!-- Right Panel -->

    <div id="right-panel" class="right-panel">

        <!-- Header-->
        <header id="header" class="header">

            <div class="header-menu">

                <div class="col-sm-7">
                    <a id="menuToggle" class="menutoggle pull-left"><i class="fa fa fa-tasks"></i></a>
                    <div class="header-left">
                        <button class="search-trigger"><i class="fa fa-search"></i></button>

                    </div>
                </div>

                <div class="col-sm-5">
                    <div class="user-area dropdown float-right">
                        <small><?php echo $_SESSION['sess_name']; ?></small>
                        <a href="#" class="dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
                            <img class="user-avatar rounded-circle" src="../public/img/usuarios/<?php echo $_SESSION['sess_foto']; ?>" alt="User Avatar">
                            
                            
                        </a>

                        <div class="user-menu dropdown-menu">
                            <a class="nav-link" href="logout"><i class="fa fa-power-off"></i> Logout</a>
                        </div>
                    </div>

                    <div class="language-select dropdown" id="language-select">
                        <a class="dropdown-toggle" href="#" data-toggle="dropdown"  id="language" aria-haspopup="true" aria-expanded="true">
                            <i class="flag-icon flag-icon-pe"></i>
                        </a>
                        
                    </div>

                </div>
            </div>

        </header><!-- /header -->
        <!-- Header-->