<?php debug_backtrace() || die ("Direct access not permitted"); ?>

			<?php
		if (!function_exists('getActive')) {	
			function getActive($dir,$name)
				{
					if($name == $dir){
						echo "class='active'";
					}
				}
		}		

			?>


<?php 
	
	if($_SESSION['user']['type'] == "editor" && $_SESSION['user']['id'] <> 15 ){
	
?>	


<!-- Navigation -->
<nav class="navbar navbar-inverse navbar-fixed-top" role="navigation">
    <div class="navbar-header">
        <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-ex1-collapse">
            <span class="sr-only">Toggle navigation</span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
        </button>
        <a class="navbar-brand" href="<?php echo DOCBASE; ?>admin/"><img src="/admin/images/logoNew.png" style="width:70px;" /> <?php //echo SITE_TITLE; ?></a>
        <div class="pull-right hidden-xs" id="info-header">
            <?php echo $texts['CONNECTED_AS']; ?> <i class="fa fa-user"></i> <?php echo "<b>".$_SESSION['user']['login']."</b> (".$_SESSION['user']['type'].")"; ?>&nbsp;
            <a href="<?php echo DOCBASE; ?>admin/login.php?action=logout"><i class="fa fa-power-off"></i> <?php echo $texts['LOG_OUT']; ?></a>
        </div>
    </div>
    <div class="collapse navbar-collapse navbar-ex1-collapse">
        <ul class="nav navbar-nav side-nav">
            <li>
                <a href="<?php echo DOCBASE; ?>admin/"<?php if(strpos($_SERVER['SCRIPT_NAME'], "admin/index.php") !== false) echo " class=\"active\""; ?>>
                    <i class="fa fa-dashboard"></i> <?php echo $texts['DASHBOARD']; ?>
                </a>
            </li>

			<?php $achat = array('bc','be','br','facture_achat','facture_avoir'); ?>
			<li class="dropdown">
                <a data-target="#module-menu4" data-toggle="collapse" href="#"><i class="fa fa-cart-plus"></i>  Achat <i class="fa fa-angle-down"></i></a>
                <ul class="<?php if(in_array($dirname, $achat)) echo "in"; else echo "collapse"; ?>" role="menu" id="module-menu4">

				<li><a href="/admin/modules/bc/index.php?view=list" <?php getActive('bc',$dirname); ?>><i class="fa fa-shopping-basket"></i> Bon de commande</a></li>
				<li><a href="/admin/modules/be/index.php?view=list" <?php getActive('be',$dirname); ?>><i class="fa fa-sign-in"></i> BE Achat</a></li>
				<li><a href="/admin/modules/br/index.php?view=list" <?php getActive('br',$dirname); ?>><i class="fa fa-sign-out"></i> BS Achat</a></li>
                </ul>
            </li>


			<?php $production = array('bf','stock','stock_vente','mouvement_stock'); ?>
			<li class="dropdown">
                <a data-target="#module-menu6" data-toggle="collapse" href="#"><i class="fa fa-cart-plus"></i>  Production <i class="fa fa-angle-down"></i></a>
                <ul class="<?php if(in_array($dirname, $production)) echo "in"; else echo "collapse"; ?>" role="menu" id="module-menu6">

				<li><a href="/admin/modules/bf/index.php?view=list" <?php getActive('bf',$dirname); ?>><i class="fa fa-industry"></i> Bon de fabrication</a></li>
			
                </ul>
            </li>
			<?php $Vente = array('bl','brv','facture','facture_avoir_vente'); ?>
			<li class="dropdown">
                <a data-target="#module-menu5" data-toggle="collapse" href="#"><i class="fa fa-cart-arrow-down"></i>  Vente <i class="fa fa-angle-down"></i></a>
                <ul class="<?php if(in_array($dirname, $Vente)) echo "in"; else echo "collapse"; ?>" role="menu" id="module-menu5">

				<li><a href="/admin/modules/bl/index.php?view=list"  <?php getActive('bl',$dirname); ?>><i class="fa fa-sign-in" ></i> BL Vente</a></li>				
				<li><a href="/admin/modules/brv/index.php?view=list"  <?php getActive('brv',$dirname); ?>><i class="fa fa-sign-out" ></i> BR Vente</a></li>
				</ul>
            </li>			


		

			<?php $stock = array(''); ?>
            <li class="dropdown">
                <a data-target="#module-menu20" data-toggle="collapse" href="#"><i class="fa fa-exchange"></i> Stock MP<i class="fa fa-angle-down"></i></a>
                <ul class="<?php if(in_array($dirname, $stock)) echo "in"; else echo "collapse"; ?>" role="menu" id="module-menu20">

				<li><a href="/admin/modules/transferer_produit.php" <?php getActive('transaction',$dirname); ?>><i class="fa fa-exchange"></i> T.stock MP</a></li>
				<li><a href="/admin/stock_new/" <?php getActive('transaction',$dirname); ?>><i class="fa fa-exchange"></i> Liste des Mouv de Stock MP</a></li>

			
				<li><a href="/admin/stock/"  <?php getActive('stock',$dirname); ?>><i class="fa fa-random " ></i> Inventaire achat</a></li>
				<li><a href="/admin/mouvement_stock/"  <?php getActive('mouvement_stock',$dirname); ?>><i class="fa fa-cubes " ></i> Mouvement de l'article</a></li>
				
				
                </ul>
            </li>
			
			
	            <li class="dropdown">
                <a data-target="#module-menu21" data-toggle="collapse" href="#"><i class="fa fa-exchange"></i> Stock PF<i class="fa fa-angle-down"></i></a>
                <ul class="<?php if(in_array($dirname, $stock)) echo "in"; else echo "collapse"; ?>" role="menu" id="module-menu21">

<li><a href="/admin/stock_vente_pf/"  <?php getActive('stock_vente',$dirname); ?>><i class="fa fa-random " ></i> Inventaire vente</a></li>

				<li><a href="/admin/modules/transfer_pf.php" <?php getActive('transaction',$dirname); ?>><i class="fa fa-exchange"></i> T.stock Pf</a></li>
				<li><a href="/admin/stock_pf/" <?php getActive('transaction',$dirname); ?>><i class="fa fa-exchange"></i> Liste des Mouv de Stock Pf</a></li>
<!--<li><a href="/admin/stock_pf/stock.php" <?php //getActive('transaction',$dirname); ?>><i class="fa fa-exchange"></i> Stocks des Produits par Dépôt</a></li>
			   <li><a href="/admin/stock_vente/"  <?php //getActive('stock_vente',$dirname); ?>><i class="fa fa-random " ></i> Inventaire vente old</a></li>	-->
				
                </ul>
            </li>

			
			

			 <?php
                    // foreach($modules as $module){

                        // $title = $module->getTitle();
                        // $name = $module->getName();
                        // $dir = $module->getDir();
                        // $icon = $module->getIcon();
                        // $link = $dir."/index.php?view=list";
                        
                        // if($icon == "") $icon = "puzzle-piece";
                        
                        // $classname = ($dirname == $name) ? " class=\"active\"" : "";
                        
                        // if(!in_array("no_access", $module->getPermissions($_SESSION['user']['type'])))
                            // echo "<li><a href=\"".$link."\"".$classname."><i class=\"fa fa-".$icon."\"></i> ".$title."</a></li>";
                    // }
			?>


            <?php
            if($_SESSION['user']['type'] == "administrator"){ ?>
                
                <?php
            } ?>
        </ul>
    </div>
</nav>


	<? }else if($_SESSION['user']['type'] == "editor" && $_SESSION['user']['id'] == 15){ ?>
	
<!-- Navigation -->
<nav class="navbar navbar-inverse navbar-fixed-top" role="navigation">
    <div class="navbar-header">
        <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-ex1-collapse">
            <span class="sr-only">Toggle navigation</span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
        </button>
        <a class="navbar-brand" href="<?php echo DOCBASE; ?>admin/"><img src="/admin/images/logoNew.png" style="width:70px;" /> <?php //echo SITE_TITLE; ?></a>
        <div class="pull-right hidden-xs" id="info-header">
            <?php echo $texts['CONNECTED_AS']; ?> <i class="fa fa-user"></i> <?php echo "<b>".$_SESSION['user']['login']."</b> (".$_SESSION['user']['type'].")"; ?>&nbsp;
            <a href="<?php echo DOCBASE; ?>admin/login.php?action=logout"><i class="fa fa-power-off"></i> <?php echo $texts['LOG_OUT']; ?></a>
        </div>
    </div>
    <div class="collapse navbar-collapse navbar-ex1-collapse">
        <ul class="nav navbar-nav side-nav">
            <li>
                <a href="<?php echo DOCBASE; ?>admin/"<?php if(strpos($_SERVER['SCRIPT_NAME'], "admin/index.php") !== false) echo " class=\"active\""; ?>>
                    <i class="fa fa-dashboard"></i> <?php echo $texts['DASHBOARD']; ?>
                </a>
            </li>



			<?php $production = array('bf','stock','stock_vente','mouvement_stock'); ?>
			<li class="dropdown">
                <a data-target="#module-menu6" data-toggle="collapse" href="#"><i class="fa fa-cart-plus"></i>  Production <i class="fa fa-angle-down"></i></a>
                <ul class="<?php if(in_array($dirname, $production)) echo "in"; else echo "collapse"; ?>" role="menu" id="module-menu6">


<li><a href="/admin/modules/bf/index.php?view=list" <?php getActive('bf',$dirname); ?>><i class="fa fa-industry"></i> Bon de fabrication</a></li>

				<!-- <li><a href="/admin/stock/"  <?php //getActive('stock',$dirname); ?>><i class="fa fa-random " ></i> Inventaire achat</a></li> -->

				
                </ul>
            </li>
		
        </ul>
    </div>
</nav>
	
	
	<? }else if($_SESSION['user']['type'] == "production" ){ ?>	
	





<!-- Navigation -->
<nav class="navbar navbar-inverse navbar-fixed-top" role="navigation">
    <div class="navbar-header">
        <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-ex1-collapse">
            <span class="sr-only">Toggle navigation</span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
        </button>
        <a class="navbar-brand" href="<?php echo DOCBASE; ?>admin/"><img src="/admin/images/logoNew.png" style="width:70px;" /> <?php //echo SITE_TITLE; ?></a>
        <div class="pull-right hidden-xs" id="info-header">
            <?php echo $texts['CONNECTED_AS']; ?> <i class="fa fa-user"></i> <?php echo "<b>".$_SESSION['user']['login']."</b> (".$_SESSION['user']['type'].")"; ?>&nbsp;
            <a href="<?php echo DOCBASE; ?>admin/login.php?action=logout"><i class="fa fa-power-off"></i> <?php echo $texts['LOG_OUT']; ?></a>
        </div>
    </div>
    <div class="collapse navbar-collapse navbar-ex1-collapse">
        <ul class="nav navbar-nav side-nav">
            <li>
                <a href="<?php echo DOCBASE; ?>admin/"<?php if(strpos($_SERVER['SCRIPT_NAME'], "admin/index.php") !== false) echo " class=\"active\""; ?>>
                    <i class="fa fa-dashboard"></i> <?php echo $texts['DASHBOARD']; ?>
                </a>
            </li>


		<?php $production = array('bf','stock','stock_vente','mouvement_stock','ration'); ?>
			<li class="dropdown">
                <a data-target="#module-menu6" data-toggle="collapse" href="#"><i class="fa fa-cart-plus"></i>  Production <i class="fa fa-angle-down"></i></a>
                <ul class="<?php if(in_array($dirname, $production)) echo "in"; else echo "collapse"; ?>" role="menu" id="module-menu6">

				<li><a href="/admin/modules/bf/index.php?view=list" <?php getActive('bf',$dirname); ?>><i class="fa fa-industry"></i> Bon de fabrication</a></li>
				<li><a href="/admin/ratio/"  <?php getActive('ratio',$dirname); ?>><i class="fa fa-line-chart " ></i> Analyse de la consommation</a></li>
				
                </ul>
            </li>
			
			
			<?php $stock = array(''); ?>
            <li class="dropdown">
                <a data-target="#module-menu20" data-toggle="collapse" href="#"><i class="fa fa-exchange"></i> Stock MP<i class="fa fa-angle-down"></i></a>
                <ul class="<?php if(in_array($dirname, $stock)) echo "in"; else echo "collapse"; ?>" role="menu" id="module-menu20">

				<li><a href="/admin/modules/transferer_produit.php" <?php getActive('transaction',$dirname); ?>><i class="fa fa-exchange"></i> T.stock MP</a></li>

				<li><a href="/admin/stock_new/" <?php getActive('transaction',$dirname); ?>><i class="fa fa-exchange"></i> Liste des Mouv de Stock MP</a></li>

			
				<li><a href="/admin/stock/"  <?php getActive('stock',$dirname); ?>><i class="fa fa-random " ></i> Inventaire achat</a></li>
				<li><a href="/admin/mouvement_stock/"  <?php getActive('mouvement_stock',$dirname); ?>><i class="fa fa-cubes " ></i> Mouvement de l'article</a></li>
				
				
                </ul>
            </li>

            <li class="dropdown">
                <a data-target="#module-menu21" data-toggle="collapse" href="#"><i class="fa fa-exchange"></i> Stock PF<i class="fa fa-angle-down"></i></a>
                <ul class="<?php if(in_array($dirname, $stock)) echo "in"; else echo "collapse"; ?>" role="menu" id="module-menu21">

				<li><a href="/admin/modules/transfer_pf.php" <?php getActive('transaction',$dirname); ?>><i class="fa fa-exchange"></i> T.stock Pf</a></li>
				<li><a href="/admin/stock_pf/" <?php getActive('transaction',$dirname); ?>><i class="fa fa-exchange"></i> Liste des Mouv de Stock Pf</a></li>
<li><a href="/admin/stock_pf/stock.php" <?php getActive('transaction',$dirname); ?>><i class="fa fa-exchange"></i> Stocks des Produits par Dépôt</a></li>
			    <li><a href="/admin/stock_vente/"  <?php getActive('stock_vente',$dirname); ?>><i class="fa fa-random " ></i> Inventaire vente old</a></li>	
				
                </ul>
            </li>

			
			
			<?php $Fabrio = array('centre_charge,user_fabrio,declaration_of,Suivi'); ?>
			<li class="dropdown">
                <a data-target="#module-menu99" data-toggle="collapse" href="#"><i class="fa fa-industry"></i>  Fabrio <i class="fa fa-angle-down"></i></a>
                <ul class="<?php if(in_array($dirname, $Fabrio)) echo "in"; else echo "collapse"; ?>" role="menu" id="module-menu99">


			<li>
                <a href="/admin/screen.php" target="_blank" <?php getActive('screen',$dirname); ?>>
                    <i class="fa fa-dashboard"></i> Screen Saver
                </a>
            </li>

			<li>
                <a href="/admin/modules/centre_charge/index.php?view=list" <?php getActive('centre_charge',$dirname); ?>>
                    <i class="fa fa-sitemap"></i> Centre de charge
                </a>
            </li>

			<li>
                <a href="/admin/modules/user_fabrio/index.php?view=list" <?php getActive('user_fabrio',$dirname); ?>>
                    <i class="fa fa-user"></i> User fabrio
                </a>
            </li>

			<li>
                <a href="/admin/modules/declaration_of/index.php?view=list" <?php getActive('declaration_of',$dirname); ?>>
                    <i class="fa fa-bullhorn"></i> Déclaration OF
                </a>
            </li>					
				
			<li>
                <a href="/admin/fabrio/resume_journee.php" <?php getActive('Suivi',$dirname); ?>>
                    <i class="fa fa-bullhorn"></i> Suivi de Production Quotidien
                </a>
            </li>					
					
					
					</ul>
            </li>
			
		
        </ul>
    </div>
</nav>




	<? }else if($_SESSION['user']['type'] == "comptable" ){ ?>	
	





<!-- Navigation -->
<nav class="navbar navbar-inverse navbar-fixed-top" role="navigation">
    <div class="navbar-header">
        <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-ex1-collapse">
            <span class="sr-only">Toggle navigation</span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
        </button>
        <a class="navbar-brand" href="<?php echo DOCBASE; ?>admin/"><img src="/admin/images/logoNew.png" style="width:70px;" /> <?php //echo SITE_TITLE; ?></a>
        <div class="pull-right hidden-xs" id="info-header">
            <?php echo $texts['CONNECTED_AS']; ?> <i class="fa fa-user"></i> <?php echo "<b>".$_SESSION['user']['login']."</b> (".$_SESSION['user']['type'].")"; ?>&nbsp;
            <a href="<?php echo DOCBASE; ?>admin/login.php?action=logout"><i class="fa fa-power-off"></i> <?php echo $texts['LOG_OUT']; ?></a>
        </div>
    </div>
    <div class="collapse navbar-collapse navbar-ex1-collapse">
        <ul class="nav navbar-nav side-nav">
            <li>
                <a href="<?php echo DOCBASE; ?>admin/"<?php if(strpos($_SERVER['SCRIPT_NAME'], "admin/index.php") !== false) echo " class=\"active\""; ?>>
                    <i class="fa fa-dashboard"></i> <?php echo $texts['DASHBOARD']; ?>
                </a>
            </li>

			<?php $achat = array('bc','be','br','facture_achat','facture_avoir'); ?>
			<li class="dropdown">
                <a data-target="#module-menu4" data-toggle="collapse" href="#"><i class="fa fa-cart-plus"></i>  Achat <i class="fa fa-angle-down"></i></a>
                <ul class="<?php if(in_array($dirname, $achat)) echo "in"; else echo "collapse"; ?>" role="menu" id="module-menu4">

				<li><a href="/admin/modules/facture_achat/index.php?view=list" <?php getActive('facture_achat',$dirname); ?>><i class="fa fa-file-text"></i> Facture d'achat</a></li>
				 </ul>
            </li>
			
			
						<?php $Finance = array('transaction','rapport','rapport_achat','rapport_vente','etat'); ?>
            <li class="dropdown">
                <a data-target="#module-menu2" data-toggle="collapse" href="#"><i class="fa fa-university"></i> Finance <i class="fa fa-angle-down"></i></a>
                <ul class="<?php if(in_array($dirname, $Finance)) echo "in"; else echo "collapse"; ?>" role="menu" id="module-menu2">

				<li><a href="/admin/modules/transaction/index.php?view=list" <?php getActive('transaction',$dirname); ?>><i class="fa fa-exchange"></i> Opération Financière</a></li>

				<li><a href="/admin/rapport/index.php" <?php getActive('rapport',$dirname); ?>><i class="fa fa-registered"></i> Journal quotidien</a></li>
				<li><a href="/admin/all_rapport/rapport_achat.php" <?php getActive('rapport_achat',TITLE_ELEMENT); ?>><i class="fa fa-line-chart"></i> Rapport Fac. Achat non règle </a></li>
				<li><a href="/admin/all_rapport/index_echance.php" <?php getActive('rapport_vente',TITLE_ELEMENT); ?>><i class="fa fa-line-chart"></i> Relevé échéance clients </a></li>
				<li><a href="/admin/all_rapport/transactions/index.php" <?php getActive('etat',TITLE_ELEMENT); ?>><i class="fa fa-line-chart"></i> État Financier </a></li>
                </ul>
            </li>
			
			<? if($_SESSION['user']['id'] == 20){ //====== Pour salma ?>
			
			<?php $rapport_compt = array('doc_achat','doc_vente','doc_retenue'); ?>
			<li class="dropdown">
                <a data-target="#module-menu8" data-toggle="collapse" href="#"><i class="fa fa-bullhorn"></i>  Rapports comptables <i class="fa fa-angle-down"></i></a>
                <ul class="<?php if(in_array($dirname, $rapport_compt)) echo "in"; else echo "collapse"; ?>" role="menu" id="module-menu8">

					<li><a href="/admin/all_rapport/doc_achat/index.php" <?php getActive('doc_achat',$dirname); ?>><i class="fa fa-dropbox"></i> Lists des documents des Achat</a></li>
					<li><a href="/admin/all_rapport/doc_vente/index.php" <?php getActive('doc_vente',$dirname); ?>><i class="fa fa-dropbox"></i> Lists des documents des Vente</a></li>
					<li><a href="/admin/all_rapport/doc_retenue/index.php" <?php getActive('doc_retenue',$dirname); ?>><i class="fa fa-dropbox"></i> Liste des retenues à la source (Achat)</a></li>
				</ul>
            </li>
			
			<li>
                <a href="<?php echo DOCBASE; ?>admin/all_rapport/balance/"<?php if(strpos($_SERVER['SCRIPT_NAME'], "balance/") !== false) echo " class=\"active\""; ?>>
                    <i class="fa fa-balance-scale"></i> Balance des comptes
                </a>
            </li>
			
			<? } ?>

		
        </ul>
    </div>
</nav>

	<? }else if($_SESSION['user']['type'] == "logistique" ){ ?>	
	
	
	
<!-- Navigation -->
<nav class="navbar navbar-inverse navbar-fixed-top" role="navigation">
    <div class="navbar-header">
        <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-ex1-collapse">
            <span class="sr-only">Toggle navigation</span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
        </button>
        <a class="navbar-brand" href="<?php echo DOCBASE; ?>admin/"><img src="/admin/images/logoNew.png" style="width:70px;" /> <?php //echo SITE_TITLE; ?></a>
        <div class="pull-right hidden-xs" id="info-header">
            <?php echo $texts['CONNECTED_AS']; ?> <i class="fa fa-user"></i> <?php echo "<b>".$_SESSION['user']['login']."</b> (".$_SESSION['user']['type'].")"; ?>&nbsp;
            <a href="<?php echo DOCBASE; ?>admin/login.php?action=logout"><i class="fa fa-power-off"></i> <?php echo $texts['LOG_OUT']; ?></a>
        </div>
    </div>
    <div class="collapse navbar-collapse navbar-ex1-collapse">
        <ul class="nav navbar-nav side-nav">
            <li>
                <a href="<?php echo DOCBASE; ?>admin/"<?php if(strpos($_SERVER['SCRIPT_NAME'], "admin/index.php") !== false) echo " class=\"active\""; ?>>
                    <i class="fa fa-dashboard"></i> <?php echo $texts['DASHBOARD']; ?>
                </a>
            </li>


			
<li><a href="/admin/stock_vente_pf/"  <?php getActive('stock_vente',$dirname); ?>><i class="fa fa-random " ></i> Inventaire vente</a></li>
<!--<li><a href="/admin/stock_vente/"  <?php getActive('stock_vente1',$dirname); ?>><i class="fa fa-random " ></i> Inventaire vente old</a></li>-->
			

		
        </ul>
    </div>
</nav>	
	

	<? }else if($_SESSION['user']['type'] == "purchase" ){ ?>	
	
	
	
<!-- Navigation -->
<nav class="navbar navbar-inverse navbar-fixed-top" role="navigation">
    <div class="navbar-header">
        <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-ex1-collapse">
            <span class="sr-only">Toggle navigation</span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
        </button>
        <a class="navbar-brand" href="<?php echo DOCBASE; ?>admin/"><img src="/admin/images/logoNew.png" style="width:70px;" /> <?php //echo SITE_TITLE; ?></a>
        <div class="pull-right hidden-xs" id="info-header">
            <?php echo $texts['CONNECTED_AS']; ?> <i class="fa fa-user"></i> <?php echo "<b>".$_SESSION['user']['login']."</b> (".$_SESSION['user']['type'].")"; ?>&nbsp;
            <a href="<?php echo DOCBASE; ?>admin/login.php?action=logout"><i class="fa fa-power-off"></i> <?php echo $texts['LOG_OUT']; ?></a>
        </div>
    </div>
    <div class="collapse navbar-collapse navbar-ex1-collapse">
        <ul class="nav navbar-nav side-nav">
            <li>
                <a href="<?php echo DOCBASE; ?>admin/"<?php if(strpos($_SERVER['SCRIPT_NAME'], "admin/index.php") !== false) echo " class=\"active\""; ?>>
                    <i class="fa fa-dashboard"></i> <?php echo $texts['DASHBOARD']; ?>
                </a>
            </li>


			
<li><a href="/admin/stock/"  <?php getActive('stock',$dirname); ?>><i class="fa fa-random " ></i> Inventaire achat</a></li>
<li><a href="/admin/all_rapport/doc_achat/index.php" <?php getActive('doc_achat',$dirname); ?>><i class="fa fa-dropbox"></i> Lists des documents des Achat</a></li>		
<li><a href="/admin/modules/be/index.php?view=list" <?php getActive('be',$dirname); ?>><i class="fa fa-sign-in"></i> BE Achat</a></li>
<li><a href="/admin/modules/bc/index.php?view=list" <?php getActive('bc',$dirname); ?>><i class="fa fa-shopping-basket"></i> Bon de commande</a></li>
<li><a href="/admin/modules/facture_achat/index.php?view=list" <?php getActive('facture_achat',$dirname); ?>><i class="fa fa-file-text"></i> Facture d'achat</a></li>

		
        </ul>
    </div>
</nav>	
	



			
	<? }else{ ?>


<!-- Navigation -->
<nav class="navbar navbar-inverse navbar-fixed-top" role="navigation">
    <div class="navbar-header">
        <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-ex1-collapse">
            <span class="sr-only">Toggle navigation</span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
        </button>
        <a class="navbar-brand" href="<?php echo DOCBASE; ?>admin/"><img src="/admin/images/logoNew.png" style="width:70px;" /> <?php //echo SITE_TITLE; ?></a>
        <div class="pull-right hidden-xs" id="info-header">
            <?php echo $texts['CONNECTED_AS']; ?> <i class="fa fa-user"></i> <?php echo "<b>".$_SESSION['user']['login']."</b> (".$_SESSION['user']['type'].")"; ?>&nbsp;
            <a href="<?php echo DOCBASE; ?>admin/login.php?action=logout"><i class="fa fa-power-off"></i> <?php echo $texts['LOG_OUT']; ?></a>
        </div>
    </div>
    <div class="collapse navbar-collapse navbar-ex1-collapse">
        <ul class="nav navbar-nav side-nav">
            <li>
                <a href="<?php echo DOCBASE; ?>admin/"<?php if(strpos($_SERVER['SCRIPT_NAME'], "admin/index.php") !== false) echo " class=\"active\""; ?>>
                    <i class="fa fa-dashboard"></i> <?php echo $texts['DASHBOARD']; ?>
                </a>
            </li>
			<?php $Articles = array('produits','produitsachat'); ?>
            <li class="dropdown">
                <a data-target="#module-menu1" data-toggle="collapse" href="#"><i class="fa fa-industry"></i> Articles <i class="fa fa-angle-down"></i></a>
                <ul class="<?php if(in_array($dirname, $Articles)) echo "in"; else echo "collapse"; ?>" role="menu" id="module-menu1">
	
				<li><a href="/admin/modules/produitsachat/index.php?view=list" <?php getActive('produitsachat',$dirname); ?>><i class="fa fa-flask"></i> Articles achat</a></li>
				<li><a href="/admin/modules/produits/index.php?view=list" <?php getActive('produits',$dirname); ?>><i class="fa fa-flask"></i> Articles vente</a></li>

				</ul>
            </li>	
			<?php $achat = array('bc','be','br','facture_achat','facture_avoir'); ?>
			<li class="dropdown">
                <a data-target="#module-menu4" data-toggle="collapse" href="#"><i class="fa fa-cart-plus"></i>  Achat <i class="fa fa-angle-down"></i></a>
                <ul class="<?php if(in_array($dirname, $achat)) echo "in"; else echo "collapse"; ?>" role="menu" id="module-menu4">

				<li><a href="/admin/modules/bc/index.php?view=list" <?php getActive('bc',$dirname); ?>><i class="fa fa-shopping-basket"></i> Bon de commande</a></li>
				<li><a href="/admin/modules/be/index.php?view=list" <?php getActive('be',$dirname); ?>><i class="fa fa-sign-in"></i> BE Achat</a></li>
				<li><a href="/admin/modules/br/index.php?view=list" <?php getActive('br',$dirname); ?>><i class="fa fa-sign-out"></i> BS Achat</a></li>
				<li><a href="/admin/modules/facture_achat/index.php?view=list" <?php getActive('facture_achat',$dirname); ?>><i class="fa fa-file-text"></i> Facture d'achat</a></li>
				<li><a href="/admin/modules/facture_avoir/index.php?view=list" <?php getActive('facture_avoir',$dirname); ?>><i class="fa fa-file-text"></i> Facture d’avoir</a></li>
                </ul>
            </li>


			<?php $production = array('bf','stock','stock_vente','mouvement_stock','ratio','ca'); ?>
			<li class="dropdown">
                <a data-target="#module-menu6" data-toggle="collapse" href="#"><i class="fa fa-cart-plus"></i>  Production <i class="fa fa-angle-down"></i></a>
                <ul class="<?php if(in_array($dirname, $production)) echo "in"; else echo "collapse"; ?>" role="menu" id="module-menu6">

				<li><a href="/admin/modules/bf/index.php?view=list" <?php getActive('bf',$dirname); ?>><i class="fa fa-industry"></i> Bon de fabrication</a></li>

				<li><a href="/admin/ratio/"  <?php getActive('ratio',$dirname); ?>><i class="fa fa-line-chart " ></i> Analyse de la consommation</a></li>
				<li><a href="/admin/ca/"  <?php getActive('ca',$dirname); ?>><i class="fa fa-line-chart " ></i> Analyse de vente</a></li>
				
                </ul>
            </li>
			<?php $Vente = array('bl','brv','facture','facture_avoir_vente'); ?>
			<li class="dropdown">
                <a data-target="#module-menu5" data-toggle="collapse" href="#"><i class="fa fa-cart-arrow-down"></i>  Vente <i class="fa fa-angle-down"></i></a>
                <ul class="<?php if(in_array($dirname, $Vente)) echo "in"; else echo "collapse"; ?>" role="menu" id="module-menu5">

				<li><a href="/admin/modules/bl/index.php?view=list"  <?php getActive('bl',$dirname); ?>><i class="fa fa-sign-in" ></i> BL Vente</a></li>				
				<li><a href="/admin/modules/brv/index.php?view=list"  <?php getActive('brv',$dirname); ?>><i class="fa fa-sign-out" ></i> BR Vente</a></li>
                <li><a href="/admin/modules/facture/index.php?view=list"  <?php getActive('facture',$dirname); ?>><i class="fa fa-files-o " ></i> Facture Vente</a></li>
				<li><a href="/admin/modules/facture_avoir_vente/index.php?view=list" <?php getActive('facture_avoir_vente',$dirname); ?>><i class="fa fa-file-text"></i> Facture d’avoir/retour</a></li>
				</ul>
            </li>			


			<?php $Finance = array('transaction','rapport','rapport_achat','rapport_vente','etat'); ?>
            <li class="dropdown">
                <a data-target="#module-menu2" data-toggle="collapse" href="#"><i class="fa fa-university"></i> Finance <i class="fa fa-angle-down"></i></a>
                <ul class="<?php if(in_array($dirname, $Finance)) echo "in"; else echo "collapse"; ?>" role="menu" id="module-menu2">

				<li><a href="/admin/modules/transaction/index.php?view=list" <?php getActive('transaction',$dirname); ?>><i class="fa fa-exchange"></i> Opération Financière</a></li>

				<li><a href="/admin/rapport/index.php" <?php getActive('rapport',$dirname); ?>><i class="fa fa-registered"></i> Journal quotidien</a></li>
				<li><a href="/admin/all_rapport/rapport_achat.php" <?php getActive('rapport_achat',TITLE_ELEMENT); ?>><i class="fa fa-line-chart"></i> Rapport Fac. Achat non règle </a></li>
				<li><a href="/admin/all_rapport/index_echance.php" <?php getActive('rapport_vente',TITLE_ELEMENT); ?>><i class="fa fa-line-chart"></i> Relevé échéance clients </a></li>
				<li><a href="/admin/all_rapport/transactions/index.php" <?php getActive('etat',TITLE_ELEMENT); ?>><i class="fa fa-line-chart"></i> État Financier </a></li>
                </ul>
            </li>


			<?php $stock = array(''); ?>
            <li class="dropdown">
                <a data-target="#module-menu20" data-toggle="collapse" href="#"><i class="fa fa-exchange"></i> Stock MP<i class="fa fa-angle-down"></i></a>
                <ul class="<?php if(in_array($dirname, $stock)) echo "in"; else echo "collapse"; ?>" role="menu" id="module-menu20">

				<li><a href="/admin/modules/transferer_produit.php" <?php getActive('transaction',$dirname); ?>><i class="fa fa-exchange"></i> T.stock MP</a></li>
				<li><a href="/admin/stock_new/" <?php getActive('transaction',$dirname); ?>><i class="fa fa-exchange"></i> Liste des Mouv de Stock MP</a></li>
			
				<li><a href="/admin/stock/"  <?php getActive('stock',$dirname); ?>><i class="fa fa-random " ></i> Inventaire achat</a></li>
				<li><a href="/admin/mouvement_stock/"  <?php getActive('mouvement_stock',$dirname); ?>><i class="fa fa-cubes " ></i> Mouvement de l'article</a></li>
				

				<li><a href="/admin/stock_new/stock.php" <?php getActive('transaction',$dirname); ?>><i class="fa fa-exchange"></i> Stocks des Produits par Dépôt</a></li>

				
                </ul>
            </li>
			<?php $stock2 = array(''); ?>
            <li class="dropdown">
                <a data-target="#module-menu21" data-toggle="collapse" href="#"><i class="fa fa-exchange"></i> Stock PF<i class="fa fa-angle-down"></i></a>
                <ul class="<?php if(in_array($dirname, $stock2)) echo "in"; else echo "collapse"; ?>" role="menu" id="module-menu21">

				<li><a href="/admin/stock_vente_pf/"  <?php getActive('stock_vente',$dirname); ?>><i class="fa fa-random " ></i> Inventaire PF</a></li>
				<li><a href="/admin/modules/transfer_pf.php" <?php getActive('transaction',$dirname); ?>><i class="fa fa-exchange"></i> T.stock Pf</a></li>
				<li><a href="/admin/stock_pf/" <?php getActive('transaction',$dirname); ?>><i class="fa fa-exchange"></i> Liste des Mouv de Stock Pf</a></li>
				<li><a href="/admin/stock_pf/stock.php" <?php getActive('transaction',$dirname); ?>><i class="fa fa-exchange"></i> Stocks des Produits par Dépôt</a></li>

			    <li><a href="/admin/stock_vente/"  <?php getActive('stock_vente',$dirname); ?>><i class="fa fa-random " ></i> Inventaire vente old</a></li>			
                </ul>
            </li>

			
			<?php $param = array('category','famille_classe','famille','unite','fournisseurs','fourniseur_cat','cat_client','client','tva','fodec','journal','mode_paiement','classe_compte','retenue','compte_financier','engagement','vehicule','chauffeur'); ?>
            <li class="dropdown">
			<a data-target="#module-menu7" data-toggle="collapse" href="#"><i class="fa fa-cog"></i> Paramètres <i class="fa fa-angle-down"></i></a>
                <ul class="<?php if(in_array($dirname, $param)) echo "in"; else echo "collapse"; ?>" role="menu" id="module-menu7">
					<li><a href="/admin/modules/unite/index.php?view=list" <?php getActive('unite',$dirname); ?>><i class="fa fa-dropbox"></i> Unité</a></li>
					<li><a href="/admin/modules/category/index.php?view=list" <?php getActive('category',$dirname); ?>><i class="fa fa-puzzle-piece"></i> Catégorie famille</a></li>
					<li><a href="/admin/modules/famille_classe/index.php?view=list" <?php getActive('famille_classe',$dirname); ?>><i class="fa fa-puzzle-piece"></i> Familles des articles</a></li>
					<li><a href="/admin/modules/famille/index.php?view=list" <?php getActive('famille',$dirname); ?>><i class="fa fa-puzzle-piece"></i> Sous-famille articles</a></li>		
					<li><a href="/admin/modules/fourniseur_cat/index.php?view=list" <?php getActive('fourniseur_cat',$dirname); ?>><i class="fa fa-puzzle-piece"></i> Catégorie Fournisseur</a></li>
					<li><a href="/admin/modules/fournisseurs/index.php?view=list" <?php getActive('fournisseurs',$dirname); ?>><i class="fa fa-users"></i> Fournisseurs</a></li>
					<li><a href="/admin/modules/cat_client/index.php?view=list"  <?php getActive('cat_client',$dirname); ?>><i class="fa fa-address-book " ></i> Catégorie Clients</a></li>
					<li><a href="/admin/modules/client/index.php?view=list"  <?php getActive('client',$dirname); ?>><i class="fa fa-users " ></i> Clients</a></li>	
					<li><a href="/admin/modules/tva/index.php?view=list" <?php getActive('tva',$dirname); ?>><i class="fa fa-gavel"></i> Tva</a></li>
					<li><a href="/admin/modules/fodec/index.php?view=list" <?php getActive('fodec',$dirname); ?>><i class="fa fa-database"></i> Fodec</a></li>
					<li><a href="/admin/modules/retenue/index.php?view=list" <?php getActive('retenue',$dirname); ?>><i class="fa fa-paperclip"></i> Retenues à la source</a></li>
					<li><a href="/admin/modules/mode_paiement/index.php?view=list" <?php getActive('mode_paiement',$dirname); ?>><i class="fa fa-money"></i> Mode de paiements</a></li>
					<li><a href="/admin/modules/journal/index.php?view=list" <?php getActive('journal',$dirname); ?>><i class="fa fa-book"></i> Journaux</a></li>
					<li><a href="/admin/modules/classe_compte/index.php?view=list" <?php getActive('classe_compte',$dirname); ?>><i class="fa fa-ils"></i> Classe comptes</a></li>
					<li><a href="/admin/modules/compte_financier/index.php?view=list" <?php getActive('compte_financier',$dirname); ?>><i class="fa fa-paperclip"></i> Compte financiers</a></li>
					<li><a href="/admin/modules/engagement/index.php?view=list" <?php getActive('engagement',$dirname); ?>><i class="fa fa-database"></i> Engagements financiers mensuels</a></li>
					<li><a href="/admin/modules/vehicule/index.php?view=list" <?php getActive('vehicule',$dirname); ?>><i class="fa fa-car"></i> Véhicules</a></li>
					<li><a href="/admin/modules/chauffeur/index.php?view=list" <?php getActive('chauffeur',$dirname); ?>><i class="fa fa-user"></i> Chauffeurs</a></li>
				</ul>
            </li>
			<?php $rapport_compt = array('doc_achat','doc_vente','doc_retenue'); ?>
			<li class="dropdown">
                <a data-target="#module-menu8" data-toggle="collapse" href="#"><i class="fa fa-bullhorn"></i>  Rapports comptables <i class="fa fa-angle-down"></i></a>
                <ul class="<?php if(in_array($dirname, $rapport_compt)) echo "in"; else echo "collapse"; ?>" role="menu" id="module-menu8">

					<li><a href="/admin/all_rapport/doc_achat/index.php" <?php getActive('doc_achat',$dirname); ?>><i class="fa fa-dropbox"></i> Lists des documents des Achat</a></li>
					<li><a href="/admin/all_rapport/doc_vente/index.php" <?php getActive('doc_vente',$dirname); ?>><i class="fa fa-dropbox"></i> Lists des documents des Vente</a></li>
					<li><a href="/admin/all_rapport/doc_retenue/index.php" <?php getActive('doc_retenue',$dirname); ?>><i class="fa fa-dropbox"></i> Liste des retenues à la source (Achat)</a></li>
				</ul>
            </li>

			<?php $contact = array('contact_cat'); ?>
			<li class="dropdown">
                <a data-target="#module-menu9" data-toggle="collapse" href="#"><i class="fa fa-users"></i>  Contacts <i class="fa fa-angle-down"></i></a>
                <ul class="<?php if(in_array($dirname, $contact)) echo "in"; else echo "collapse"; ?>" role="menu" id="module-menu9">

					<li><a href="/admin/modules/contact_cat/index.php?view=list" <?php getActive('contact_cat',$dirname); ?>><i class="fa fa-list"></i> Catégorie contact</a></li>
					<li><a href="/admin/modules/contacts/index.php?view=list" <?php getActive('contacts',$dirname); ?>><i class="fa fa-address-book"></i>  Contacts</a></li>
					</ul>
            </li>

			
			 <li>
                <a href="<?php echo DOCBASE; ?>admin/all_rapport/stat_article"<?php if(strpos($_SERVER['SCRIPT_NAME'], "all_rapport/stat_article/") !== false) echo " class=\"active\""; ?>>
                    <i class="fa fa-dashboard"></i> Statistiques articles
                </a>
            </li>
			
			<li>
                <a href="<?php echo DOCBASE; ?>admin/objectif/"<?php if(strpos($_SERVER['SCRIPT_NAME'], "objectif/") !== false) echo " class=\"active\""; ?>>
                    <i class="fa fa-dashboard"></i> Objectif articles
                </a>
            </li>
			
			<?php if($_SESSION['user']['type'] == "administrator"){ ?>
                

			<li>
                <a href="<?php echo DOCBASE; ?>admin/all_rapport/balance/"<?php if(strpos($_SERVER['SCRIPT_NAME'], "balance/") !== false) echo " class=\"active\""; ?>>
                    <i class="fa fa-balance-scale"></i> Balance des comptes
                </a>
            </li>




			<?php $Fabrio = array('centre_charge,user_fabrio,declaration_of,Suivi'); ?>
			<li class="dropdown">
                <a data-target="#module-menu99" data-toggle="collapse" href="#"><i class="fa fa-industry"></i>  Fabrio <i class="fa fa-angle-down"></i></a>
                <ul class="<?php if(in_array($dirname, $Fabrio)) echo "in"; else echo "collapse"; ?>" role="menu" id="module-menu99">


			<li>
                <a href="/admin/screen.php" target="_blank" <?php getActive('screen',$dirname); ?>>
                    <i class="fa fa-dashboard"></i> Screen Saver
                </a>
            </li>

			<li>
                <a href="/admin/modules/centre_charge/index.php?view=list" <?php getActive('centre_charge',$dirname); ?>>
                    <i class="fa fa-sitemap"></i> Centre de charge
                </a>
            </li>

			<li>
                <a href="/admin/modules/user_fabrio/index.php?view=list" <?php getActive('user_fabrio',$dirname); ?>>
                    <i class="fa fa-user"></i> User fabrio
                </a>
            </li>

			<li>
                <a href="/admin/modules/declaration_of/index.php?view=list" <?php getActive('declaration_of',$dirname); ?>>
                    <i class="fa fa-bullhorn"></i> Déclaration OF
                </a>
            </li>					
					
	
			<li>
                <a href="/admin/fabrio/resume_journee.php" <?php getActive('Suivi',$dirname); ?>>
                    <i class="fa fa-bullhorn"></i> Suivi de Production Quotidien
                </a>
            </li>		

	
					</ul>
            </li>




			

			
			<li>
                <a href="/admin/modules/user/index.php?view=list" <?php getActive('user',$dirname); ?>>
                    <i class="fa fa-user-circle"></i> Utilisateurs
                </a>
            </li>
			
			 <?php
            } ?>
			


            <?php
            if($_SESSION['user']['type'] == "administrator"){ ?>
                
                <?php
            } ?>
        </ul>
    </div>
</nav>


<?php
	}
?>	

<style>
/*
.navbar-inverse {
    background: #4d9bf0;
}*/
</style>