<section class="sidebar"> 
  <!-- Sidebar user panel -->
  <div class="user-panel">
    <div class="pull-left image"> <img src="dist/img/user2-160x160.png" class="img-circle" alt="User Image"> </div>
    <div class="pull-left info">
      <p><?php echo $name; ?></p>
      <a href="#"><i class="fa fa-circle text-success"></i> Online</a> </div>
  </div>
  <!-- search form --> 
  <br>
  
  <ul class="sidebar-menu">
    <li class="header"><font color="#00CCFF">MAIN NAVIGATION</font></li>
    <li class="treeview"> <a href="home.php" target="_parent"> <i class="fa fa-home"></i> <span>Dashboard</span> <i class="fa fa-angle-left pull-right"></i> </a> </li>
  <?php $sql_ct = mysqli_query($conn, "SELECT * FROM user_priv_q WHERE emp_id='$emp_id' AND user='$log' GROUP BY cat_id ORDER BY cat_oid ASC");  
  while($row_ct = mysqli_fetch_array($sql_ct)) { $main_cat = $row_ct['cat_id']; ?>
  <li class="treeview"> <a href="#" target="_parent"> <i class="fa fa-check-square-o"></i> <span><?php echo $row_ct['category'];?></span> <i class="fa fa-angle-left pull-right"></i> </a>
    <ul class="treeview-menu">
      <?php $sql_menu = mysqli_query($conn, "SELECT * FROM user_priv_q WHERE emp_id='$emp_id' AND user='$log' AND cat_id='$main_cat' ORDER BY menu_oid ASC");
	while($row_menu = mysqli_fetch_array($sql_menu)) { ?>
      <li><a href="<?php $link = $row_menu['url']; if (strpos($link, '?') !== false) { echo $row_menu['url']; ?>&menu=<?php echo $row_menu['menu_id']; } else { echo $row_menu['url']; ?>?menu=<?php echo $row_menu['menu_id']; }?>" target="_parent"><i class="fa fa-circle-o"></i> <?php echo $row_menu['menu']; ?></a></li>
      <?php } ?>
    </ul>
  </li>
  <?php } ?>
  </ul>
  
 <!-- <ul class="sidebar-menu">
    <li class="header"><font color="#00CCFF">MAIN NAVIGATION</font></li>
    <li class="treeview"> <a href="home.php" target="_parent"> <i class="fa fa-home"></i> <span>Dashboard</span> <i class="fa fa-angle-left pull-right"></i> </a> </li>
	
    <li class="treeview"> <a href="#" target="_parent"> <i class="fa fa-book"></i> <span>Samudra Publications</span> <i class="fa fa-angle-left pull-right"></i> </a>
      <ul class="treeview-menu">
	  
        <li><a href="samudra_pub_cat.php" target="_parent"><i class="fa fa-circle-o"></i>Create Category</a></li>
        <li><a href="samudra_pub_scat.php" target="_parent"><i class="fa fa-circle-o"></i>Create Sub Category</a></li>
        <li><a href="samudrapub_b.php?cat=1" target="_parent"><i class="fa fa-circle-o"></i>Add New Books</a></li>
        <li><a href="samudrapub_cat.php" target="_parent"><i class="fa fa-circle-o"></i>Search Books</a></li>
      </ul>
    </li>
    <li class="treeview"> <a href="#" target="_parent"> <i class="fa fa-book"></i> <span>Other Publications</span> <i class="fa fa-angle-left pull-right"></i> </a>
      <ul class="treeview-menu">
    
        <li><a href="other_pub.php" target="_parent"><i class="fa fa-circle-o"></i>Create Category</a></li>
        <li><a href="other_pub_scat.php" target="_parent"><i class="fa fa-circle-o"></i>Create Sub Category</a></li>
        <li><a href="samudrapub_b.php?cat=2" target="_parent"><i class="fa fa-circle-o"></i> Add New Books</a></li>
		<li><a href="search_book.php" target="_parent"><i class="fa fa-circle-o"></i>Search Books</a></li>
     
      </ul>
    </li>
	   <li class="treeview"> <a href="#" target="_parent"> <i class="fa fa-book"></i> <span>Other</span> <i class="fa fa-angle-left pull-right"></i> </a>
      <ul class="treeview-menu">
        <li ><a href="samudrapub_read.php?val=1" target="_parent"><i class="fa fa-circle-o"></i> Publications</a></li>
        <li><a href="samudrapub_read.php?val=8" target="_parent"><i class="fa fa-circle-o"></i> Forth Coming</a></li>
		<li><a href="samudrapub_b_back.php?cat=7" target="_parent"><i class="fa fa-circle-o"></i> Imported Books</a></li>
        <li><a href="samudrapub_b.php?cat=3" target="_parent"><i class="fa fa-circle-o"></i> Forth Coming</a></li>
        <li><a href="samudrapub_b_back.php?cat=8" target="_parent"><i class="fa fa-circle-o"></i> Medical books</a></li>
        <li><a href="samudrapub_b.php?cat=5" target="_parent"><i class="fa fa-circle-o"></i>Computer  Equipment</a></li>
		<li>
		  <a href="#"><i class="fa fa-circle-o"></i> Educational Equipments<i class="fa fa-angle-left pull-right"></i></a>
		  <ul class="treeview-menu">
			<li><a href="create_cat.php"><i class="fa fa-circle-o"></i> Create Category</a></li>
			<li><a href="create_subcat.php"><i class="fa fa-circle-o"></i> Create Sub Category</a></li>
			<li><a href="samudrapub_b.php?cat=6"><i class="fa fa-circle-o"></i> New Items</a></li>
		  </ul>
		</li>
        <li><a href="samudrapub_b.php?cat=9"><i class="fa fa-circle-o"></i> Bargain Books</a></li>
        <li><a href="samudrapub_b.php?cat=10"><i class="fa fa-circle-o"></i> Gift Vouchers</a></li>
        <li><a href="add_author.php"><i class="fa fa-circle-o"></i> Author</a></li>
        <li><a href="add_publisher.php"><i class="fa fa-circle-o"></i> Publisher</a></li>
      </ul>
    </li>
    <li class="treeview"> <a href="#" target="_parent"> <i class="fa fa-clone"></i> <span>Website</span> <i class="fa fa-angle-left pull-right"></i> </a>
      <ul class="treeview-menu">
	  
	  
        <li><a href="#" target="_parent"><i class="fa fa-circle-o"></i> Edit Menu Items</a></li>
        <li><a href="mail.php" target="_parent"><i class="fa fa-circle-o"></i> User Accounts</a></li>
        <li><a href="update_news.php" target="_parent"><i class="fa fa-circle-o"></i> Update News Bar</a></li>
        <li><a href="#" target="_parent"><i class="fa fa-circle-o"></i> Exam Papers</a></li>
        <li><a href="staff.php" target="_parent"><i class="fa fa-circle-o"></i> Staff Details</a></li>
		
		<li><a href="add_banner.php" target="_parent"><i class="fa fa-circle-o"></i> Banner Images</a></li>
      
        <li><a href="add_gallery_main.php" target="_parent"><i class="fa fa-circle-o"></i> Add Gallery</a></li>
        <li><a href="add_adds.php" target="_parent"><i class="fa fa-circle-o"></i> Upload Adds</a></li>
        <li><a href="add_careers.php" target="_parent"><i class="fa fa-circle-o"></i> Add Careers</a></li>
		
		<li><a href="add_events.php" target="_parent"><i class="fa fa-circle-o"></i> Add Events</a></li>
        <li><a href="add_download.php" target="_parent"><i class="fa fa-circle-o"></i> Add Download</a></li>
      
      </ul>
    </li> 
    
    
    <li class="treeview"> <a href="#" target="_parent"> <i class="fa fa-shopping-cart"></i> <span>Shopping Cart</span> <i class="fa fa-angle-left pull-right"></i> </a>
      <ul class="treeview-menu">
		<li>
		  <a href="#"><i class="fa fa-circle-o"></i> Online Orders<i class="fa fa-angle-left pull-right"></i></a>
		  <ul class="treeview-menu">
			<li><a href="cart_bank_deposits.php" target="_parent"><i class="fa fa-circle-o"></i> Bank Deposits</a></li>
			<li><a href="cart_order_pool.php" target="_parent"><i class="fa fa-circle-o"></i> Order Pool</a></li>
			<li><a href="cart_accepted_orders.php" target="_parent"><i class="fa fa-circle-o"></i> Accepted Orders</a></li>
			<li><a href="cart_delivered_orders_pend.php" target="_parent"><i class="fa fa-circle-o"></i> Post/Courier Orders</a></li>
			<li><a href="cart_delivered_orders.php" target="_parent"><i class="fa fa-circle-o"></i> Delivered Orders</a></li>
			<li><a href="cart_rejected_orders.php" target="_parent"><i class="fa fa-circle-o"></i> Rejected Orders</a></li>
			<li><a href="cart_finished_orders.php" target="_parent"><i class="fa fa-circle-o"></i> Finished Orders</a></li>
			<li><a href="cart_search_orders.php" target="_parent"><i class="fa fa-circle-o"></i> Search Orders</a></li>
		  </ul>
		</li>
		<li>
		  <a href="#"><i class="fa fa-circle-o"></i> Delivery Charges<i class="fa fa-angle-left pull-right"></i></a>
		  <ul class="treeview-menu">
			<li><a href="add_postal_charges.php" target="_parent"><i class="fa fa-circle-o"></i> Postal Charges</a></li>
			<li><a href="add_courier_charges.php" target="_parent"><i class="fa fa-circle-o"></i> Courier Charges</a></li>
			<li><a href="add_EMS_charges.php" target="_parent"><i class="fa fa-circle-o"></i> EMS Charges</a></li>
			<li><a href="add_district.php" target="_parent"><i class="fa fa-circle-o"></i> District</a></li>
		  </ul>
		</li>
		<li>
		  <a href="#"><i class="fa fa-circle-o"></i> Customer List<i class="fa fa-angle-left pull-right"></i></a>
		  <ul class="treeview-menu">
			  <li><a href="registered_customers.php" target="_parent"><i class="fa fa-circle-o"></i> Registered Customers</a></li>
			  <li><a href="guest_user_list.php" target="_parent"><i class="fa fa-circle-o"></i> Guest Users</a></li>
		  </ul>
		</li>

      </ul>
    </li>  

  </ul>-->
</section>