<?php
include 'includes/config.php';
session_start();
if (strlen($_SESSION['id']==0)) {
  header('location:logout.php');
  } else{
	
?><!DOCTYPE html>
<html lang="en">

<head>

    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="description" content="">
    <meta name="author" content="">
<meta name="robots" content="noindex">
<meta name="googlebot" content="noindex">
    <link rel="stylesheet" href="css/bootstrap.css" crossorigin="anonymous">
    <title>Employee data Page </title>
    <link href="css/bootstrap.min.css" rel="stylesheet">
    <link href="css/heroic-features.css" rel="stylesheet">
    <!-- <link href="css/datatables.css" rel="stylesheet"> -->
    
  <link href="css/datatables/dataTables.bootstrap4.min.css" rel="stylesheet" type="text/css" />
        
        <link href="css/datatables/buttons.bootstrap4.min.css" rel="stylesheet" type="text/css" />
        <link href="css/datatables/responsive.bootstrap4.min.css" rel="stylesheet" type="text/css" />
        <link href="css/datatables/select.bootstrap4.min.css" rel="stylesheet" type="text/css" />




    <!-- <link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/1.10.21/css/dataTables.bootstrap4.min.css"/> -->

    <style type="">
        .navbar-inverse{
            background-color: #0b0454!important;
        }
        a{
            color: #fdc010!important;
        }
    </style>
</head>
<body>
    <nav class="navbar navbar-inverse bg-success navbar-fixed-top" role="navigation">
        <div class="container">
            <div class="navbar-header">
                <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
                    <span class="sr-only">Toggle navigation</span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                </button>
                 <a class="navbar-brand" href="welcome.php"><i class="glyphicon glyphicon-home"></i> Home</a>
            </div>
            <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
                <ul class="nav navbar-nav">
                     <li>
                        <a href="profile.php"><i class="glyphicon glyphicon-user"></i> <?php echo $_SESSION['sname'];?></a>
                    </li>
                    <li>
                      <a href="employee-details.php"><i class="glyphicon glyphicon-folder-open"></i> Employee Data</a>
                    </li>
                    <li>
                      <a href="nps.php"><i class="glyphicon glyphicon-globe"></i> NPS</a>
                    </li>
                    <li>
                      <a href="salary-income.php"><i class="glyphicon glyphicon-screenshot"></i> Salary/Income tax </a>
                    </li>
                    <li>
                      <a href="loans.php"><i class="glyphicon glyphicon-screenshot"></i> Loans/Advance </a>
                    </li>
                    <li>
                        <a href="logout.php"><i class="glyphicon glyphicon-log-out"></i> Logout</a>
                    </li>s
                  
                </ul>
            </div>
        </div>
    </nav>
    <div id="divToPrint">
    <div class="container">
        <div class="row">
          <div class="col-md-12">
            <h2 class="h2 text-center">Employee Data List</h2>
          </div>
         
          <div class="col-md-12">
            <p><a href="add-employee-details.php" class="btn btn-primary"><span class="glyphicon glyphicon-plus"></span> Add</a> </p>
            <table id="datatables" class="table  table-bordered dt-responsive nowrap" style="border-collapse: collapse; border-spacing: 0; width: 100%;">
             
                    
              <thead>
                <tr>
                  <th>PPO/PF No.</th>
                  <th>Name</th>
                 
              
                  <th>Father/Husband Name</th>
                  <th>DOB</th>
                  <th>Mobile</th>
                  <th>Email</th>
                  <th>Aadhaar</th>
                  <th>PAN</th>
                  <th>AU/RLY</th>
                  <th>Bill Unit</th>
                  <th>Designation</th>
                  <th>Department</th>
                  <th>DOA</th>
                  <th>DOI</th>
                  <th>DOR</th>
                  <th>Edit</th>
                  
                 
                 
                 
                  
                </tr>
              </thead>
 <?php 
                // $id = ;
                $sql="SELECT * FROM users";
$result = mysqli_query($con, $sql);
           if(mysqli_num_rows($result)>0){ 
            ?>
              <tbody>
                   <?php

 $i=0;
                     while($row = mysqli_fetch_array($result)){
     
        ?>
                <tr>
                  <td><?php echo $row['ppono'] ?></td>
                  
                  
                  <td><?php echo $row['name'] ?></td>
                  <td><?php echo $row['fname'] ?></td>
                  <td><?php echo $row['dob'] ?></td>
                  <td><?php echo $row['mobile'] ?></td>
                  <td><?php echo $row['email'] ?></td>
                  <td><?php echo $row['aadhaar'] ?></td>
                  <td><?php echo $row['pan'] ?></td>
                  <td><?php echo $row['aurly'] ?></td>
                  <td><?php echo $row['billunit'] ?></td>
                  <td><?php echo $row['designation'] ?></td>
                  <td><?php echo $row['department'] ?></td>
                  <td><?php echo $row['doa'] ?></td>
                  <td><?php echo $row['doi'] ?></td>
                  <td><?php echo $row['dor'] ?></td>
                  
                  
                  
                 
                 
                  
                  <td><a href="edit-employee-details.php?sid=<?php echo $row['sid']; ?>" class="btn btn-info ml-3">Edit</a>
                    <a href="delete-employee-details.php?sid=<?php echo $row['sid']; ?>" onclick="return confirm('Are you sure you want to delete this update?');" class="btn btn-danger">Delete</a></td>
                  
                </tr>
                <?php 
                      $i++;
                    }
                ?>
              </tbody>
            <?php } ?>
            </table>
          </div>  
        </div>
    </div>
 
   </div> 

       

   <div id="foot">
     <script src="js/jquery.js"></script>
    <script src="js/bootstrap.min.js"></script>

 
<!-- <script type="text/javascript" src="js/datatables.js"></script> -->
<!-- Datatable plugin js -->
        <script src="js/datatables/jquery.dataTables.min.js"></script>
        <script src="js/datatables/dataTables.bootstrap4.min.js"></script>

        <script src="js/datatables/dataTables.responsive.min.js"></script>
        <script src="js/datatables/responsive.bootstrap4.min.js"></script>

        <script src="js/datatables/dataTables.buttons.min.js"></script>
        <script src="js/datatables/buttons.bootstrap4.min.js"></script>

        <script src="js/jszip/jszip.min.js"></script>
        <script src="js/pdfmake/pdfmake.min.js"></script>
        <script src="js/pdfmake/vfs_fonts.js"></script>

        <script src="js/datatables/buttons.html5.min.js"></script>
        <script src="js/datatables/buttons.print.min.js"></script>

        <script src="js/datatables/dataTables.keyTable.min.js"></script>
        <script src="js/datatables/dataTables.select.min.js"></script>

        <!-- Datatables init -->
        <script src="js/datatables/datatables.init.js"></script>

<script type="text/javascript">
  $(document).ready(function() {
    $('#datatables').dataTable( {
        "aaSorting": [[0, 'desc']]
    } );
} );
</script>
   </div>
   
</body>

</html>
<?php } ?>