<?php

		$permission  = explode(',',$_SESSION['permission_id']);
               
        asort($permission); ?>
    <style>
    	.navbar-nav {
    		margin-left: 0px;
    		margin-right: -15px;
		}

		html[dir="rtl"].navbar-nav {
    		margin-left: -15px !important;
		}

		html[dir="rtl"].navbar-nav {
    	margin-right: 0px !important;
		}

		html[dir="rtl"].navbar-brand {
		    
		    padding: 15px 15px;
		}

		.navbar-nav > li {
		    margin-left: -15px;
		}

		.navbar-header {
		    min-width: 100px;
		}

		.dropdown-menu {
    		min-width: 240px;
    	}

    </style>          
						
	<div class="navbar navbar-inverse bg-warning-800 navbar-fixed-top">
		<div class="navbar-header">
			<a tabindex="1" class="navbar-brand" href="starter.php"><i class="icon-home2 position-left"></i> <span class="multi_lang">الرئيسية</span></a>
			
			<ul class="nav navbar-nav pull-right visible-xs-block">
				<li><a data-toggle="collapse" data-target="#navbar-mobile"><i class="icon-tree5"></i></a></li>
			</ul>
		</div>

		<div class="navbar-collapse collapse" id="navbar-mobile">
			<ul class="nav navbar-nav">



				

				<?php if(in_array(1,$permission) || in_array(5,$permission)  ){ ?>
				<li class="dropdown">
					<a tabindex="3" href="index.php?p=product" class="dropdown-toggle" >
						<i class="icon-dropbox position-left"></i><span class="multi_lang">المواد</span>
						<span class="visible-xs-inline-block position-right"></span>
					</a>
				</li>
				<?php } ?>

				<?php if(in_array(1,$permission) || in_array(2,$permission)  ){ ?>
				<li class="dropdown">
					<a tabindex="3" href="index.php?p=order" class="dropdown-toggle" >
						<i class="icon-play position-left"></i><span class="multi_lang">Show</span>
						<span class="visible-xs-inline-block position-right"></span>
					</a>
				</li>
				<?php } ?>

				


				


				


				

				



				


				

				


				

				<?php if(in_array(1,$permission) || in_array(4,$permission) || in_array(14,$permission) || in_array(22,$permission) ){ ?>
				
				<li class="dropdown">
					<a class="dropdown-toggle" data-toggle="dropdown">
						<i class="icon-menu3 position-left"></i><span class="multi_lang">عمليات اخرى</span> 
						<span class="visible-xs-inline-block position-right"></span>
						<span class="caret"></span>
					</a>

					<ul class="dropdown-menu">

						

						<?php if(in_array(1,$permission) || in_array(22,$permission)  ){ ?>
						<li><a href="index.php?p=users"><i class="icon-user-tie position-left"></i><span class="multi_lang">مستخدمي النظام</span></a></li>
						<?php } ?>

						<?php if(in_array(1,$permission) || in_array(4,$permission)  ){ ?>
						<li><a href="index.php?p=category"><i class="icon-tree7 position-left"></i><span class="multi_lang">الاصناف</span></a></li>
						<?php } ?>

						<?php if(in_array(1,$permission) || in_array(14,$permission)  ){ ?>
						<!-- <li><a href="index.php?p=customer"><i class="icon-user-check position-left"></i><span class="multi_lang">الزبائن</span>   </a></li> -->
						<?php } ?>

						
						
						

						
						
						
						
					</ul>
				</li>
				<?php } ?>


				


				
			</ul>

			

			<ul class="nav navbar-nav navbar-right">
				
				
				<?php if(in_array(1,$permission) || in_array(23,$permission) || in_array(27,$permission) || in_array(28,$permission) ){ ?>

				<li class="dropdown">
					<a class="dropdown-toggle" data-toggle="dropdown">
						<i class="icon-cog6 position-left"></i><span class="multi_lang">اعدادات</span> 
						<span class="visible-xs-inline-block position-right"></span>
						<span class="caret"></span>
					</a>

					<ul class="dropdown-menu">
						
						<?php if(in_array(1,$permission) || in_array(23,$permission)  ){ ?>
						<li><a href="index.php?p=setting"><i class="icon-cog6 position-left"></i><span class="multi_lang">اعدادات النظام</span>  </a></li>
						<?php } ?>
						<?php if(in_array(1,$permission) || in_array(27,$permission)  ){ ?>
						<li><a href="index.php?p=languages"><i class="icon-earth position-left"></i><span class="multi_lang">اللغات</span></a></li>
						<?php } ?>
						<?php if(in_array(1,$permission) || in_array(28,$permission)  ){ ?>
						<li><a href="index.php?p=translation"><i class="icon-ampersand2 position-left"></i><span class="multi_lang">الترجمة</span></a></li>
						<?php } ?>
						
						
					</ul>
				</li>

				
				<?php } ?>
				
				

				<li class="dropdown dropdown-user">
					<a class="dropdown-toggle" data-toggle="dropdown">
						<?php if($_SESSION['profile_image']==null){  ?>
						<img src="image/profile/noimg.png" alt="">
						<?php }else{ ?>
						<img src="<?php echo $_SESSION['image_path'].$_SESSION['profile_image']; ?>" alt="">
						<?php } ?>
						<span><?php echo $_SESSION['username']; ?></span>
						<i class="caret"></i>
					</a>

					<ul class="dropdown-menu dropdown-menu-right">
						<li><a href="index.php?p=profile"><i class="icon-user-plus"></i><span class="multi_lang">صفحتي الشخصية</span> </a></li>
						
						<li class="divider"></li>
						<li><a href="models/logout.php"><i class="icon-switch2"></i><span class="multi_lang">تسجيل الخروج</span> </a></li>
					</ul>
				</li>
			</ul>
		</div>
	</div>
	