<?php 
   session_start();
    include '../assets/constant/config.php';
    
    try {
           $conn = new PDO("mysql:host=$servername;dbname=$dbname", $username, $password);
           $conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
   
           }
           catch(PDOException $e)
           {
           echo "Connection failed: " . $e->getMessage();
           }
   ?>
<?php include('include/sidebar.php');?>

<!--  Author Name: Mayuri K. 
 for any PHP, Codeignitor or Laravel website or software development contact me at mayuri.infospace@gmail.com  -->
<!-- Top Bar End -->
<?php include('include/header.php');?>
<div class="page-content-wrapper ">
   <div class="container-fluid">
      <div class="row">
         <div class="col-sm-12">
            <div class="page-title-box">
               <h4 class="page-title">Show Details</h4>
            </div>
         </div>
         <div class="clearfix"></div>
      </div>
      <!-- end page title end breadcrumb -->
     
      <div class="row">
         <div class="col-lg-12">
            <div class="card">
               <div class="card-body">
                  <div class="table-responsive">
                     <table id="datatable-buttons"  class="table table-striped table-bordered dt-responsive nowrap" style="border-collapse: collapse; border-spacing: 0; width: 100%;" enctype="multipart/form-data">
                        <thead>
                        </thead>
                        <tbody>
<?php



// $stmt=$conn->prepare("SELECT pr.product_id, pr.*, p.name FROM product_review pr JOIN product p ON pr.product_id = p.id WHERE  pr.id = ?");
$stmt=$conn->prepare("SELECT * FROM `user` WHERE id=? AND delete_status='0'");

//print_r($stmt);
$stmt->execute([$_POST['id']]);
$record=$stmt->fetch();
$i=1;
 ?>
                           <tr>
                   <h4><?php echo $record['username'];?> </h4>
                    
                </tr>
                <tr>
                 <th>Gender</th>
                 <td><?php echo $record['gender'];?> </td>
                </tr>
                             
                <tr>
                    <th>Email</th>        
                    <td><?php echo $record['email'];?> </td>
                </tr>
                <tr>
                    <th> Phone</th>
                    <td><?php echo $record['mobileno'];?> </td>
                </tr>
                <tr>
                    <th>Date</th>
                    <td><?php echo $record['date'];?>
                     </td>
                </tr>
                <tr>
                    <th>Updated Date</th>
                    <td><?php echo $record['update_date'];?>
                     </td>
                </tr>
                <tr>
                    <th>last Login</th>
                    <td><?php echo $record['last_login'];?>
                     </td>
                </tr>
               <tr>
                    <th> Notes</th>
                    <td><?php echo $record['notes'];?></td>
                </tr> 
               
                           
                        </tbody>
                         
                     </table>
                  </div>
                  <!--end /tableresponsive-->
               </div>
               <!--end card-body-->
            </div>
            <!--end card-->
         </div>
         <!--end col-->
      </div>
      <!--end row-->

        <div class="row">
            <div class="col-lg-12">
                <div class="card">
                    <div class="card-body">
                        <div class="table-responsive">

                            <table id="datatable-buttons" class="table table-striped table-bordered dt-responsive nowrap" style="border-collapse: collapse; border-spacing: 0; width: 100%;" enctype="multipart/form-data">
                                <thead>
                                    <tr>
                                        <th>SN </th>
                                        <th>Staff </th>
                                         <th>date </th>
                                        <th>Gross amount </th>
                                         <th>deduction </th>
                                          <th>net amount </th>
                                          <th>paid amount </th>
                                         
                                        <!-- <th>Action</th> -->
                                    </tr>
                                </thead>
                                <tbody>

                                    <?php
                                    $stmt = $conn->prepare("SELECT p.user_name,u.username, p.payroll_date, p.total_pay, p.total_deduction, p.net_pay, p.paid_amount FROM payroll p INNER JOIN user u ON p.user_name = u.username WHERE u.id = p.id AND p.delete_status='0' ");
                                    $stmt->execute();
                                    $record = $stmt->fetchAll();
                                    $i = 1;
                                    foreach ($record as $key) { ?>


                                        <tr>

                                            <td><?php echo $i; ?></td>
                                            
                                       
                                           <td><?php echo $key['user_name']; ?></td>
                                            <td><?php echo $key['payroll_date']; ?></td>


                                             <td><?php echo $key['total_pay']; ?></td>



                                              <td><?php echo $key['total_deduction']; ?></td>
                                              <td><?php echo $key['net_pay']; ?></td>
                                              <td><?php echo $key['paid_amount']; ?></td>
                                              <!-- <td><?php echo $key['recurring']; ?></td>-->
                                                   <!-- <td> 
                                               
<div class="dropdown">
   <button type="button" class="btn btn-primary dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"><i class=></i>Details</button>
  <div class="dropdown-menu" aria-labelledby="dropdownMenuButton">
<a href="payslip.php?id=<?php echo $key['id']?>" class="dropdown-item" href="#">Payslip</a>
<a href="#"onclick="editForm1(event, <?php echo $key['id'] ?>,'edit_payroll.php')" class="dropdown-item" href="#"> Edit</a>
    <a href="payroll_crud.php?id=<?php echo $key['id']?>" class="dropdown-item" href="#">Delete</a>
   
  </div>
</div> -->



                                                <!-- <a href="#" onclick="editForm(event, <?php echo $key['id'] ?>, 'edit_contritype.php')" class="btn btn-primary waves-effect waves-light"><i class="fa fa-edit" aria-hidden="true"></i>
                                                </a>


                                                <a href="#" class="btn btn-danger" onclick="return confirm('Are you sure you want to delete this item?') && delForm(event, <?php echo $key['id'] ?>, 'app/contritype_crud.php');"><i class="fa fa-trash-alt" aria-hidden="true"></i></a> -->

                                        
                                        </tr>
                                    <?php $i++;
                                    } ?>
                                </tbody>
                                

                            </table>
 </div><!--end /tableresponsive-->
                    </div><!--end card-body-->
                </div><!--end card-->
            </div><!--end col-->


        </div><!--end row-->







   </div>
   <!-- Page content Wrapper -->
</div>
<!-- content -->
<?php include('include/footer.php');?>

<script>
   function addNews(){
     jQuery.validator.addMethod("alphanumeric", function (value, element) {
    return this.optional(element) || /^(?=.*[a-zA-Z])[a-zA-Z0-9\s!@#$%^&*()_-]+$/.test(value);
   }, "Please enter alphabet characters only");
     
      jQuery.validator.addMethod("lettersonly", function(value, element) {
   // Check if the value is empty
   if (value.trim() === "") {
    return false;
   }
   return /^[a-zA-Z\s]*$/.test(value);
   }, "Please enter alphabet characters only");
   $('#add_news').validate({
    rules: {
      import_file: {
        required: true,
        numbersOnly: true
      },
       
      
      },
    
   });
   };
</script>







































































































