<?php 
include "config.php";
session_start();
$user=$_SESSION['log'];
date_default_timezone_set("Asia/Calcutta");
if ($user=="" || date("Y/m/d") > '2026/10/31')
{
    header("location:index.php");
}
?>
<html lang="en">
  
<head>
  <title>feenix</title>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <link rel="stylesheet" href="fontawesome-free-5.15.1-web/css/all.css">
  <link rel="stylesheet" href="tablehead.css">
  <link rel="stylesheet" href="bootstrap/min.css">
  <!-- <script src="bootstrap/jquery.min.js"></script> -->
  <script src="bootstrap/popper.min.js"></script>
  <script src="bootstrap/bootstrap.js"></script>
  
  <style>
      
      li
      {
          padding-bottom:10px;
          font-size:18px;
          
      }
      .report
      {
        padding-top:13px;
      }
      .transaction
      {
        padding-top:8px;
      }
      .navselect
      {
          color:white;
      }
      li a:hover
      { 
          color:black;
          text-decoration:none;
          cursor:pointer;
      }
      .navbar-brand
      {
          color:white;
      }
      li a i
      {
          margin-right:5px;
          font-size:20px;
          
      }
      ::-webkit-scrollbar {
    width: 5px !important; 
  }
  ::-webkit-scrollbar {
    width: 5px !important; 
  }
  /* Track */
  ::-webkit-scrollbar-track {
    background: white !important;
  }
  
  /* Handle */
  ::-webkit-scrollbar-thumb {
    background: #888 !important;
  }
  
  /* Handle on hover */
  ::-webkit-scrollbar-thumb:hover {
    background: black !important;
  }
  nav, #content{
    overflow-x:hidden;
  }
  nav a:hover
  {
    color:#FFD700 ;
  }
  #dropdown-menu a:hover
  {
 color:rgba(24, 7, 173);
  }
  #navbar,.navbar
  {
    background-color:rgba(24, 7, 173) !important;
  }
  input[type="text"]:read-only{
    background-color:rgba(232, 229, 220,0.7) !important;
    border:1px solid lightgrey;
    border-radius:5px;
  }
  </style>
  <script>
    $('li').click(function(){
    $(this).css('color','red');
});
    </script>
    <script>
  $(document).on('focus', '.select2-selection.select2-selection--single', function (e) {
  $(this).closest(".select2-container").siblings('select:enabled').select2('open');
});
</script>
</head>
<BODY>
<?php 
  $cus=mysqli_query($connect,"select * from employeedetails where username='$user' && status !='deleted' && statuslive = '1'");
  while($cusshow = mysqli_fetch_array($cus))
  {
  ?>
  
<!-- general -->

<nav class="navbar bg-info fixed-left" >
  
  <a class="navbar-brand" href="#">FEENIX</a>
  
  
      <!-- res -->
      <ul class="navbar-nav">
    <li class="nav-item"style=" margin-top: 30px;">
      <a class="nav-link navselect"  href="home.php"> <i class="fas fa-chart-line"></i>  Dashboard</a>
    </li>
    <li class="nav-item">
    <div class="dropdown">
    <a class=" dropdown-toggle navselect" data-toggle="dropdown"><i class="fas fa-graduation-cap"></i>Master</a>
     
    <div class="dropdown-menu">
    <?php 
        $userall=$_SESSION['log'];
        $usper = mysqli_query($connect,"select * from userpermission where username = '$userall' && filename='productmaster'");
while($per=mysqli_fetch_array($usper))
{
          ?>
         
      <a  class="dropdown-item" href="itemmaster.php"  <?php if($per['datashow'] !='1'){ echo 'style="display:none"';} ?>>Product</a><?php } ?>
      <?php 
        $userall=$_SESSION['log'];
        $usper = mysqli_query($connect,"select * from userpermission where username = '$userall' && filename='customermaster'");
while($per=mysqli_fetch_array($usper))
{
          ?>
      <a class="dropdown-item" href="mastercustomer.php" <?php if($per['datashow'] !='1'){ echo 'style="display:none"';} ?>>Customer</a><?php } ?>
      <?php 
        $userall=$_SESSION['log'];
        $usper = mysqli_query($connect,"select * from userpermission where username = '$userall' && filename='vehiclemaster'");
while($per=mysqli_fetch_array($usper))
{
          ?>
      <a class="dropdown-item" href="vehiclemaster.php"<?php if($per['datashow'] !='1'){ echo 'style="display:none"';} ?> >vehicle</a><?php }?>
      <?php 
        $userall=$_SESSION['log'];
        $usper = mysqli_query($connect,"select * from userpermission where username = '$userall' && filename='customerratemaster'");
while($per=mysqli_fetch_array($usper))
{
          ?>
      <a class="dropdown-item" href="ratemaster.php" <?php if($per['datashow'] !='1'){ echo 'style="display:none"';} ?>>Customer Rate</a><?php }?>
      <?php 
        $userall=$_SESSION['log'];
        $usper = mysqli_query($connect,"select * from userpermission where username = '$userall' && filename='employeemaster'");
while($per=mysqli_fetch_array($usper))
{
          ?>
      <a class="dropdown-item" href="masteremployee.php" <?php if($per['datashow'] !='1'){ echo 'style="display:none"';} ?>>Employee Details</a><?php }?>
      <?php 
        $userall=$_SESSION['log'];
        $usper = mysqli_query($connect,"select * from userpermission where username = '$userall' && filename='cftdetails'");
while($per=mysqli_fetch_array($usper))
{
          ?>
      <a class="dropdown-item" href="master_cft.php" <?php if($per['datashow'] !='1'){ echo 'style="display:none"';} ?>>CFT Calculation</a><?php }?>
      <!-- <a class="dropdown-item" href="deliverymaster.php">Delivery Site</a> -->
      
    </div>
  </div>
    </li>
    <li class="nav-item">
    <?php 
        $userall=$_SESSION['log'];
        $usper = mysqli_query($connect,"select * from userpermission where username = '$userall' && filename='ticket'");
while($per=mysqli_fetch_array($usper))
{
          ?>
      <a class="nav-link navselect" href="ticket.php" <?php if($per['datashow'] !='1'){ echo 'style="display:none"';} ?>><i class="fas fa-ticket-alt"></i>First Transaction</a><?php }?>
    </li>
    <!-- <li class="nav-item">
    <?php 
        // $userall=$_SESSION['log'];
        // $usper = mysqli_query($connect,"select * from userpermission where username = '$userall' && filename='firsttransaction'");
// while($per=mysqli_fetch_array($usper))
// {
          ?>
      <a class="nav-link navselect" href="firsttransaction.php" <?php //if($per['datashow'] !='1'){ echo 'style="display:none"';} ?>><i class="fas fa-dice-one"></i>First Entry</a><?php //} ?>
    </li> -->
    <li class="nav-item">
    <?php 
        $userall=$_SESSION['log'];
        $usper = mysqli_query($connect,"select * from userpermission where username = '$userall' && filename='secondtransaction'");
while($per=mysqli_fetch_array($usper))
{
          ?>
      <a class="nav-link navselect" href="secondtransaction.php" <?php if($per['datashow'] !='1'){ echo 'style="display:none"';} ?>><i class="fas fa-dice-two"></i>Second Entry</a>
    </li><?php } ?>
    <!--<li class="nav-item">
    <?php 
        $userall=$_SESSION['log'];
        $usper = mysqli_query($connect,"select * from userpermission where username = '$userall' && filename='secondtransaction'");
while($per=mysqli_fetch_array($usper))
{
          ?>
      <a class="nav-link navselect" href="returntransaction.php" <?php if($per['datashow'] !='1'){ echo 'style="display:none"';} ?>><i class="fas fa-ticket-alt"></i>Return Transaction</a><?php }?>
    </li>-->
    <li class="nav-item">
    <?php 
        $userall=$_SESSION['log'];
        $usper = mysqli_query($connect,"select * from userpermission where username = '$userall' && filename='singleentry'");
while($per=mysqli_fetch_array($usper))
{
          ?>
      <a class="nav-link navselect" href="singleentry.php" <?php if($per['datashow'] !='1'){ echo 'style="display:none"';} ?>><i class="fas fa-external-link-alt"></i>Single Entry</a><?php } ?>
    </li>
    
     <li class="nav-item transaction">
    <div class="dropdown">
    <a class=" dropdown-toggle navselect" data-toggle="dropdown"><i class="fas fa-university"></i>Transaction</a>
     
    <div class="dropdown-menu">
    <?php 
        $userall=$_SESSION['log'];
        $usper = mysqli_query($connect,"select * from userpermission where username = '$userall' && filename='creditdetails'");
while($per=mysqli_fetch_array($usper))
{
          ?>
      <a class="dropdown-item" href="credit.php" <?php if($per['datashow'] !='1'){ echo 'style="display:none"';} ?>>Credit</a>
      <?php } ?>
      <?php 
        $userall=$_SESSION['log'];
        $usper = mysqli_query($connect,"select * from userpermission where username = '$userall' && filename='debitdetails'");
while($per=mysqli_fetch_array($usper))
{
          ?>
      <a class="dropdown-item" href="debit.php" <?php if($per['datashow'] !='1'){ echo 'style="display:none"';} ?>>Debit</a>
      <?php } ?>
      <?php 
        $userall=$_SESSION['log'];
        $usper = mysqli_query($connect,"select * from userpermission where username = '$userall' && filename='advanceentry'");
while($per=mysqli_fetch_array($usper))
{
          ?>
      <a class="dropdown-item" href="advance.php" <?php if($per['datashow'] !='1'){ echo 'style="display:none"';} ?>>Advance</a>
      <?php } ?>
      
      <?php 
        $userall=$_SESSION['log'];
        $usper = mysqli_query($connect,"select * from userpermission where username = '$userall' && filename='cashhandling'");
while($per=mysqli_fetch_array($usper))
{
          ?>
      <a class="dropdown-item" href="cash_handling.php" <?php if($per['datashow'] !='1'){ echo 'style="display:none"';} ?>>Cash&nbsp;Handling</a>
      <?php } ?>
      
    </div>
  </div>
    </li>
    
    <li class="nav-item report">
    <div class="dropdown">
   
    <a class=" dropdown-toggle navselect" data-toggle="dropdown" ><i class="fas fa-file-alt"></i>Report</a>
     
    <div class="dropdown-menu">
    <?php 
        $userall=$_SESSION['log'];
        $usper = mysqli_query($connect,"select * from userpermission where username = '$userall' && filename='emptyreport'");
while($per=mysqli_fetch_array($usper))
{
          ?>
    <a class="dropdown-item" href="emptyinreport.php" <?php if($per['datashow'] !='1'){ echo 'style="display:none"';} ?>>Empty-In</a>
    <?php } ?>
    <?php 
        $userall=$_SESSION['log'];
        $usper = mysqli_query($connect,"select * from userpermission where username = '$userall' && filename='loadoutreport'");
while($per=mysqli_fetch_array($usper))
{
          ?>
      <a class="dropdown-item" href="loadoutreport.php"<?php if($per['datashow'] !='1'){ echo 'style="display:none"';} ?>>Load-Out</a><?PHP } ?>
      <?php 
        $userall=$_SESSION['log'];
        $usper = mysqli_query($connect,"select * from userpermission where username = '$userall' && filename='dailyreport'");
while($per=mysqli_fetch_array($usper))
{
          ?>


      <!--<a class="dropdown-item" href="dailyreport.php" <?php if($per['datashow'] !='1'){ echo 'style="display:none"';} ?>>Daily Report</a><?php } ?>-->

<?php 
        $userall=$_SESSION['log'];
        $usper = mysqli_query($connect,"select * from userpermission where username = '$userall' && filename='dailyreport'");
while($per=mysqli_fetch_array($usper))
{
          ?>
      <a class="dropdown-item" href="fullreport.php" <?php if($per['datashow'] !='1'){ echo 'style="display:none"';} ?>>Full Report</a><?php } ?>


      <?php 
        $userall=$_SESSION['log'];
        $usper = mysqli_query($connect,"select * from userpermission where username = '$userall' && filename='purchasereport'");
while($per=mysqli_fetch_array($usper))
{
          ?>
      <a class="dropdown-item" href="Purchasereport.php" <?php if($per['datashow'] !='1'){ echo 'style="display:none"';} ?>>Purchase-Report</a><?php } ?>
      <?php 
        $userall=$_SESSION['log'];
        $usper = mysqli_query($connect,"select * from userpermission where username = '$userall' && filename='Quotation report'");
while($per=mysqli_fetch_array($usper))
{
          ?>
          
     <!-- <a class="dropdown-item" href="quotation_report.php" <?php if($per['datashow'] !='1'){ echo 'style="display:none"';} ?>>Quotation Report</a><?php } ?>-->
      <?php 
        $userall=$_SESSION['log'];
        $usper = mysqli_query($connect,"select * from userpermission where username = '$userall' && filename='salesreport'");
while($per=mysqli_fetch_array($usper))
{
          ?>
      <a class="dropdown-item" href="salesreport.php" <?php if($per['datashow'] !='1'){ echo 'style="display:none"';} ?>>Invoice Report</a><?php } ?>
      
      <?php 
        $userall=$_SESSION['log'];
        $usper = mysqli_query($connect,"select * from userpermission where username = '$userall' && filename='salesreport'");
while($per=mysqli_fetch_array($usper))
{
          ?>
      <!--<a class="dropdown-item" href="salesreport_return.php" <?php if($per['datashow'] !='1'){ echo 'style="display:none"';} ?>>Invoice Return Report</a>--><?php } ?>
      <?php 
        $userall=$_SESSION['log'];
        $usper = mysqli_query($connect,"select * from userpermission where username = '$userall' && filename='taxreport'");
while($per=mysqli_fetch_array($usper))
{
          ?>
      <!-- <a class="dropdown-item" href="salesreportest.php">Invoice Report-EST</a> -->
      <a class="dropdown-item" href="gstreport.php" <?php if($per['datashow'] !='1'){ echo 'style="display:none"';} ?>>Tax-Report</a><?php } ?>
      <?php 
        $userall=$_SESSION['log'];
        $usper = mysqli_query($connect,"select * from userpermission where username = '$userall' && filename='taxreport'");
while($per=mysqli_fetch_array($usper))
{
          ?>
      <!-- <a class="dropdown-item" href="salesreportest.php">Invoice Report-EST</a> 
      <a class="dropdown-item" href="gstreturnreport.php" <?php if($per['datashow'] !='1'){ echo 'style="display:none"';} ?>>TaxReturn-Report</a>--><?php } ?>
      <?php 
        $userall=$_SESSION['log'];
        $usper = mysqli_query($connect,"select * from userpermission where username = '$userall' && filename='materialreport'");
while($per=mysqli_fetch_array($usper))
{
          ?>
      <a class="dropdown-item" href="materialreport.php" <?php if($per['datashow'] !='1'){ echo 'style="display:none"';} ?>>Material-Report</a>
      <a class="dropdown-item" href="customer_report.php" <?php if($per['datashow'] !='1'){ echo 'style="display:none"';} ?>>Customer-Report</a><?php } ?>
      
       <?php 
        $userall=$_SESSION['log'];
        $usper = mysqli_query($connect,"select * from userpermission where username = '$userall' && filename='creditdetails'");
while($per=mysqli_fetch_array($usper))
{
          ?>
      <a class="dropdown-item" href="credit_report.php" <?php if($per['datashow'] !='1'){ echo 'style="display:none"';} ?>>Collection Report</a><?php } ?>
      
      <?php 
        $userall=$_SESSION['log'];
        $usper = mysqli_query($connect,"select * from userpermission where username = '$userall' && filename='overallreport'");
while($per=mysqli_fetch_array($usper))
{
          ?>
      <a class="dropdown-item" href="splitupreport.php" <?php if($per['datashow'] !='1'){ echo 'style="display:none"';} ?>>Overall Report</a><?php } ?>
       <?php 
        $userall=$_SESSION['log'];
        $usper = mysqli_query($connect,"select * from userpermission where username = '$userall' && filename='salesreport'");
while($per=mysqli_fetch_array($usper))
{
          ?>
      <a class="dropdown-item" href="agereport.php" <?php if($per['datashow'] !='1'){ echo 'style="display:none"';} ?>>Age Report</a><?php } ?>
      <?php 
        $userall=$_SESSION['log'];
        $usper = mysqli_query($connect,"select * from userpermission where username = '$userall' && filename='deletedreport'");
while($per=mysqli_fetch_array($usper))
{
          ?>
      <a class="dropdown-item" href="deletereport.php" <?php if($per['datashow'] !='1'){ echo 'style="display:none"';} ?>>Deleted-Report</a><?php } ?>
      <?php 
        $userall=$_SESSION['log'];
        $usper = mysqli_query($connect,"select * from userpermission where username = '$userall' && filename='salespending'");
while($per=mysqli_fetch_array($usper))
{
          ?>
      <a class="dropdown-item" href="salespending_report.php" <?php if($per['datashow'] !='1'){ echo 'style="display:none"';} ?>>Salespending</a><?php } ?>
      <?php 
        $userall=$_SESSION['log'];
        $usper = mysqli_query($connect,"select * from userpermission where username = '$userall' && filename='purchasepending'");
while($per=mysqli_fetch_array($usper))
{
          ?>
      <a class="dropdown-item" href="purchasepending_report.php" <?php if($per['datashow'] !='1'){ echo 'style="display:none"';} ?>>Purchasepending</a><?php } ?>
      <?php 
        $userall=$_SESSION['log'];
        $usper = mysqli_query($connect,"select * from userpermission where username = '$userall' && filename='customerstatement'");
while($per=mysqli_fetch_array($usper))
{
          ?>
      <a class="dropdown-item" href="customerstatement.php" <?php if($per['datashow'] !='1'){ echo 'style="display:none"';} ?>>Customerstatement</a><?php } ?>
      <?php 
        $userall=$_SESSION['log'];
        $usper = mysqli_query($connect,"select * from userpermission where username = '$userall' && filename='supplierstatement'");
while($per=mysqli_fetch_array($usper))
{
          ?>
      <a class="dropdown-item" href="supplierstatement.php" <?php if($per['datashow'] !='1'){ echo 'style="display:none"';} ?>>Supplierstatement</a><?php } ?>
      <!-- <a class="dropdown-item" href="ticketreport.php">Ticket-Report</a> -->
      <!-- <a class="dropdown-item" href="deletedreport.php">Deleted-Load</a> -->
    </div>
  </div>
    </li>
    <li class="nav-item" style=" margin-top: 5px;">
    <?php 
        $userall=$_SESSION['log'];
        $usper = mysqli_query($connect,"select * from userpermission where username = '$userall' && filename='backup'");
while($per=mysqli_fetch_array($usper))
{
          ?>
      <a class="nav-link navselect"  href="dbbackup.php" <?php if($per['datashow'] !='1'){ echo 'style="display:none"';} ?>> <i class="fas fa-suitcase"></i>Backup</a><?php } ?>
    </li>
    <li class="nav-item" style=" margin-top: 5px;">
    <?php 
        $userall=$_SESSION['log'];
        $usper = mysqli_query($connect,"select * from userpermission where username = '$userall' && filename='setting'");
while($per=mysqli_fetch_array($usper))
{
          ?>
      <a class="nav-link navselect" href="userpermission.php" <?php if($per['datashow'] !='1'){ echo 'style="display:none"';} ?>><i class="fas fa-cog"></i>Setting</a><?php } ?>
    </li>
    <li class="nav-item" >
      <a ></a>
    </li>
    <li class="nav-item " style=" margin-top: 10px;">
    <div class="dropdown">
    <a href="#" class=" dropdown-toggle navselect" data-toggle="dropdown" style="font-size:24px;">
    <i class="fas fa-user-circle"></i><?php echo $user ?>
    </a>
    <div class="dropdown-menu">
      <a class="dropdown-item" href="logout.php">Logout</a>
    </div>
  </div>
    </li>
    <!-- res -->
    
  </ul>
  
</nav>;


  <?php
  }
  ?>
<br>



</body>
</html>