<?php 
 $sql = "select page_id, page_id as view_page_id from user_roll_manage where user_id='".$_SESSION['user']['id']."' group by id";
 $query = mysqli_query($conn,$sql);
 while($info=mysqli_fetch_object($query)){
 $view_page_id[$info->page_id]=$info->view_page_id;

	}
	
	
	
  $sql = "select feature_id, feature_id as view_feature_id from user_roll_manage r, page_setup p 
 where r.order_no=p.id and r.user_id='".$_SESSION['user']['id']."' group by p.feature_id";
 $query = mysqli_query($conn,$sql);
 while($info=mysqli_fetch_object($query)){
 $view_feature_id[$info->feature_id]=$info->view_feature_id;
	}
	
					
					
?>


<aside id="sidebar" class="sidebar">

    <ul class="sidebar-nav" id="sidebar-nav" >

      <li class="nav-item">
	  
        <a class="nav-link  <?php if($menu_id==11) {echo '';}else {echo 'collapsed';}?>" href="home.php?active_id=1101&menu_id=11">
          <i class="bi bi-grid"></i>
          <span>Dashboard</span>
        </a>
      </li><!-- End Dashboard Nav -->
	  
	  <?php if($view_feature_id[1]==1) {?>
	  
        <li class="nav-item" >
        <a class="nav-link <?php if($menu_id==1) {echo '';}else {echo 'collapsed';}?>" data-bs-target="#components-nav" data-bs-toggle="collapse" href="#">
          <i class="bi bi-menu-button-wide"></i><span>Admin Panel</span><i class="bi bi-chevron-down ms-auto"></i>
        </a>
        <ul id="components-nav" class="nav-content collapse <?php if($menu_id==1) {echo 'show';}?>" data-bs-parent="#sidebar-nav">
		
		<?php if($view_page_id[803]==803) {?>
		  <li>
            <a href="83_company_info.php?active_id=803&menu_id=1" class="<?php if($active_id==803) {echo 'active';}?>">
              <i class="bi bi-circle"></i><span>Company Info</span>
            </a>
          </li>
		<?php }?>
		
		<?php if($view_page_id[801]==801) {?>
          <li>
            <a href="81_user_01.php?active_id=801&menu_id=1" class="<?php if($active_id==801) {echo 'active';}?>">
              <i class="bi bi-circle"></i><span>User Register</span>
            </a>
          </li>
        <?php }?> 
		
		<?php if($view_page_id[802]==802) {?>
		<li>
            <a href="81_user_roll.php?active_id=802&menu_id=1" class="<?php if($active_id==802) {echo 'active';}?>">
              <i class="bi bi-circle"></i><span>User Roll Activity </span>
            </a>
          </li> 
		 <?php }?> 
        </ul>
      </li><!-- End Components Nav -->
	   <?php }?> 
	  
	  
	 <?php if($view_feature_id[2]==2) {?>
	  <li class="nav-item">
        <a class="nav-link <?php if($menu_id==2) {echo '';}else {echo 'collapsed';}?>" data-bs-target="#Ledger-nav" data-bs-toggle="collapse" href="#">
          <i class="bi bi-journal-text"></i><span>General Ledger</span><i class="bi bi-chevron-down ms-auto"></i>
        </a>
        <ul id="Ledger-nav" class="nav-content collapse <?php if($menu_id==2) {echo 'show';}?>" data-bs-parent="#sidebar-nav">
          
		  <?php if($view_page_id[101]==101) {?>
          <li>
            <a href="01_acc_class.php?active_id=101&menu_id=2" class="<?php if($active_id==101) {echo 'active';}?>">
              <i class="bi bi-circle"></i><span>Account Class</span>
            </a>
          </li>
		  <?php } if($view_page_id[102]==102) {?> 
		  
          <li>
            <a href="02_acc_sub_class.php?active_id=102&menu_id=2" class="<?php if($active_id==102) {echo 'active';}?>">
             <i class="bi bi-circle"></i><span>Account Sub Class</span>
            </a>
          </li>
		  <?php }if($view_page_id[103]==103) {?>
          <li>
            <a href="03_acc_group.php?active_id=103&menu_id=2" class="<?php if($active_id==103) {echo 'active';}?>">
             <i class="bi bi-circle"></i><span>Account Group</span>
            </a>
          </li>
		  <?php }if($view_page_id[104]==104) {?>
		  <li>
            <a href="04_acc_ledger.php?active_id=104&menu_id=2" class="<?php if($active_id==104) {echo 'active';}?>">
             <i class="bi bi-circle"></i><span>GL Account</span>
            </a>
          </li>
		  <?php }if($view_page_id[105]==105) {?>
		  <li>
            <a href="05_acc_coa_report.php?active_id=105&menu_id=2" class="<?php if($active_id==105) {echo 'active';}?>">
             <i class="bi bi-circle"></i><span>Chart of Accounts</span>
            </a>
          </li>
		   <?php }if($view_page_id[106]==106) {?>
		  <li>
            <a href="06_acc_sub_ledger_type.php?active_id=106&menu_id=2" class="<?php if($active_id==106) {echo 'active';}?>">
             <i class="bi bi-circle"></i><span>Sub Ledger Type</span>
            </a>
          </li>
		  <?php }if($view_page_id[107]==107) {?>
		  <li>
            <a href="07_acc_sub_ledger.php?active_id=107&menu_id=2" class="<?php if($active_id==107) {echo 'active';}?>">
             <i class="bi bi-circle"></i><span>Account Sub Ledger</span>
            </a>
          </li>
		  <?php }?>
        </ul>
      </li>
	  <?php }?>
	  
	  <?php if($view_feature_id[3]==3) {?>
	   <li class="nav-item">
        <a class="nav-link <?php if($menu_id==3) {echo '';}else {echo 'collapsed';}?>" data-bs-target="#voucher-nav" data-bs-toggle="collapse" href="#">
          <i class="bi bi-layout-text-window-reverse"></i><span>General Voucher</span><i class="bi bi-chevron-down ms-auto"></i>
        </a>
        <ul id="voucher-nav" class="nav-content collapse <?php if($menu_id==3) {echo 'show';}?>" data-bs-parent="#sidebar-nav">
		  <?php if($view_page_id[301]==301) {?>
          <li>
            <a href="21_voucher.php?active_id=301&menu_id=3" class="<?php if($active_id==301) {echo 'active';}?>">
              <i class="bi bi-circle"></i><span>Receipt Voucher</span>
            </a>
          </li>
		  <?php }if($view_page_id[302]==302) {?>
          <li>
            <a href="22_voucher.php?active_id=302&menu_id=3" class="<?php if($active_id==302) {echo 'active';}?>">
              <i class="bi bi-circle"></i><span>Payment Voucher</span>
            </a>
          </li>
		   <?php }if($view_page_id[303]==303) {?>
		  <li>
            <a href="23_voucher.php?active_id=303&menu_id=3" class="<?php if($active_id==303) {echo 'active';}?>">
              <i class="bi bi-circle"></i><span>Journal Voucher</span>
            </a>
          </li>
		  <?php }if($view_page_id[304]==304) {?>
		  <li>
            <a href="24_voucher.php?active_id=304&menu_id=3" class="<?php if($active_id==304) {echo 'active';}?>">
              <i class="bi bi-circle"></i><span>Contra Voucher</span>
            </a>
          </li>
		  <?php }if($view_page_id[309]==309) {?>
		  <li>
            <a href="29_voucher_iou_settlement.php?active_id=309&menu_id=3" class="<?php if($active_id==309) {echo 'active';}?>">
              <i class="bi bi-circle"></i><span>IOU Settlement</span>
            </a>
          </li>
		   <?php }if($view_page_id[305]==305) {?>
		  <li>
            <a href="25_voucher.php?active_id=305&menu_id=3" class="<?php if($active_id==305) {echo 'active';}?>">
              <i class="bi bi-circle"></i><span>Draft Voucher</span>
            </a>
          </li>
		  <?php }if($view_page_id[306]==306) {?>
		  <li>
            <a href="26_voucher.php?active_id=306&menu_id=3" class="<?php if($active_id==306) {echo 'active';}?>">
              <i class="bi bi-circle"></i><span>Edit Voucher</span>
            </a>
          </li>
		  <?php }if($view_page_id[307]==307) {?>
		  <li>
            <a href="27_voucher.php?active_id=307&menu_id=3" class="<?php if($active_id==307) {echo 'active';}?>">
              <i class="bi bi-circle"></i><span>Voucher Approval</span>
            </a>
          </li>
		   <?php }if($view_page_id[308]==308) {?>
		  <li>
            <a href="28_voucher_view.php?active_id=308&menu_id=3" class="<?php if($active_id==308) {echo 'active';}?>">
              <i class="bi bi-circle"></i><span>Voucher View</span>
            </a>
          </li>
		   <?php }?>
		  
        </ul>
      </li>
	   <?php }?>
	  
	  
	  
 <?php if($view_feature_id[4]==4) {?>
      <li class="nav-item">
        <a class="nav-link <?php if($menu_id==4) {echo '';}else {echo 'collapsed';}?>" data-bs-target="#products-nav" data-bs-toggle="collapse" href="#">
          <i class="bi bi-grid-1x2"></i><span>Products &amp; Services</span><i class="bi bi-chevron-down ms-auto"></i>
        </a>
        <ul id="products-nav" class="nav-content collapse <?php if($menu_id==4) {echo 'show';}?>" data-bs-parent="#sidebar-nav">
		<?php if($view_page_id[401]==401) {?>
          <li>
            <a href="31_product.php?active_id=401&menu_id=4" class="<?php if($active_id==401) {echo 'active';}?>">
              <i class="bi bi-circle"></i><span>Category</span>
            </a>
          </li>
		   <?php }if($view_page_id[402]==402) {?>
          <li>
            <a href="33_product_service.php?active_id=402&menu_id=4" class="<?php if($active_id==402) {echo 'active';}?>">
              <i class="bi bi-circle"></i><span>Products Info</span>
            </a>
          </li>
		  <?php }if($view_page_id[403]==403) {?>
          <li>
            <a href="37_product_all.php?active_id=403&menu_id=4" class="<?php if($active_id==403) {echo 'active';}?>">
              <i class="bi bi-circle"></i><span>All Products &amp; Services</span>
            </a>
          </li>
          <?php }?>
        </ul>
      </li><!-- End Forms Nav -->
	  <?php }?>
	  
	  
	  <?php if($view_feature_id[10]==10) {?>
	  <li class="nav-item">
        <a class="nav-link <?php if($menu_id==10) {echo '';}else {echo 'collapsed';}?>" data-bs-target="#cattle-nav" data-bs-toggle="collapse" href="#">
          <i class="bi bi-c-square"></i><span>Inventory Management</span><i class="bi bi-chevron-down ms-auto"></i>
        </a>
        <ul id="cattle-nav" class="nav-content collapse <?php if($menu_id==10) {echo 'show';}?>" data-bs-parent="#sidebar-nav">
		<?php if($view_page_id[1001]==1001) {?>
          <li>
            <a href="1002_bill_of_materials.php?active_id=1001&menu_id=10" class="<?php if($active_id==1001) {echo 'active';}?>">
              <i class="bi bi-circle"></i><span>Bill of Materials</span>
            </a>
          </li>
		   <?php }if($view_page_id[1002]==1002) {?>
          <li>
            <a href="1002_batch_production_status.php?active_id=1002&menu_id=10" class="<?php if($active_id==1002) {echo 'active';}?>">
              <i class="bi bi-circle"></i><span>Batch Production</span>
            </a>
          </li>
		   <?php }?>
        </ul>
      </li>
	   <?php }?>
	  
	 <?php if($view_feature_id[5]==5) {?>
      <li class="nav-item">
        <a class="nav-link <?php if($menu_id==5) {echo '';}else {echo 'collapsed';}?>" data-bs-target="#customer-nav" data-bs-toggle="collapse" href="#">
          <i class="bi bi-cart"></i><span>Sales Management</span><i class="bi bi-chevron-down ms-auto"></i>
        </a>
        <ul id="customer-nav" class="nav-content collapse <?php if($menu_id==5) {echo 'show';}?>" data-bs-parent="#sidebar-nav">
		<?php if($view_page_id[501]==501)  {?>
		  <li>
            <a href="41_customer_add.php?active_id=501&menu_id=5" class="<?php if($active_id==501) {echo 'active';}?>">
              <i class="bi bi-circle"></i><span>Customer  </span>
            </a>
          </li>
		 <?php }if($view_page_id[507]==507)  {?>
		  <li>
            <a href="47_customer_invoice_status.php?active_id=507&menu_id=5" class="<?php if($active_id==507) {echo 'active';}?>">
              <i class="bi bi-circle"></i><span>Sales Invoice Status </span>
            </a>
          </li>
		   <?php }if($view_page_id[506]==506)  {?>
		  <li>
            <a href="47_customer_invoice_journal.php?active_id=506&menu_id=5" class="<?php if($active_id==506) {echo 'active';}?>">
              <i class="bi bi-circle"></i><span>Sales Invoice Journal </span>
            </a>
          </li>
		   <?php }if($view_page_id[503]==503)  {?>
		  <li>
            <a href="47_customer_sales_price.php?active_id=503&menu_id=5" class="<?php if($active_id==503) {echo 'active';}?>">
              <i class="bi bi-circle"></i><span>Customer Sales Price </span>
            </a>
          </li>
		   <?php }if($view_page_id[505]==505)  {?>
		  <li>
            <a href="1001_coupon_generate.php?active_id=505&menu_id=5" class="<?php if($active_id==505) {echo 'active';}?>">
              <i class="bi bi-circle"></i><span>Coupon Entry</span>
            </a>
          </li>
		   <?php }?>
        </ul>
      </li><!-- End Tables Nav -->
	    <?php }?>
	  
<?php if($view_feature_id[6]==6) {?>
      <li class="nav-item">
        <a class="nav-link <?php if($menu_id==6) {echo '';}else {echo 'collapsed';}?>" data-bs-target="#supplier-nav" data-bs-toggle="collapse" href="#">
          <i class="bi bi-handbag"></i><span>Purchase Management</span><i class="bi bi-chevron-down ms-auto"></i>
        </a>
        <ul id="supplier-nav" class="nav-content collapse <?php if($menu_id==6) {echo 'show';}?>" data-bs-parent="#sidebar-nav">
		<?php if($view_page_id[601]==601) {?>
          <li>
            <a href="51_supplier_add.php?active_id=601&menu_id=6" class="<?php if($active_id==601) {echo 'active';}?>">
              <i class="bi bi-circle"></i><span>Supplier</span>
            </a>
          </li>
		    <?php }if($view_page_id[602]==602) {?>
          <li>
            <a href="52_supplier_all.php?active_id=602&menu_id=6" class="<?php if($active_id==602) {echo 'active';}?>">
              <i class="bi bi-circle"></i><span>All Suppliers</span>
            </a>
          </li>
		   <?php }if($view_page_id[603]==603) {?>
		  <li>
            <a href="53_supplier_po.php?active_id=603&menu_id=6" class="<?php if($active_id==603) {echo 'active';}?>">
              <i class="bi bi-circle"></i><span>Purchase Bill</span>
            </a>
          </li>
		   <?php }if($view_page_id[604]==604) {?>
		  
		  <li>
            <a href="54_supplier_pay_bill.php?active_id=604&menu_id=6" class="<?php if($active_id==604) {echo 'active';}?>">
              <i class="bi bi-circle"></i><span>Pay Bill</span>
            </a>
          </li>
          <?php }?>
        </ul>
      </li><!-- End Charts Nav -->
	   <?php }?>
	  
	  <?php if($view_feature_id[7]==7) {?>
	  <li class="nav-item">
        <a class="nav-link <?php if($menu_id==7) {echo '';}else {echo 'collapsed';}?>" data-bs-target="#hrm-nav" data-bs-toggle="collapse" href="#">
          <i class="bi bi-people"></i><span>HR Management</span><i class="bi bi-chevron-down ms-auto"></i>
        </a>
        <ul id="hrm-nav" class="nav-content collapse <?php if($menu_id==7) {echo 'show';}?>" data-bs-parent="#sidebar-nav">
		<?php if($view_page_id[704]==704) {?>
		 <li>
            <a href="71_employee_01.php?active_id=704&menu_id=7" class="<?php if($active_id==704) {echo 'active';}?>">
              <i class="bi bi-circle"></i><span>Employee Info</span>
            </a>
          </li>
		  <?php }if($view_page_id[708]==708) {?> 
		   <li>
            <a href="71_employee_holyday.php?active_id=708&menu_id=7" class="<?php if($active_id==708) {echo 'active';}?>">
              <i class="bi bi-circle"></i><span>Holiday Entry</span>
            </a>
          </li>
		<?php }if($view_page_id[702]==702) {?> 
		  <li>
            <a href="71_employee_04.php?active_id=702&menu_id=7" class="<?php if($active_id==702) {echo 'active';}?>">
              <i class="bi bi-circle"></i><span>Daily Attendance</span>
            </a>
          </li>
		 <?php }if($view_page_id[709]==709) {?>  
		  <li>
            <a href="71_employee_attendance_details.php?active_id=709&menu_id=7" class="<?php if($active_id==709) {echo 'active';}?>">
              <i class="bi bi-circle"></i><span>Attendance Report</span>
            </a>
          </li>
		   <?php }if($view_page_id[706]==706) {?> 
		   <li>
            <a href="71_employee_leave.php?active_id=706&menu_id=7" class="<?php if($active_id==706) {echo 'active';}?>">
              <i class="bi bi-circle"></i><span>Leave Application</span>
            </a>
          </li>
		   <?php }if($view_page_id[712]==712) {?> 
		  <li>
            <a href="71_employee_leave_status.php?active_id=712&menu_id=7" class="<?php if($active_id==712) {echo 'active';}?>">
              <i class="bi bi-circle"></i><span>Leave Status</span>
            </a>
          </li>
		  <?php }if($view_page_id[703]==703) {?>
		  <li>
            <a href="71_employee_05.php?active_id=703&menu_id=7" class="<?php if($active_id==703) {echo 'active';}?>">
              <i class="bi bi-circle"></i><span>Employee Advance</span>
            </a>
          </li>
		   <?php }if($view_page_id[707]==707) {?>
		  <li>
            <a href="71_employee_advance_schedule.php?active_id=707&menu_id=7" class="<?php if($active_id==707) {echo 'active';}?>">
              <i class="bi bi-circle"></i><span>Advance Schedule</span>
            </a>
          </li>
		  <?php }if($view_page_id[711]==711) {?>
		  <li>
            <a href="71_employee_advance_closing.php?active_id=711&menu_id=7" class="<?php if($active_id==711) {echo 'active';}?>">
              <i class="bi bi-circle"></i><span>Advance Closing</span>
            </a>
          </li>
         <?php }if($view_page_id[705]==705) {?>
		   <li>
            <a href="71_employee_salary_provision.php?active_id=705&menu_id=7" class="<?php if($active_id==705) {echo 'active';}?>">
              <i class="bi bi-circle"></i><span>Salary Provision</span>
            </a>
          </li>
         <?php }if($view_page_id[701]==701) {?>
		    <li>
            <a href="71_employee_03.php?active_id=701&menu_id=7" class="<?php if($active_id==701) {echo 'active';}?>">
              <i class="bi bi-circle"></i><span>Generate Payroll</span>
            </a>
          </li>
		  <?php }if($view_page_id[710]==710) {?>
		  <li>
            <a href="71_employee_salary_payment.php?active_id=710&menu_id=7" class="<?php if($active_id==710) {echo 'active';}?>">
              <i class="bi bi-circle"></i><span>Salary Payment</span>
            </a>
          </li>
		  <?php }if($view_page_id[713]==713) {?>
		  <li>
            <a href="71_employee_additional_salary_payment.php?active_id=713&menu_id=7" class="<?php if($active_id==713) {echo 'active';}?>">
              <i class="bi bi-circle"></i><span>Additional Salary Pay</span>
            </a>
          </li>
		 <?php }  ?>
        </ul>
      </li><!-- End Icons Nav -->
	  <?php }?>
	  
	  
	  <?php if($view_feature_id[12]==12) {?>
	   <li class="nav-item">
        <a class="nav-link <?php if($menu_id==12) {echo '';}else {echo 'collapsed';}?>" data-bs-target="#adv_reports-nav" data-bs-toggle="collapse" href="#">
          <i class="bi bi-bar-chart-line"></i><span>Advanced Reports</span><i class="bi bi-chevron-down ms-auto"></i>
        </a>
        <ul id="adv_reports-nav" class="nav-content collapse <?php if($menu_id==12) {echo 'show';}?>" data-bs-parent="#sidebar-nav">
		<?php if($view_page_id[1201]==1201) {?>
          <li>
            <a href="01_advanced_reports.php?active_id=1201&menu_id=12" class="<?php if($active_id==1201) {echo 'active';}?>">
              <i class="bi bi-circle"></i><span>Advanced Reports</span>
            </a>
          </li>
		   <?php }?>
        </ul>
      </li>
	  <?php }?>
	  
	  
	  <?php /*?><li class="nav-item">
        <a class="nav-link <?php if($menu_id==8) {echo '';}else {echo 'collapsed';}?>" href="71_employee_01.php?active_id=1001&menu_id=8">
          <i class="bi bi-person"></i>
          <span>Employee</span>
        </a>
      </li><?php */?><!-- End Profile Page Nav -->
	
	  <li class="nav-item">
        <a class="nav-link <?php if($menu_id==9) {echo '';}else {echo 'collapsed';}?>" href="61_reports_all.php?active_id=901&menu_id=9">
          <i class="bi bi-bar-chart-line"></i>
          <span>Reports</span>
        </a>
      </li>
	  

      <li class="nav-item">
        <a class="nav-link collapsed" href="sign_out.php">
          <i class="bi bi-box-arrow-in-right"></i>
          <span>Sign Out</span>
        </a>
      </li><!-- End Login Page Nav -->

   
    </ul>

  </aside>