<?php 
include "config.php";
session_start();
$user=$_SESSION['log'];
if ($user=="")
{
    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;
  }
  </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))
  {
  ?>
  <?php if( $cusshow['usertype']=='admin')
  {?>
<nav class="navbar 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">
      
      <a class="dropdown-item" href="itemmaster.php">Product</a>
      <a class="dropdown-item" href="mastercustomer.php">Customer</a>
      <a class="dropdown-item" href="vehiclemaster.php">vehicle</a>
      <a class="dropdown-item" href="ratemaster.php">Customer Rate</a>
      <a class="dropdown-item" href="masteremployee.php">Employee Details</a>
      <a class="dropdown-item" href="master_cft.php">CFT calculation</a>
      <!-- <a class="dropdown-item" href="deliverymaster.php">Delivery Site</a> -->
      
    </div>
  </div>
    </li>
    <li class="nav-item">
      <a class="nav-link navselect" href="ticket.php"><i class="fas fa-ticket-alt"></i>Tickets</a>
    </li>
    <!-- <li class="nav-item">
      <a class="nav-link navselect" href="firsttransaction.php"><i class="fas fa-dice-one"></i>First Entry</a>
    </li> -->
    <li class="nav-item">
      <a class="nav-link navselect" href="secondtransaction.php"><i class="fas fa-dice-two"></i>Second Entry</a>
    </li>
    <li class="nav-item">
      <a class="nav-link navselect" href="singleentry.php"><i class="fas fa-external-link-alt"></i>Single Entry</a>
    </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">
      <a class="dropdown-item" href="credit.php">Credit</a>
      <a class="dropdown-item" href="debit.php">Debit</a>
      <a class="dropdown-item" href="advance.php">Advance</a>
    </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">
      <a class="dropdown-item" href="emptyinreport.php">Empty-In</a>
      <a class="dropdown-item" href="loadoutreport.php">Load-Out</a>
      <a class="dropdown-item" href="dailyreport.php">Daily Report</a>
      <a class="dropdown-item" href="Purchasereport.php">Purchase-Report</a>
      <a class="dropdown-item" href="salesreport.php">Invoice Report</a>
      <!-- <a class="dropdown-item" href="salesreportest.php">Invoice Report-EST</a> -->
      <a class="dropdown-item" href="gstreport.php">Tax-Report</a>
      <a class="dropdown-item" href="materialreport.php">Material-Report</a>
      <a class="dropdown-item" href="deletereport.php">Deleted-Report</a>
      <a class="dropdown-item" href="salespending_report.php">Salespending</a>
      <a class="dropdown-item" href="purchasepending_report.php">Purchasepending</a>
      <a class="dropdown-item" href="customerstatement.php">Customerstatement</a>
      <a class="dropdown-item" href="supplierstatement.php">Supplierstatement</a>
      <!-- <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;">
      <a class="nav-link navselect" href="userpermission.php"><i class="fas fa-cog"></i>Setting</a>
    </li>
	<li class="nav-item"style=" margin-top: px;">
      <a class="nav-link navselect"  href="dbbackup.php"> <i class="fas fa-suitcase"></i>Backup</a>
    </li>
    <li class="nav-item " style=" margin-top: 6px;">
    <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 }?>
<!-- general -->
<?php if( $cusshow['usertype']=='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>Tickets</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='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"style=" margin-top: px;">
      <a class="nav-link navselect"  href="dbbackup.php"> <i class="fas fa-suitcase"></i>Backup</a>
    </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 } ?>
    </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='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='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='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='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><?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;">
      <a class="nav-link navselect" href="userpermission.php"><i class="fas fa-cog"></i>Setting</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>