<?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: 290px;
    	}

    </style>          
						
	<div class="navbar navbar-inverse bg-indigo navbar-fixed-top">
		<div class="navbar-header">
			<a 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(26,$permission)){ ?>
				<li class="dropdown">
					<a href="index.php?p=dashboard" class="dropdown-toggle" >
						<i class="icon-display4 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 href="index.php?p=report" class="dropdown-toggle" >
						<i class="icon-pie-chart3 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(3,$permission)  ){ ?>
				<li class="dropdown">
					<a 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(5,$permission)  ){ ?>
				<li class="dropdown">
					<a href="index.php?p=purchase" class="dropdown-toggle" >
						<i class="icon-cart-add2 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(7,$permission) || in_array(8,$permission) || in_array(9,$permission) ){ ?>

				<li class="dropdown">
					<a class="dropdown-toggle" data-toggle="dropdown">
						<i class="icon-calculator3 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(7,$permission)  ){ ?>
						<li><a href="index.php?p=invoice">
								<i class="icon-calculator position-left"></i><span class="multi_lang">بيع مواد جملة</span>
							</a>
						</li>
						<?php } ?>

						<li class="divider"></li>

						<?php if(in_array(1,$permission) || in_array(9,$permission)  ){ ?>
						<li><a href="index.php?p=invoice_curt&typ=0">
								<i class="icon-bookmarks position-left"></i><span class="multi_lang">بيع ستائر بالجملة</span>
							</a>
						</li>
						<?php } ?>

						<?php if(in_array(1,$permission) || in_array(8,$permission)  ){ ?>
						<li><a href="index.php?p=invoice_curt&typ=1">
								<i class="icon-bookmark2 position-left"></i><span class="multi_lang">بيع ستائر بالمفرد</span>
							</a>
						</li>
						<?php } ?>

						<li class="divider"></li>

						<?php if(in_array(1,$permission) || in_array(9,$permission)  ){ ?>
						<li><a class="text-primary" href="index.php?p=offer_curt&typ=0">
								<i class="icon-file-check2 position-left"></i><span class="multi_lang">عروض ستائر بالجملة</span>
							</a>
						</li>
						<?php } ?>

						<?php if(in_array(1,$permission) || in_array(8,$permission)  ){ ?>
						<li><a class="text-primary" href="index.php?p=offer_curt&typ=1">
								<i class="icon-file-check position-left"></i><span class="multi_lang">عروض ستائر بالمفرد</span>
							</a>
						</li>
						<?php } ?>

						<li class="divider"></li>

						<?php if(in_array(1,$permission) || in_array(7,$permission)  ){ ?>
						<li><a class="text-danger" href="index.php?p=invoice_deleted">
								<i class="icon-trash position-left"></i><span class="multi_lang">مواد جملة -محذوفة</span>
							</a>
						</li>
						<?php } ?>

						<?php if(in_array(1,$permission) || in_array(9,$permission)  ){ ?>
						<li><a class="text-danger" href="index.php?p=invoice_curt_deleted&typ=0">
								<i class="icon-trash position-left"></i><span class="multi_lang">ستائر جملة - محذوفة</span>
							</a>
						</li>
						<?php } ?>

						<?php if(in_array(1,$permission) || in_array(8,$permission)  ){ ?>
						<li><a class="text-danger" href="index.php?p=invoice_curt_deleted&typ=1">
								<i class="icon-trash position-left"></i><span class="multi_lang">ستائر مفرد - محذوفة</span>
							</a>
						</li>
						<?php } ?>

						<li class="divider"></li>
						<?php if(in_array(1,$permission) || in_array(8,$permission) || in_array(9,$permission)  ){ ?>
						<li><a class="text-teal" href="index.php?p=notes">
								<i class="icon-notebook position-left"></i><span class="multi_lang">ادارة الملاحظات</span>
							</a>
						</li>
						<?php } ?>
						
					</ul>
				</li>

				
				<?php } ?>

				



				<?php if(in_array(1,$permission) || in_array(13,$permission) || in_array(14,$permission) || in_array(33,$permission) ){ ?>
				
				<li class="dropdown">
					<a class="dropdown-toggle" data-toggle="dropdown">
						<i class="icon-store 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(13,$permission)  ){ ?>
						<li><a href="index.php?p=stock"><i class="icon-store 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=stock_report"><i class="icon-store position-left"></i><span class="multi_lang">الجرد المخزني</span>   </a></li>
						<?php } ?>

						<?php if(in_array(1,$permission) || in_array(33,$permission)  ){ ?>
						<li><a href="index.php?p=stock_return"><i class="icon-reset position-left text-danger"></i><span class="text-danger multi_lang">المواد المسترجعة</span>   </a></li>
						<?php } ?>
					</ul>
				</li>
				<?php } ?>


				<?php if(in_array(1,$permission) || in_array(19,$permission) || in_array(28,$permission) ){ ?>
				
				<li class="dropdown">
					<a class="dropdown-toggle" data-toggle="dropdown">
						<i class="icon-file-presentation 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(19,$permission)  ){ ?>
						<li><a href="index.php?p=account_statement&typ=0"><i class="icon-file-stats2 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=account_statement&typ=1"><i class="icon-profile position-left"></i><span class="multi_lang">كشف حساب زبائن المفرد</span>   </a></li>
						<?php } ?>
					</ul>
				</li>
				<?php } ?>




				<?php if(in_array(1,$permission) || in_array(6,$permission) || in_array(15,$permission) || in_array(4,$permission) || in_array(16,$permission) || in_array(17,$permission) || in_array(18,$permission) || in_array(25,$permission) || in_array(29,$permission) || in_array(30,$permission) || in_array(10,$permission) || in_array(12,$permission) || in_array(27,$permission) || in_array(31,$permission) || in_array(32,$permission) || in_array(22,$permission) || in_array(24,$permission) || in_array(70,$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">

						
						<li><a href="index.php?p=color"><i class="icon-paint-format position-left"></i><span class="multi_lang">تعريف حالات المواد</span>  </a></li>
						
						<li><a href="index.php?p=status"><i class="icon-paint-format position-left"></i><span class="multi_lang">حالات المواد</span>  </a></li>
						
						<?php if(in_array(1,$permission) || in_array(25,$permission)  ){ ?>
						<li><a href="index.php?p=capital"><i class="icon-safe position-left"></i><span class="multi_lang">رأس المال</span>  </a></li>
						<?php } ?>

						<?php if(in_array(1,$permission) || in_array(29,$permission)  ){ ?>
						<li><a href="index.php?p=capital_withdraw"><i class="icon-drawer-out position-left"></i><span class="multi_lang">القروض والديون</span>  </a></li>
						<?php } ?>

						

						<?php if(in_array(1,$permission) || in_array(31,$permission)  ){ ?>
						<li><a href="index.php?p=payment"><i class="icon-cash position-left"></i><span class="multi_lang">الدفوعات العامة</span>  </a></li>
						<?php } ?>

						<?php if(in_array(1,$permission) || in_array(30,$permission)  ){ ?>
						<li><a href="index.php?p=payment_single"><i class="icon-cash position-left"></i><span class="multi_lang">دفوعات المفرد</span>  </a></li>
						<?php } ?>

						<?php if(in_array(1,$permission) || in_array(32,$permission)  ){ ?>
						<li><a href="index.php?p=payment_notify"><i class="icon-bell3 position-left"></i><span class="multi_lang">تنبيهات الدفعات</span>  </a></li>
						<?php } ?>



						<?php if(in_array(1,$permission) || in_array(10,$permission)  ){ ?>
						<li><a href="index.php?p=users"><i class="icon-users2 position-left"></i><span class="multi_lang"> الموظفين</span></a></li>
						<?php } ?>
						<?php if(in_array(1,$permission) || in_array(12,$permission)  ){ ?>
						<li><a href="index.php?p=customer&typ=0"><i class="icon-users4 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=customer&typ=1"><i class="icon-users2 position-left"></i><span class="multi_lang">زبائن المفرد</span>   </a></li>
						<?php } ?>



						<?php if(in_array(1,$permission) || in_array(6,$permission)  ){ ?>
						<li><a href="index.php?p=expenses_group"><i class="icon-wallet position-left"></i><span class="multi_lang">فئات المصاريف</span>  </a></li>
						<li><a href="index.php?p=expenses"><i class="icon-cash3 position-left"></i><span class="multi_lang">المصاريف</span></a></li>
						<?php } ?>
						<?php if(in_array(1,$permission) || in_array(15,$permission)  ){ ?>
						<li><a href="index.php?p=items"><i class="icon-basket position-left"></i> <span class="multi_lang">الاصناف</span>   </a></li>
						<?php } ?>
						<?php if(in_array(1,$permission) || in_array(22,$permission)  ){ ?>
						<li><a href="index.php?p=supplier"><i class="icon-truck position-left"></i><span class="multi_lang">الموردين</span></a></li>
						<?php } ?>
						<?php if(in_array(1,$permission) || in_array(24,$permission)  ){ ?>
						<li><a href="index.php?p=supplier_payment"><i class="icon-cart5 position-left"></i><span class="multi_lang">تسديد الموردين</span></a></li>
						<?php } ?>
						<?php if(in_array(1,$permission) || in_array(16,$permission)  ){ ?>
						<li><a href="index.php?p=profile_price"><i class="icon-coins position-left"></i><span class="multi_lang">انواع ملفات الاسعار</span>   </a></li>
						<?php } ?>
						<?php if(in_array(1,$permission) || in_array(17,$permission)  ){ ?>
						<li><a href="index.php?p=product_price"><i class="icon-price-tag position-left"></i><span class="multi_lang">تعريف اسعار المواد</span>   </a></li>
						<?php } ?>
						<?php if(in_array(1,$permission) || in_array(18,$permission)  ){ ?>
						<li><a href="index.php?p=others"><i class="icon-dice position-left"></i><span class="multi_lang">مواد اخرى</span>   </a></li>
						<?php } ?>
						
					</ul>
				</li>
				<?php } ?>
				
				<?php if(in_array(1,$permission) || in_array(68,$permission)){ ?>
				<li class="dropdown">
					<a href="index.php?p=archive" class="dropdown-toggle" >
						<i class="icon-archive position-left"></i><span class="multi_lang">الارشفة والترحيل</span> 
						<span class="visible-xs-inline-block position-right"></span>
					</a>
				</li>
				<?php } ?>

				
			</ul>

			

			<ul class="nav navbar-nav navbar-right">
				<!--
				<li class="dropdown language-switch">
					<a class="dropdown-toggle" data-toggle="dropdown">
						<img src="assets/images/flags/gb.png" class="position-left" alt="">
						English
						<span class="caret"></span>
					</a>

					<ul class="dropdown-menu">
						<li><a class="deutsch"><img src="assets/images/flags/de.png" alt=""> Deutsch</a></li>
						<li><a class="ukrainian"><img src="assets/images/flags/ua.png" alt=""> Українська</a></li>
						<li><a class="english"><img src="assets/images/flags/gb.png" alt=""> English</a></li>
						<li><a class="espana"><img src="assets/images/flags/es.png" alt=""> España</a></li>
						<li><a class="russian"><img src="assets/images/flags/ru.png" alt=""> Русский</a></li>
					</ul>
				</li>
				-->
				
				<?php if(in_array(1,$permission) || in_array(11,$permission) || in_array(20,$permission) || in_array(21,$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(11,$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(20,$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(21,$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>
	