<style type="text/css">
.style20 {
	font-family: Verdana;
	font-size: 12px;
}
.style5 {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 14px;
}
.style3 {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 13px;
}
.style10{ border-top:solid 1px; border-top-color:#999;}
.style11{ border-bottom:dashed 1px; border-bottom-color:#333333;}
.style4 {font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 13px;
}
.style23 {
	font-family: Verdana, Arial, Helvetica, sans-serif;
	font-weight: bold;
}
.style27 {font-size: 12px}
.style28 {
	font-size: 16px;
	font-weight: bold;
}
.text {font-family: Verdana; font-size:13px;}
.style29 {	font-family: Verdana;
font-size: 14px;
}
.stylebottom
{
	border-right:1px solid #999;	
	border-bottom:1px solid #999;
}	
</style>


<?php 
  include ("../../include/db.php");
error_reporting(0);
ob_start();
session_start();
$session_branch=$_SESSION['branch'];
$session_user_type=$_SESSION['user_type'];
$branch_name=$_GET['branch_name'];

?>
<table width="980px" border="0" align="center"  cellpadding="0" cellspacing="0">
<tr style="height:60">
<td width="195" height="106" align="right" style="font-size:12px; "><img src="../../img/logo_image.png" width="152" height="139"/></td>
<td colspan="5" align="center" valign="top" style=""><strong style="font-size: 30px; color: #06F; padding-top: 5px; width: 80px; font-family: Verdana, sans-serif">SRI AMMAN DIGITAL PRINTS</strong><br />
        <span width="80%" class="title1" style="font-size:14px;font-family:Verdana, sans-serif; font-weight:bold"><b></b> DOOR No: 1/2,1/3  KOMBAI THOTTAM MAIN ROAD,</span><br />
       <span width="80%" class="title0" style="font-size:14px;font-family:Verdana, sans-serif; font-weight:bold"><b></b>SELLANDIAMMAN THURAI ROAD,</span><br />
       <span width="80%" class="title0" style="font-size:14px;font-family:Verdana, sans-serif; font-weight:bold"><b></b>TIRUPPUR-641604 TAMILNADU STATE INDIA,</span><br/>
       <span width="80%" class="title00" style="font-size:14px;font-family:Verdana, sans-serif; font-weight:bold"><b></b>Contact Office: 0421-4355333,+91 83442-33555,+91 83442-33888,</span><br/>
       <span width="80%" class="title0" style="font-size:14px;font-family:Verdana, sans-serif; font-weight:bold"><b></b>Email Id : sriammandigitalprints@gmail.com/yahoo.com.</span><br/>
       <span width="80%" class="title0" style="font-size:18px;font-family:Verdana, sans-serif; font-weight:bold"><b></b>Pay Slip Print 
  </span></p></td>
</tr>

<tr>
  <td width="195" align="left"  style="font-family: Verdana, sans-serif; font-size: 14px; font-family: Verdana, sans-serif;">From Date : <?php if($_GET['from_date']!='') { echo date('d-m-Y',strtotime($_GET['from_date'])); } else { echo date('d-m-Y'); }?></td>
  <td width="536" align="center"  style="font-family:Verdana, sans-serif; font-size:14px; font-family:Verdana, sans-serif;">Operator Name : <?php if($_GET['operator_type']!='') { echo $_GET['operator_type']; } else { echo "All"; } ?></td>
  <td width="249" align="right"  style="font-family:Verdana, sans-serif; font-size:14px; font-family:Verdana, sans-serif;">To Date : <?php if($_GET['to_date']!='') { echo date('d-m-Y',strtotime($_GET['to_date'])); } else { echo date('d-m-Y'); } ?></td>
</tr>
<tr>
  <td colspan="3" align="center"  style="font-family:Verdana, sans-serif; font-size:14px; font-family:Verdana, sans-serif;">&nbsp;</td>
</tr>
<tr>
  <td colspan="3" align="center" class="style5 style23" style="font-family:Verdana, sans-serif; font-size:12px; font-family:Verdana, sans-serif; font-size:large"><table width="980" align="center"  cellpadding="0" cellspacing="0" style="" >
    <tr>
      <th align="center" style="font-family:Verdana, sans-serif; font-size:14px; border-bottom:1px dashed; border-top:1px dashed; ">S.No</th>
      <th scope="col" align="left" style="font-family:Verdana, sans-serif; font-size:14px; border-bottom:1px dashed; border-top:1px dashed; ">&nbsp;Date</th>
      <th width="220" align="left" style="font-family:Verdana, sans-serif; font-size:14px; border-bottom:1px dashed; border-top:1px dashed; ">&nbsp;Operator Name</th>
      <th width="205" align="left" style="font-family:Verdana, sans-serif; font-size:14px; border-bottom:1px dashed; border-top:1px dashed; ">&nbsp;PaySlip No</th>
      <th width="147" align="right" style="font-family:Verdana, sans-serif; font-size:14px; border-bottom:1px dashed; border-top:1px dashed; ">Amount&nbsp;</th>
      <th width="164" align="center" style="font-family:Verdana, sans-serif; font-size:14px; border-bottom:1px dashed; border-top:1px dashed; ">Invoice No</th>
    </tr>
    <?php
  include ("../../include/db.php");
  
$from_date=$_GET['from_date'];
$to_date=$_GET['to_date'];
$current_date=date('Y-m-d');
$operator_type=$_GET['operator_type'];
if(($_GET['from_date']!='')&&($_GET['to_date']!=''))
{
 $from_date=date('Y-m-d',strtotime($_GET['from_date']));
 $to_date=date('Y-m-d',strtotime($_GET['to_date']));
}
$current_date=date('Y-m-d');
if($from_date!=""){ $from_date1= "DATE_FORMAT(entry_time,'%Y-%m-%d')>='$from_date'"; }else{$from_date1="DATE_FORMAT(entry_time,'%Y-%m-%d')='$current_date'"; }
if($to_date!=""){ $to_date1 = "DATE_FORMAT(entry_time,'%Y-%m-%d')<='$to_date'";}else{$to_date1="DATE_FORMAT(entry_time,'%Y-%m-%d')='$current_date'";}
if($operator_type!=""){ $operator_types = "operator_type='$operator_type'";}else{$operator_types="";}
{
$all_value1012 = $from_date1."@".$to_date1."@".$operator_types;
}
$all_array1012 = explode('@',$all_value1012);
foreach($all_array1012 as $value1012)
{ 
if($value1012!='')
{
$get_query1062 .= $value1012." AND ";
}
}	  
if($from_date!='')
{
	$sql="select * from pay_slip_entry where $get_query1062 id!='' order by pay_slip_no";
}
else
{ 
	$sql="select * from pay_slip_entry where DATE_FORMAT(entry_time,'%Y-%m-%d')='$current_date' order by pay_slip_no ";
}
    $rs=mysql_query($sql);
	$sno=0;
   		while($rsdata=mysql_fetch_array($rs))
  			{
   				$sno=$sno+1;
				$from=$from+1;
   				$pay_slip_no=$rsdata['pay_slip_no'];
   				$from_date=$rsdata['from_date'];
				$to_date=$rsdata['to_date'];
	   			$operator_type=$rsdata['operator_type'];
	   			$entry_time=$rsdata['entry_time'];
				$tot_amount=$rsdata['tot_amount'];
	   			$invoice_no=$rsdata['invoice_no'];
  ?>
    <tr>
      <td width="69"  align="center" style="font-family:Verdana, sans-serif; font-size:14px;"><?php echo $from; ?></td>
      <td width="144" align="left" style="font-family:Verdana, sans-serif; font-size:14px;">&nbsp;&nbsp;<?php echo date("d-m-Y",strtotime($entry_time));?></td>
      <td align="left" style="font-family:Verdana, sans-serif; font-size:14px;">&nbsp;&nbsp;<?php echo $operator_type;?></td>
      <td align="left" style="font-family:Verdana, sans-serif; font-size:14px;">&nbsp;<?php echo $pay_slip_no;?></td>
      <td align="right" style="font-family:Verdana, sans-serif; font-size:14px;"><?php echo number_format($tot_amount,3);?>&nbsp;</td>
      <td align="center" style="font-family:Verdana, sans-serif; font-size:14px;"><?php echo $invoice_no;?></td>
      <?php $totalss+=$tot_amount; } ?>
      
    </tr><tr>
   
    <td align="right" colspan="4" style="font-family:Verdana, sans-serif; font-size:14px; border-bottom:1px dashed; border-top:1px dashed; "><strong>Total&nbsp;</strong></td>
    <td align="right" style="font-family:Verdana, sans-serif; font-size:14px; border-top:1px dashed; border-bottom:1px dashed;"><strong><?php echo number_format($totalss,3);?></strong></td> 
   <td align="center" style="font-family:Verdana, sans-serif; font-size:14px; border-top:1px dashed; border-bottom:1px dashed;"></td> 
    
  </tr>
  </table></td>
</tr>
 
<tr>
<td colspan="6" align="center" class="style5 style23" style="font-family:Verdana, sans-serif; font-size:12px; font-family:Verdana, sans-serif; font-size:large"><table width="980" align="center">
  <tr>
    <td width="859" align="right" style=" font-family:Verdana, sans-serif; font-size:14px;"> Printed Date : <?php echo date('d-m-Y');?></td>
  </tr>
</table></td>
</tr>
</table>
</div>
</div>
</div>
</div>