<?php 

require_once("config/configDB.php"); 
require "userPermission.php";
//require "spareMasterFetchData.php";

$edit_id=$_GET['id'];


$sql_ename=mysqli_query($conn,"select * from employee_payment where id='$edit_id'");
while($row_emp=mysqli_fetch_array($sql_ename))
{
$salary_no   = $row_emp['salary_no'];
$given_date    = $row_emp['given_date'];
$ecode   = $row_emp['ecode'];
$employee_name    = $row_emp['employee_name'];
$fromDate   = $row_emp['fromdate'];
$toDate    = $row_emp['todate'];
$advance   = $row_emp['advance_amount'];
$collected_amt    = $row_emp['collected_amt'];
$remaining_amt   = $row_emp['remaining_amt'];
$total_shift    = $row_emp['total_shift'];
$total_ot   = $row_emp['total_ot'];
$salary_amount    = $row_emp['salary_amount'];
$pending_salary    = $row_emp['pending_salary'];

$total_salary   = $row_emp['total_salary'];
$paidamount    = $row_emp['paidamount'];

$deducted_amt    = $row_emp['deducted_amt'];
$cash_hand    = $row_emp['cash_hand'];

$givenby    = $row_emp['givenby'];


$paytype   = $row_emp['paytype'];
$refno    = $row_emp['refno'];
$remarks    = $row_emp['remarks'];

}


$sql_emp=mysqli_query($conn,"Select * from employee_master where ecode='$ecode'");
while($row_emp=mysqli_fetch_array($sql_emp))
{

$triplabourname  =  $row_emp['id'];
}
	
    $sqlEmpMasterQuery = mysqli_query($conn,"SELECT *   FROM employee_master WHERE id='$triplabourname' ");
    $rowtripdrivername    = mysqli_fetch_array($sqlEmpMasterQuery,MYSQLI_ASSOC);
    $shift_salary      = $rowtripdrivername['shiftworkamt'];
	 $ot_salary      = $rowtripdrivername['extrahoursamt'];

?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">

<title>Bill</title>

 <?php 
        require 'meta.php';  
        require 'header.php'; 
    ?>

</head>

<body onkeydown="escapekeypressed()" >
<div style="margin-bottom:80px">
<div id="p1">
<center>
  <table border="3" width="760"  cellpadding="5" style="border-collapse:collapse;">
       <tr style="border-bottom:1pt solid black;">
       <td style="border-right:2pt solid black;" colspan="11"  >
     
       
 <table width="100%" >
   <tr>
  <td><!--<img src="images/logo.png" style="float:left;margin-top:2px;" width="130px">-->&nbsp;</td>
  <td  align="center"><span style="font-size:32px;"><strong>SRI RATHINAM BLUE METALS</strong></span><br>
 
     <font style="margin-left:0px;font-size:13px;"><span style="margin-left:0px;"><strong>Office</strong>: KolumankondanThazhaiyuthu (Via),Palani TK,Dindigul -624617
Cell:7760598582</span> 
     <br>
     <span style="margin-left:0px;"><strong>Crusher </strong>: Kolumankondan
Thazhaiyuthu (Via),
Palani TK,Dindigul -624617
Cell:9003808068
</span> <br>

   
   </font>
  </td>
   <td><!--<img src="images/logo2.png" style="float:left;margin-top:2px;" width="130px">-->&nbsp;</td>
  </tr>
  </table>
  <table width="100%">
  <!--<tr>
  <td width="287"><strong>GSTIN:&nbsp;33ABFFR8708Q1ZJ</strong></td>
<td width="107">&nbsp;</td>
 <td width="316" colspan="2" align="right"><strong>CELL:70103 69863,97918 95417,73588 93062</strong></td> 
  </tr>-->
</table>
    <!-- <table border="0" width="100%">
      <tr>
      <td align="left"><b>E-mail : feenix@gmail.com</b></td>
      <td align="left"  valign="center" width="255"><B><b>GSTIN &nbsp;&nbsp;: 33BMRPS7277P1ZT</b></B></td>
      </tr>
      </table> -->
  
       
      
      
       </td>
       </tr>
      <tr >
      <td colspan="9"  style="border-right:1pt solid black; border-bottom:1pt solid black;" valign="top" >
        <h3 align="center"><u>SALARY SLIP</u></h3>
        <table class="table table-striped table-bordered dt-responsive nowrap" cellspacing="0" width="100%">
        <tr>
         <td>Emp.Code:</td>
        <td><strong><?php echo $ecode;?></strong></td>
        <td>Emp.Name:</td>
        <td><strong><?php echo $employee_name;?></strong></td>
         <td>Salary Date:</td>
        <td><strong><?php echo $given_date;?></strong></td>
        </tr>
       
        <tr >
         <td >Date&nbsp;Between:</td>
        <td><strong><?php echo $fromDate." To ".$toDate;?></strong></td>
        <td>Salary/Shift:</td>
        <td><strong><?php echo number_format($shift_salary,2,'.','');?></strong></td>
         <td>Salary/Extra Hrs:</td>
        <td><strong><?php echo number_format($ot_salary,2,'.','');?></strong></td>
        </tr>
        
        </table>
        
        </td>
     
      </tr>
         
      
    <br>
    <tr> 
    </tr>
    
    <tr style="border-top:1pt solid black;"> 
   <td colspan="7">
    <table class="table table-striped table-bordered dt-responsive nowrap" cellspacing="0" width="100%">
   <tr >
   <td>Total&nbsp;Advance</td>
   <td><strong><?php echo $advance;?></strong></td>
   </tr>
   
   <tr >
   <td>Total&nbsp;Collected&nbsp;Advance</td>
   <td><strong><?php echo $collected_amt;?></strong></td>
   </tr>
   
   <tr >
   <td>Remaining&nbsp;Advance&nbsp;Amt</td>
   <td><strong><?php echo number_format($remaining_amt,2,'.','');?></strong></td>
   </tr>
   
   <tr >
   <td>Total&nbsp;Shift&nbsp;Worked</td>
   <td><strong><?php echo number_format($total_shift,2,'.','');?></strong></td>
   </tr>
   
   
   <tr >
   <td>Total&nbsp;Extra&nbsp;Hrs&nbsp;Worked</td>
   <td><strong><?php echo number_format($total_ot,2,'.','');?></strong></td>
   </tr>
   
   <tr >
   <td>Previous&nbsp;Pending&nbsp;Salary</td>
   <td><strong><?php echo number_format($pending_salary,2,'.','');?></strong></td>
   </tr>
   
    <tr >
   <td>Total&nbsp;Salary</td>
   <td><strong><?php echo number_format($total_salary,2,'.','');?></strong></td>
   </tr>
   
   
    <tr >
   <td>Total&nbsp;Paid&nbsp;Salary</td>
   <td><strong><?php echo number_format($paidamount,2,'.','');?></strong></td>
   </tr>
   <tr >
   <td>Deducted&nbsp;Adv.Amount</td>
   <td><strong><?php echo number_format($deducted_amt,2,'.','');?></strong></td>
   </tr>
   
   <tr >
   <td>Given&nbsp;Amount&nbsp;In&nbsp;Hand</td>
   <td><strong><?php echo number_format($cash_hand,2,'.','');?></strong></td>
   </tr>
   
   <tr >
   <td>Current&nbsp;Pending&nbsp;Salary</td>
   <td><strong><?php echo number_format($total_salary-$paidamount,2,'.','');?></strong></td>
   </tr>
   
    <tr >
   <td>Salary&nbsp;Mode</td>
   <td><strong><?php echo $paytype;?></strong></td>
   </tr>
   
   <tr >
   <td>Given&nbsp;By</td>
   <td><strong><?php echo $givenby;?></strong></td>
   </tr>
   
   </table>
   </td>
    </tr>
    
     <tr style="border-bottom:2pt solid black;border-top:2pt solid black; ">
     
  

     
    </tr> 
     
    <tr style="border-bottom:2pt solid black;border-top:2pt solid black; ">
   <td colspan="4">
<br>
<br>

<br><br>
<span style="float:left">Employee Signature</span>
   </td>
        <td style="border-right:2pt solid black;" colspan="8" align="right"  valign="top"><b><font size="4">SRI RATHINAM BLUE METALS</font> </b><br />
 
 
<br />
<br>Authorized signature</td> 
   </table>
  <!-- <table width="760" style="border:2px solid black">
  <tr><th><center>For Emergeny Queries Contact - 7094430990/7094430994</center></th></tr>
    </table>-->
   <table width="700">
    <tr><td><center> This is Computer Generated Invoice</center></td></tr>
    </table>
 
</div>
</div>
</body>
</html>