<?php
ob_start();
error_reporting(0);
include("connect.php");
session_start();
$ver = $_SESSION['distributor_user_id'];
$user_role= $_SESSION['user_role'];
$id=$_GET['id'];
if(!isset($_SESSION["distributor_user_id"])){
   header('location:https://tarkashcorp.appexperts.net/index.php');
}
?>
<script type="text/javascript">

  function change()
   {
	  document.getElementById("dashboard").style.backgroundColor="#36c6d3";
	  document.getElementById("dashboardA").style.color="white";
	   document.getElementById("dashboardA").style.fontWeight="bold";
	  document.getElementById("dashboard").style.borderLeft="3px solid white";  
   }
   function changecolor2()
   {
	  document.getElementById("customer").style.backgroundColor="#36c6d3";
	  document.getElementById("customerA").style.color="white";
	   document.getElementById("customerA").style.fontWeight="bold";
	  document.getElementById("customer").style.borderLeft="3px solid white";  
   }
   function changecolor3()
   {
	   document.getElementById("product").style.backgroundColor="#36c6d3";
	  document.getElementById("product").style.backgroundColor="#36c6d3";
	  document.getElementById("product").style.color="white";
	   document.getElementById("product").style.fontWeight="bold";
	  document.getElementById("product").style.borderLeft="3px solid white";  
   }
   function changecolor4()
   {
	   document.getElementById("product").style.backgroundColor="#36c6d3";
	  document.getElementById("category").style.backgroundColor="#36c6d3";
	  document.getElementById("categoryA").style.color="white";
	   document.getElementById("categoryA").style.fontWeight="bold";
	  document.getElementById("category").style.borderLeft="3px solid white";  
   }
   function changecolor5()
   {
	   document.getElementById("product").style.backgroundColor="#36c6d3";
	  document.getElementById("products").style.backgroundColor="#36c6d3";
	  document.getElementById("productsA").style.color="white";
	   document.getElementById("productsA").style.fontWeight="bold";
	  document.getElementById("products").style.borderLeft="3px solid white";  
   }
   function changecolor6()
   {
	   document.getElementById("order").style.backgroundColor="#36c6d3";
	  document.getElementById("pending").style.backgroundColor="#36c6d3";
	  document.getElementById("pendingA").style.color="white";
	   document.getElementById("pendingA").style.fontWeight="bold";
	  document.getElementById("pending").style.borderLeft="3px solid white";  
   }
   function changecolor7()
   {
	   document.getElementById("order").style.backgroundColor="#36c6d3";
	  document.getElementById("accept").style.backgroundColor="#36c6d3";
	  document.getElementById("acceptA").style.color="white";
	   document.getElementById("acceptA").style.fontWeight="bold";
	  document.getElementById("accept").style.borderLeft="3px solid white";  
   }
   function changecolor8()
   {
	   document.getElementById("order").style.backgroundColor="#36c6d3";
	  document.getElementById("reject").style.backgroundColor="#36c6d3";
	  document.getElementById("rejectA").style.color="white";
	   document.getElementById("rejectA").style.fontWeight="bold";
	  document.getElementById("reject").style.borderLeft="3px solid white";  
   }
   function changecolor9()
   {
	  document.getElementById("report").style.backgroundColor="#36c6d3";
	  document.getElementById("pendingR").style.backgroundColor="#36c6d3";
	  document.getElementById("pendingRA").style.color="white";
	   document.getElementById("pendingRA").style.fontWeight="bold";
	  document.getElementById("pendingR").style.borderLeft="3px solid white";  
   }
   function changecolor10()
   {
	  document.getElementById("report").style.backgroundColor="#36c6d3";
	  document.getElementById("acceptR").style.backgroundColor="#36c6d3";
	  document.getElementById("acceptRA").style.color="white";
	   document.getElementById("acceptRA").style.fontWeight="bold";
	  document.getElementById("acceptR").style.borderLeft="3px solid white";  
   }
   function changecolor11()
   {
	  document.getElementById("report").style.backgroundColor="#36c6d3";
	  document.getElementById("rejectR").style.backgroundColor="#36c6d3";
	  document.getElementById("rejectRA").style.color="white";
	   document.getElementById("rejectRA").style.fontWeight="bold";
	  document.getElementById("rejectR").style.borderLeft="3px solid white";  
   }
   function changecolor12()
   {
	   document.getElementById("product").style.backgroundColor="#36c6d3";
	  document.getElementById("productA").style.backgroundColor="#36c6d3";
	  document.getElementById("productA").style.color="white";
	   document.getElementById("productA").style.fontWeight="bold";
	  document.getElementById("productA").style.borderLeft="3px solid white";  
   }

  </script>
  
<!--<script>
if(document.getElementById("orfnotf2")){
	#orfnotf{ display:none; visibility:hidden; }
}  
  </script>-->

<div class="page-sidebar navbar-collapse collapse">
	<ul class="page-sidebar-menu page-header-fixed" data-keep-expanded="false" data-auto-scroll="true" data-slide-speed="200" style="min-height:500px; background:#35414F; color:white;">
	
		<li class="nav-item start" id="dashboard">
			<a href="dashboard.php" class="nav-link" id="dashboardA">
				<i class="glyphicon glyphicon-dashboard"></i>
				<span class="title">Dashboard</span>
				<span class="selected"></span>
			</a>
		</li>

<!--	<li class="heading">
			<h3 class="uppercase">Pages</h3>
		</li>-->
		<li class="nav-item" id="customer">
			<a href="customer-master.php" class="nav-link" id="customerA">
				<i class="glyphicon glyphicon-user"></i>
				<span class="title">Customers
				</span>
			</a>
		</li>
		<li class="nav-item start">
			<a href="javascript:;" id="product" class="nav-link nav-toggle">
				<i class="glyphicon glyphicon-th-large"></i>
				<span class="title">Products</span>
				<span class="selected"></span>
				<span class="arrow"></span>
			</a>
			<ul class="sub-menu">
				<li class="nav-item start open" id="productA">
					<a href="brand-master.php" class="nav-link" id="productA">
						<i class="glyphicon glyphicon-equalizer"></i>
						<span class="title">Brands</span>
					</a>
				</li>
				<li class="nav-item start" id="category">
					<a href="category-detail.php" class="nav-link" id="categoryA">
						<i class="icon-tag"></i>
						<span class="title">Categories</span>
					</a>
				</li>
				<li class="nav-item start" id="products">
					<a href="product_detail.php" class="nav-link" id="productsA">
						<i class="glyphicon glyphicon-record"></i>
						<span class="title">Products</span>
					</a>
				</li>
			</ul>
		</li>

		<li class="nav-item">
			<a href="javascript:;" id="order" class="nav-link">
				<i class="glyphicon glyphicon-shopping-cart"></i>
				<span class="title">Orders
				<span class="badge badge-pill badge-danger" style="margin-left:70px;" id="orfnotf">
						<?php
						$query1=mysqli_query($con,"select * from tbl_master_customer,tbl_transaction where tbl_master_customer.customer_id=tbl_transaction.customer_id and tbl_master_customer.distributor_id='$ver' && tbl_transaction.transaction_status='Pending'");
						$row1  = mysqli_num_rows($query1);
						?>
						<?=$row1;?>
						</span></span>
				<span class="selected"></span>
				<span class="arrow"></span>
			</a>
			<ul class="sub-menu">
				<li class="nav-item start open" id="pending">
					<a href="pending-orders.php" class="nav-link" id="pendingA">
						<i class="icon-list"></i>
						<span class="title">Pending Orders
						<span class="badge badge-pill badge-danger" style="margin-left:30px;" id="orfnotf2">
						<?php
						$query1=mysqli_query($con,"select * from tbl_master_customer,tbl_transaction where tbl_master_customer.customer_id=tbl_transaction.customer_id and tbl_master_customer.distributor_id='$ver' && tbl_transaction.transaction_status='Pending'");
						$row1 = mysqli_num_rows($query1);
						?>
						<?=$row1;?>
						</span>
						</span>
					</a>
				</li>
				<li class="nav-item start" id="accept">
					<a href="accepted-orders.php" class="nav-link" id="acceptA">
						<i class="icon-check"></i>
						<span class="title">Accepted Orders</span>
					</a>
				</li>
				<li class="nav-item start" id="reject">
					<a href="rejected-orders.php" class="nav-link" id="rejectA">
						<i class="icon-ban"></i>
						<span class="title">Rejected Orders</span>
					</a>
				</li>
			</ul>
		</li>
		
		<li class="nav-item">
			<a href="javascript:;" id="report" class="nav-link">
				<i class="glyphicon glyphicon-file"></i>
				<span class="title">Reports</span>
				<span class="selected"></span>
				<span class="arrow"></span>
			</a>
			<ul class="sub-menu">
				<li class="nav-item start open" id="pendingR">
					<a href="pending-order-report.php" class="nav-link" id="pendingRA">
						<i class="glyphicon glyphicon-tasks"></i>
						<span class="title">Pending Orders</span>
					</a>
				</li>
				<li class="nav-item start" id="acceptR">
					<a href="accepted-order-report.php" class="nav-link" id="acceptRA">
						<i class="glyphicon glyphicon-check"></i>
						<span class="title">Accepted Orders</span>
					</a>
				</li>
				<li class="nav-item start" id="rejectR">
					<a href="rejected-order-report.php" class="nav-link" id="rejectRA">
						<i class="glyphicon glyphicon-remove"></i>
						<span class="title">Rejected Orders</span>
					</a>
				</li>
			</ul>
		</li>
		
	</ul>
  
</div>

<!--
<script>
var menuid = "menu-dashboard";
$(function() {
    $('li').removeClass('active');
    $(menuid).addClass("active");
});
</script>-->