<?php 
session_start();
$ruta=explode("?",$_SERVER['REQUEST_URI']);
$m=$ruta[1];
//Inicio
$i=''; $g=''; $cl=''; $u=''; $ip=''; $rp=''; $map='';
if($m=='inicio'){$i='active';}
elseif($m=='guias'){$g='active';}
elseif($m=='clientes'){$cl='active';}
elseif($m=='usuarios'){$u='active';}
elseif($m=='importacion'){$ip='active';}
elseif($m=='informes'){$rp='active';}
elseif($m=='mapa'){$map='active';}
elseif($m=='seguimiento'){$seg='active';}


?>

<!-- Sidebar -->
<ul class="navbar-nav bg-gradient-primary sidebar sidebar-dark accordion toggled" id="accordionSidebar">

    <!-- Sidebar - Brand -->
    <a class="sidebar-brand d-flex align-items-center justify-content-center" href="?inicio">
        <div class="sidebar-brand-icon">
            <img class="img-profile" src="img/favicon.png" width="50%">
        </div>
        <div class="sidebar-brand-text mx-3">SysReports <sup>2</sup></div>
    </a>

    <!-- Divider -->
    <hr class="sidebar-divider my-0">
<?php if($_SESSION['permisos_acceso'] == 'Super Admin'){?>
    <!-- Nav Item - Dashboard -->
    <li class="nav-item <?php echo $i;?>">
        <a class="nav-link" href="?inicio">
            <i class="fas fa-fw fa-tachometer-alt"></i>
            <span>Dashboard</span>
        </a>
    </li>

    <!-- Nav Item - Ordenes -->
    <li class="nav-item <?php echo $g;?>">
        <a class="nav-link" href="?guias">
            <i class="fa fa-id-card"></i>
            <span>Guias</span>
        </a>
    </li>
    
    <!-- Nav Item - Clientes --> 
    <li class="nav-item <?php echo $cl;?>">
        <a class="nav-link" href="?clientes">
            <i class="fa fa-users"></i>
            <span>Clientes</span>
        </a>
    </li>
    <!-- Nav Item - Clientes --> 
    <li class="nav-item <?php echo $map;?>">
        <a class="nav-link" href="?mapa">
            <i class="fa fa-map-marked-alt"></i>
            <span>Mapa</span>
        </a>
    </li>
    <!-- Nav Item - Report -->
    <li class="nav-item <?php echo $rp;?>">
        <a class="nav-link" href="?informes">
            <i class="fa fa-file"></i>
            <span>Informes</span>
        </a>
    </li>
    <!-- Nav Item - Seguimimiento -->
    <li class="nav-item <?php echo $seg;?>">
        <a class="nav-link" href="?seguimiento">
            <i class="fas fa-route"></i>
            <span>Seguimiento</span>
        </a>
    </li>
    <!-- Nav Item - Usuarios -->
    <li class="nav-item <?php echo $u;?>">
        <a class="nav-link" href="?usuarios">
            <i class="fa fa-user"></i>
            <span>Usuarios</span>
        </a>
    </li>
    <!-- Nav Item - Carga -->
    <li class="nav-item <?php echo $ip;?>">
        <a class="nav-link" href="?importacion">
            <i class="fa fa-upload"></i>
            <span>Importacion</span>
        </a>
    </li>
    <li class="nav-item ">
        <a class="nav-link collapsed" href="#" data-toggle="collapse" data-target="#collapseTwo"
            aria-expanded="true" aria-controls="collapseTwo">
            <i class="fas fa-folder-open"></i>
            <span>RNDC</span>
        </a>
        <div id="collapseTwo" class="collapse" aria-labelledby="headingTwo" data-parent="#accordionSidebar">
            <div class="bg-white py-2 collapse-inner rounded">
                <a class="collapse-item" href="?rndc_terceros"><i class="fas fa-users"></i> Terceros</a>
                <a class="collapse-item" href="?rndc_vehiculos"><i class="fas fa-car"></i> Vehiculos</a>
                <a class="collapse-item" href="?rndc_remesas"><i class="fas fa-file-pdf"></i> Remesas</a>
            </div>
        </div>
    </li>
    
<?php } 
if($_SESSION['permisos_acceso'] == 'Administrador'){?>
    <!-- Nav Item - Ordenes -->
    <li class="nav-item <?php echo $g;?>">
        <a class="nav-link" href="?guias">
            <i class="fa fa-id-card"></i>
            <span>Guias</span>
        </a>
    </li>
    <li class="nav-item <?php echo $rp;?>">
        <a class="nav-link" href="?informes">
            <i class="fa fa-file"></i>
            <span>Informes</span>
        </a>
    </li>
<?php } ?>
    <!-- Nav Item - Pages Collapse Menu 
    <li class="nav-item ">
        <a class="nav-link collapsed" href="#" data-toggle="collapse" data-target="#collapseTwo"
            aria-expanded="true" aria-controls="collapseTwo">
            <i class="fas fa-folder-open"></i>
            <span>Reportes</span>
        </a>
        <div id="collapseTwo" class="collapse" aria-labelledby="headingTwo" data-parent="#accordionSidebar">
            <div class="bg-white py-2 collapse-inner rounded">
                <a class="collapse-item" href="?info_ordenes"><i class="fas fa-file-pdf"></i> Ordenes</a>
                <a class="collapse-item" href="cards.html">Cards</a>
            </div>
        </div>
    </li>-->

    


    <!-- Divider -->
    <hr class="sidebar-divider d-none d-md-block">

    <!-- Sidebar Toggler (Sidebar) 
    <div class="text-center d-none d-md-inline">
        <button class="rounded-circle border-0" id="sidebarToggle"></button>
    </div>-->

</ul>
<!-- End of Sidebar -->