<?php
$Page_Url=$_SERVER['REQUEST_URI'];
$Ex=explode("/",$Page_Url);
$Page=end($Ex);
$Ex1=explode('?',$Page);
$Page2=$Ex1[0];
?>
<!-- Font Awesome -->  
	<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/all.min.css" />
<!-----SweetAlert 2----->
<script src="//cdn.jsdelivr.net/npm/sweetalert2@11"></script>
<!-- CKEDITOR -->
  <script src="https://cdn.ckeditor.com/ckeditor5/34.1.0/classic/ckeditor.js"></script>
<script src="https://code.jquery.com/ui/1.13.2/jquery-ui.js"></script>
<link rel="stylesheet" href="//code.jquery.com/ui/1.13.2/themes/base/jquery-ui.css">
<aside class="main-sidebar sidebar-dark-primary elevation-4">
    <!-- Sidebar -->
    <div class="sidebar">
      <!-- Sidebar user (optional) -->
      <div class="user-panel mt-3 pb-3 mb-3 d-flex">
        
        <div class="info" style="color:#FFFFFF;">
       <span style="font-size: 15px">  Welcome <?php echo ucwords($_COOKIE['User_Name']);?> 
			<?php 
if(strtoupper($_COOKIE['Type'])=='DEALER ADMIN' || strtoupper($_COOKIE['Type'])=='BILLING')
{
	?>
    (Code:<?php echo strtoupper($_COOKIE['O_Code']);?>)
    <?php
}
else if(strtoupper($_COOKIE['Type'])=='ADMIN')
{
?>
(ADMIN)
    <?php
}
	else if(strtoupper($_COOKIE['Type'])=='WAREHOUSE')
{
?>
(WAREHOUSE)
    <?php
}
?>
</span>
        </div>
      </div>
      <!-- SidebarSearch Form -->
      
      <!-- Sidebar Menu -->
      <nav class="mt-2">
        <ul class="nav nav-pills nav-sidebar flex-column" data-widget="treeview" role="menu" data-accordion="false">		
			
			<li class="nav-item">
            <a href="welcome.php" class="nav-link <?php if($Page=='welcome.php'){echo "active";}?>">
              <i class="nav-icon fa-solid fa-house"></i>
              <p>Home</p>
            </a>
          </li>
		
<?php  


if(strtoupper($_COOKIE['Type'])=="WAREHOUSE"){

?>

  <li class="nav-item">
            <a href="import-gold-rol-limit.php" class="nav-link <?php if($Page=='import-gold-rol-limit.php'){echo "active";}?>">
              <i class="nav-icon fa-solid fa-upload"></i>
              <p>ROL Import</p>
            </a>
          </li> 
		  
		  
		  

<?php } ?>
		
			
<?php  


if(strtoupper($_COOKIE['Type'])=="ADMIN"){

?>			

			
			<li class="nav-item <?php if($Page=='gold_price.php' || $Page=='diamond_price.php' || $Page=='stones.php' || $Page=='solitaire_price.php' || $Page=='view-vendor.php' || $Page=='view-product-size.php' || $Page=='view-color.php' || $Page=='import-gold-rol-limit.php'){echo "menu-open";}?>">
				<a href="#" class="nav-link <?php if($Page=='gold_price.php' || $Page=='diamond_price.php' || $Page=='stones.php' || $Page=='solitaire_price.php' || $Page=='view-vendor.php' || $Page=='view-product-size.php' || $Page=='view-color.php' || $Page=='import-gold-rol-limit.php'){echo "active";}?>">
<i class="nav-icon fa-solid fa-gear"></i>
<p>
ADMIN
<i class="fas fa-angle-left right"></i>
</p>
</a>
<ul class="nav nav-treeview">
	
	<li class="nav-item">
            <a href="gold_price.php" class="nav-link <?php if($Page=='gold_price.php'){echo "active";}?>">
              <i class="nav-icon far fa-circle"></i>
              <p>Gold Price</p>
            </a>
          </li>
	
	<li class="nav-item">
            <a href="diamond_price.php" class="nav-link <?php if($Page=='diamond_price.php'){echo "active";}?>">
              <i class="nav-icon far fa-circle"></i>
              <p>Diamond Price</p>
            </a>
          </li>
	
		<li class="nav-item">
            <a href="solitaire_price.php" class="nav-link <?php if($Page=='solitaire_price.php'){echo "active";}?>">
              <i class="nav-icon far fa-circle"></i>
              <p>Solitaire Price</p>
            </a>
          </li>


	
	

  <li class="nav-item">
            <a href="stones.php" class="nav-link <?php if($Page=='stones.php'){echo "active";}?>">
              <i class="nav-icon far fa-circle"></i>
              <p>Stones</p>
            </a>
          </li>         
	

  <li class="nav-item">
            <a href="view-vendor.php" class="nav-link <?php if($Page=='view-vendor.php'){echo "active";}?>">
              <i class="nav-icon far fa-circle"></i>
              <p>Vendors</p>
            </a>
          </li>  

  <li class="nav-item">
            <a href="view-product-size.php" class="nav-link <?php if($Page=='view-product-size.php'){echo "active";}?>">
              <i class="nav-icon far fa-circle"></i>
              <p>Product Size Master</p>
            </a>
          </li> 



  <li class="nav-item">
            <a href="view-color.php" class="nav-link <?php if($Page=='view-color.php'){echo "active";}?>">
              <i class="nav-icon far fa-circle"></i>
              <p>Color Master</p>
            </a>
          </li> 


  <li class="nav-item">
            <a href="import-gold-rol-limit.php" class="nav-link <?php if($Page=='import-gold-rol-limit.php'){echo "active";}?>">
              <i class="nav-icon far fa-circle"></i>
              <p>ROL Import</p>
            </a>
          </li> 
		  
		    <li class="nav-item">
            <a href="view-rol-limit.php" class="nav-link <?php if($Page=='view-rol-limit.php'){echo "active";}?>">
              <i class="nav-icon far fa-circle"></i>
              <p>View ROL</p>
            </a>
          </li>
</ul>
				
				
</li>


<?php } ?>



<?php  


if(strtoupper($_COOKIE['Type'])=="ADMIN"){

?>      

			
			<li class="nav-item <?php if($Page=='add_product_new.php' || $Page=='view_product.php' || $Page2=='add_design_code.php' || $Page2=='view_design_code.php' || $Page2=='add_product_igi.php' || $Page2=='add_products_to_master.php' || $Page2=='export-barcode.php' || $Page2=='view_inserted_products.php' || $Page2=='add_products_to_master_final.php'){echo "menu-open";}?>">
        <a href="#" class="nav-link <?php if($Page=='add_product_new.php' || $Page=='view_product.php' || $Page2=='add_design_code.php' || $Page2=='view_design_code.php'  || $Page2=='add_product_igi.php' || $Page2=='add_products_to_master.php' || $Page2=='export-barcode.php' || $Page2=='view_inserted_products.php' || $Page2=='add_products_to_master_final.php'){echo "active";}?>">
        <i class="nav-icon fa-solid fa-warehouse"></i>
        <p>
        Product
        <i class="right fas fa-angle-left"></i>
        </p>
        </a>
        <ul class="nav nav-treeview">


        <li class="nav-item">
        <a href="add_design_code.php" class="nav-link <?php if($Page=='add_design_code.php'){echo "active";}?>">
        <i class="far fa-circle nav-icon"></i>
        <p>Add Design Code</p>
        </a>
        </li>

        <li class="nav-item">
        <a href="add_product_new.php" class="nav-link <?php if($Page=='add_product_new.php'){echo "active";}?>">
        <i class="far fa-circle nav-icon"></i>
        <p>Insert Product</p>
        </a>
        </li>

        <li class="nav-item">
        <a href="view_inserted_products.php" class="nav-link <?php if($Page=='view_inserted_products.php'){echo "active";}?>">
        <i class="far fa-circle nav-icon"></i>
        <p>View Inserted Products</p>
        </a>
        </li>

        <li class="nav-item">
        <a href="add_product_igi.php" class="nav-link <?php if($Page=='add_product_igi.php'){echo "active";}?>">
        <i class="far fa-circle nav-icon"></i>
        <p>Export For Certification</p>
        </a>
        </li>

        <li class="nav-item">
        <a href="add_products_to_master.php" class="nav-link <?php if($Page=='add_products_to_master.php'){echo "active";}?>">
        <i class="far fa-circle nav-icon"></i>
        <p>Update Certification No</p>
        </a>
        </li>

        <li class="nav-item">
        <a href="add_products_to_master_final.php" class="nav-link <?php if($Page=='add_products_to_master_final.php'){echo "active";}?>">
        <i class="far fa-circle nav-icon"></i>
        <p>Add To Product Master</p>
        </a>
        </li>


        <li class="nav-item">
        <a href="export-barcode.php" class="nav-link <?php if($Page=='export-barcode.php'){echo "active";}?>">
        <i class="far fa-circle nav-icon"></i>
        <p>Export Barcode</p>
        </a>
        </li>

        <li class="nav-item">
        <a href="view_design_code.php" class="nav-link <?php if($Page=='view_design_code.php'){echo "active";}?>">
        <i class="far fa-circle nav-icon"></i>
        <p>View Design Code</p>
        </a>
        </li>

       <li class="nav-item">
        <a href="view_product.php" class="nav-link <?php if($Page=='view_product.php'){echo "active";}?>">
        <i class="far fa-circle nav-icon"></i>
        <p>View Product</p>
        </a>
        </li>

        </ul>
        </li>
			
			
	<li class="nav-item <?php if($Page=='add-collection.php' || $Page=='edit-collection.php' || $Page=='view-collections.php' || $Page=='edit-collection-name.php'){echo "menu-open";}?>">
        <a href="#" class="nav-link <?php if($Page=='add-collection.php' || $Page=='edit-collection.php' || $Page=='view-collections.php' || $Page=='edit-collection-name.php'){echo "active";}?>">
        <i class="nav-icon fa-solid fa-grip"></i>
        <p>
        Collection
        <i class="right fas fa-angle-left"></i>
        </p>
        </a>
        <ul class="nav nav-treeview">

         <li class="nav-item">
        <a href="add-collection.php" class="nav-link <?php if($Page=='add-collection.php'){echo "active";}?>">
        <i class="far fa-circle nav-icon"></i>
        <p>Add Collection</p>
        </a>
        </li>

        <li class="nav-item">
        <a href="view-collections.php" class="nav-link <?php if($Page=='view-collections.php'){echo "active";}?>">
        <i class="far fa-circle nav-icon"></i>
        <p>View Collection</p>
        </a>
        </li>

        </ul>
        </li>		
			
			
	<li class="nav-item <?php if($Page=='create_category_discount.php' || $Page=='edit_category_discount.php' || $Page=='view-gold-category-discount.php'){echo "menu-open";}?>">
        <a href="#" class="nav-link <?php if($Page=='create_category_discount.php' || $Page=='edit_category_discount.php' || $Page=='view-gold-category-discount.php'){echo "active";}?>">
        <i class="nav-icon fa-solid fa-percentage"></i>
        <p>
        Discount
        <i class="right fas fa-angle-left"></i>
        </p>
        </a>
        <ul class="nav nav-treeview">

         <li class="nav-item">
        <a href="create_category_discount.php" class="nav-link <?php if($Page=='create_category_discount.php'){echo "active";}?>">
        <i class="far fa-circle nav-icon"></i>
        <p>Add Discount</p>
        </a>
        </li>

        <li class="nav-item">
        <a href="view-gold-category-discount.php" class="nav-link <?php if($Page=='view-gold-category-discount.php'){echo "active";}?>">
        <i class="far fa-circle nav-icon"></i>
        <p>View Discount</p>
        </a>
        </li>

        </ul>
        </li>		
			

<?php } ?>

		<?php 
    if(strtoupper($_COOKIE['Type'])!='WAREHOUSE')
    {
      ?>
	<li class="nav-item <?php if($Page=='billing.php' || $Page=='view_bills.php' || $Page=='view_admin_bills.php'){echo "menu-open";}?>">
        <a href="#" class="nav-link <?php if($Page=='billing.php' || $Page=='view_bills.php' || $Page=='view_admin_bills.php'){echo "active";}?>">
        <i class="nav-icon fa-solid fa-warehouse"></i>
        <p>
        Bill
        <i class="right fas fa-angle-left"></i>
        </p>
        </a>
        <ul class="nav nav-treeview">

 <?php  

if(strtoupper($_COOKIE['Type'])=="DEALER ADMIN" || strtoupper($_COOKIE['Type'])=="BILLING"){

?> 

        <li class="nav-item">
        <a href="billing.php" class="nav-link <?php if($Page=='billing.php'){echo "active";}?>">
        <i class="far fa-circle nav-icon"></i>
        <p>New Bill</p>
        </a>
        </li>

        <li class="nav-item">
        <a href="view_bills.php" class="nav-link <?php if($Page=='view_bills.php'){echo "active";}?>">
        <i class="far fa-circle nav-icon"></i>
        <p>View Bills</p>
        </a>
        </li>

<?php } ?>        
			
 <?php  

if(strtoupper($_COOKIE['Type'])=="ADMIN"){

?> 

        <li class="nav-item">
        <a href="view_admin_bills.php" class="nav-link <?php if($Page=='view_admin_bills.php'){echo "active";}?>">
        <i class="far fa-circle nav-icon"></i>
        <p>View Bills</p>
        </a>
        </li>

<?php }?>    			
			

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

		<li class="nav-item <?php if($Page=='new-stn.php' || $Page=='pending-stn.php' || $Page=='completed-stn.php' || $Page=='scan-product.php' || $Page=='view-gold-grn.php'){echo "menu-open";}?>">
        <a href="#" class="nav-link <?php if($Page=='new-stn.php' || $Page=='pending-stn.php' || $Page=='completed-stn.php' || $Page=='scan-product.php' || $Page=='view-gold-grn.php'){echo "active";}?>">
        <i class="nav-icon fa-solid fa-pen-to-square"></i>
        <p>
        STN
        <i class="right fas fa-angle-left"></i>
        </p>
        </a>
        <ul class="nav nav-treeview">
 <?php  

if(strtoupper($_COOKIE['Type'])=="ADMIN" || strtoupper( $_COOKIE['Type'])=='WAREHOUSE'){

?> 

        <li class="nav-item">
        <a href="new-stn.php" class="nav-link <?php if($Page=='new-stn.php'){echo "active";}?>">
        <i class="far fa-circle nav-icon"></i>
        <p>New STN</p>
        </a>
        </li>

        <li class="nav-item">
        <a href="pending-stn.php" class="nav-link <?php if($Page=='pending-stn.php'){echo "active";}?>">
        <i class="far fa-circle nav-icon"></i>
        <p>Pending STN</p>
        </a>
        </li>

         <li class="nav-item">
        <a href="completed-stn.php" class="nav-link <?php if($Page=='completed-stn.php'){echo "active";}?>">
        <i class="far fa-circle nav-icon"></i>
        <p>Completed STN</p>
        </a>
        </li>

		<?php } ?> 
		

 <?php  

if(strtoupper($_COOKIE['Type'])=="DEALER ADMIN" || strtoupper( $_COOKIE['Type'])=="BILLING"){

?>  

		 <li class="nav-item">
        <a href="scan-product.php" class="nav-link <?php if($Page=='scan-product.php'){echo "active";}?>">
        <i class="far fa-circle nav-icon"></i>
        <p>Receive Product</p>
        </a>
        </li>
		
		
		 <li class="nav-item">
        <a href="view-gold-grn.php" class="nav-link <?php if($Page=='view-gold-grn.php'){echo "active";}?>">
        <i class="far fa-circle nav-icon"></i>
        <p>View GRN</p>
        </a>
        </li>
		
		
		    <?php } ?> 
	 



        </ul>
        </li>
          


 <?php  

if(strtoupper($_COOKIE['Type'])=="DEALER ADMIN" || strtoupper($_COOKIE['Type'])=="BILLING"){

?> 

      <li class="nav-item <?php if($Page=='dealer-stock-report.php'){echo "menu-open";}?>">
        <a href="#" class="nav-link <?php if($Page=='dealer-stock-report.php'){echo "active";}?>">
        <i class="nav-icon fa-solid fa-boxes-stacked"></i>
        <p>
        Stock
        <i class="right fas fa-angle-left"></i>
        </p>
        </a>
        <ul class="nav nav-treeview">


        <li class="nav-item">
        <a href="dealer-stock-report.php" class="nav-link <?php if($Page=='dealer-stock-report.php'){echo "active";}?>">
        <i class="far fa-circle nav-icon"></i>
        <p>My Stock</p>
        </a>
        </li>

        
        

        </ul>
        </li>


<?php } ?>  



<?php  

if(strtoupper($_COOKIE['Type'])!="DEALER ADMIN" && strtoupper($_COOKIE['Type'])!="BILLING"){

?> 
      <li class="nav-item <?php if($Page=='stock-summary.php' || $Page=='vendor-bill-wise-report.php' || $Page=='stock-report.php'){echo "menu-open";}?>">
        <a href="#" class="nav-link <?php if($Page=='stock-summary.php' || $Page=='vendor-bill-wise-report.php'  || $Page=='stock-report.php' ){echo "active";}?>">
        <i class="nav-icon fa-solid fa-file-lines"></i>
        <p>
        Report
        <i class="right fas fa-angle-left"></i>
        </p>
        </a>
        <ul class="nav nav-treeview">

 <?php  

if(strtoupper($_COOKIE['Type'])=="ADMIN"){

?> 
        <li class="nav-item">
        <a href="vendor-bill-wise-report.php" class="nav-link <?php if($Page=='vendor-bill-wise-report.php'){echo "active";}?>">
        <i class="far fa-circle nav-icon"></i>
        <p>Vendor Bill Wise Report</p>
        </a>
        </li>
<?php } ?> 

 <?php  

if(strtoupper($_COOKIE['Type'])=="ADMIN" || strtoupper($_COOKIE['Type'])=='WAREHOUSE'){

?> 
        
        <li class="nav-item">
        <a href="stock-report.php" class="nav-link <?php if($Page=='stock-report.php'){echo "active";}?>">
        <i class="far fa-circle nav-icon"></i>
        <p>Warehouse Stock Report</p>
        </a>
        </li>

<?php } ?>  

 <?php  

if(strtoupper($_COOKIE['Type'])=="DEALER ADMIN" || strtoupper($_COOKIE['Type'])=="BILLING"){

?> 
        
<!--         <li class="nav-item">
        <a href="stock-summary.php" class="nav-link <?php if($Page=='stock-summary.php'){echo "active";}?>">
        <i class="far fa-circle nav-icon"></i>
        <p>Stock Summary</p>
        </a>
        </li> -->

<?php } ?>  

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

if(strtoupper($_COOKIE['Type'])=="DEALER ADMIN"){

?> 
      
          <li class="nav-item">
            <a href="stock-price-check.php" class="nav-link <?php if($Page=='stock-price-check.php'){echo "active";}?>">
              <i class="nav-icon fa-solid fa-circle-info"></i>
              <p>View Item Details</p>
            </a>
          </li>
          <?php } ?>  
          <li class="nav-item">
            <a href="logout.php" class="nav-link">
              <i class="nav-icon fas fa-power-off"></i>
              <p>
                Logout
                
              </p>
            </a>
          </li>
          
          
        
          
        </ul>
      </nav>
      <!-- /.sidebar-menu -->
    </div>
    <!-- /.sidebar -->
  </aside>