<?php
session_name('CAKEPHP'); session_start();
ob_start();
$PageSecurity = 1;
include('config.php');
include('includes/ConnectDB.inc');
include('includes/function_lib.php');
include('includes/LanguageSetup.php');
include('includes/DateFunctions.inc');
include('./includes/fun-php.php');
include('./includes/fun-HRClass.php');

setlocale(LC_MONETARY, 'en_IN');
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<head>
  <meta http-equiv='Content-Type' content='text/html; charset=UTF-8' />

<title>PF Register</title>
<style type="text/css" media="print"> 
/* ----------------- Print -------------------- */
@page{
     size : landscape;
    margin:50px;
}
</style>
<style type="text/css">
@media print{
    * { margin: 0; padding-left: 0; padding-right: 0; }
   body { writing-mode:vertical-lr;
        -webkit-transform: rotate(90deg); -moz-transform:rotate(90deg);
     filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=3);
    }
body{ margin:0px; padding:0px; font-size:12px; font-family: "Times New Roman", Times, serif; color:#000; font-weight:normal;}
h1,h2,h3,h4,h5,p{ margin:0px; padding:0px;}
.wrapper{ width:1020px; border:1px solid #000; margin:0 auto; }

thead{display: table-header-group;}
/*tbody {
    display:table-row-group;
}*/
.div_first{
  width:100%; height: auto; float: left;
  border-top: #000000 1px solid !important;
  /*border-bottom: #000000 1px solid;*/
}
.div_first .left
{
  width:17%; float:left; text-align:center; height:auto; vertical-align:middle; padding: 10px;
}
.div_first .right
{
  width:79%; height: auto; float:left; text-align:center; border-left:#000000 1px solid !important; padding: 5px 0;
}
.div_forth{ width:100%; height:auto; float: left;}
.div_forth table tr th{ border-bottom:#000000 1px solid !important; border-right:#000000 1px solid !important; border-top:#000000 1px solid !important;}
.div_forth table tr th:last-child{border-right:0 !important;}
.div_forth table tr td{ border-bottom:#000000 1px solid !important; border-right:#000000 1px solid !important;}
.div_forth table tr td:last-child{border-right:0 !important;}
.div_forth table tr:last-child td{ border-bottom:0 !important;}

h2{
  font-size: 20px;
  font-weight:normal;
  font-family:"Times New Roman",Times,serif;
  margin:0px;
  padding:0px;
  color:#000;  
}
h3{color: #003399;
    font-family: "Times New Roman",Times,serif;
    font-size: 18px;
    margin: 0 0 2px;
    padding: 0 0 3px;
    text-align: center;
    text-decoration: none;
    text-transform: uppercase;
  }
.f10{font-family:"Times New Roman", Times, serif; color:#000; font-size:12px; line-height: 18px;}
.f11{ font-family:"Times New Roman", Times, serif; color:#000; font-size:13px; line-height:18px;}
.f12{ font-family:"Times New Roman", Times, serif; font-weight: bold; color:#000; font-size:14px; line-height: 18px;}
.mt26{margin-top:10%; width: 50%;}
.clr{clear:both;}
.ht{height:36px;}
.h60{height: 40px;}
.pagebreak { page-break-before: inherit; }
}
</style>

<style type="text/css">
@media screen{
/* CSS Document */
body{ margin:0px; padding:0px; font-size:10px; font-family: Arial, Helvetica, sans-serif;  font-weight:normal;}
h1,h2,h3,h4,h5,p{ margin:0px; padding:0px;}
p{ text-align:left;}
.wrapper{
  width: 1200px;
  /* [disabled]height:1220px; */
  background-color: #FFF;
  border: 1px solid #000;
  margin:0 auto;
}
.clr{clear:both;}
.div_first{
  width: 1200px;
  border-bottom: #000000 1px solid;
  border-top: #000000 1px solid;
  float: left;
}
.div_first .left{
  width: 100px;
  float:left;
  text-align:center;
  padding-top:10px;
  padding-bottom:10px;
   border-right:#000 1px solid;
  
}
.div_first .right{
  width:1099px;
  float:left; 
  padding-top:10px;
  padding-bottom:10px;
  text-align:center;
}
h2{
  font-size: 20px;
  font-weight:normal;
  font-family:"Times New Roman",Times,serif;
  margin:0px;
  padding:0px;
  color:#000;
  
}
h3{color: #003399;
    font-family: "Times New Roman",Times,serif;
    font-size: 18px;
    margin: 0 0 2px;
    padding: 0 0 3px;
    text-align: center;
    text-decoration: none;
    text-transform: uppercase;}
.div_second{ width:860px; border-bottom: #000000 1px solid;}
.div_second .ship{ width:100px; float:left; text-align:center;}
.div_second .left{width:379px; float:left; border-left:#000 1px solid;  border-right:#000 1px solid;}
.div_second .right{width:379px; float:left;}


.div_third{width:860px; margin:auto; border-bottom: #000000 1px solid;}
.div_third .left{width:480px; float:left; }
.div_third .left .tophead{width:480px; height:25px; padding-top:0px; text-align:center; border-bottom:#000 1px solid;}
.div_third .right{border-left:#000 1px solid; width:379px; float:left;}
.div_third .right .tophead{width:379px; height:25px; padding-top:0px; text-align:center; border-bottom:#000 1px solid;}


.div_forth{
  width: 1200px; height: auto; float: left;
}
.div_forth table tr th {color:#000; font-size:12px; border-right:1px solid #000; border-bottom:1px solid #000; border-top:1px solid #000;}
.div_forth table tr th:last-child {border-right:none;}
.div_forth table tr td {color: #000;font-size: 12px; border-right: 1px solid #000; border-bottom: 1px solid #000;}
.div_forth table tr td:empty:after { content:" ";}
.div_forth table tr td:last-child{border-right:none;}

.div_fifth { border-bottom:#000 1px solid;}
.div_sixth {}
.f12{ font-family:Arial, Helvetica, sans-serif; font-weight: bold; color:#000; font-size:11px; line-height:16px;}
.f11{ font-family:Arial, Helvetica, sans-serif; color:#000; font-size:10px; line-height:16px;}
.f14{ font-family:Arial, Helvetica, sans-serif; color:#000; font-size:13px; line-height:24px;}
.border_top{border-top:#000 1px solid;}
.border_bottom{border-bottom:#000 1px solid;}
}
</style>
</head>
<body>
<div class="wrapper">
<?php 
   $sql1 = "SELECT * FROM companies where CompanyId='".$_SESSION['ACGCompanyId']."'";
  $sqlres = DB_query($sql1,$db);
  $companyRow = DB_fetch_array($sqlres);

  $arr=array(1=>"Jan","Feb","Mar","Apr","May","June","July","Aug","Sept","Oct","Nov","Dec");
  
// order Details

 
?>

  <h3>PF Register</h3>
  <p id="foo" align="right" style="text-align:right"> <a href="#" id="print" onclick="javascript:toggle_visibility('foo');" ><input type="button" value="Print" /></a> </p>
  <div class="div_first">
  <?php
   $logoImage=($companyRow['CompanyLogo']=='')?'index11.jpeg':$companyRow['CompanyLogo'];

   ?>
      <div class="left"><img src="Setup/CompanyLogo/<?php echo $logoImage;  ?>" width="60" /></div>
        <div class="right">
        
        <?php     
    if($companyRow['CompanyName']!="") {echo "<h2>".$companyRow['CompanyName']."</h2>"; } else { echo "";}
    if($companyRow['Address1']!="") {echo "<span class='f11'>".$companyRow['Address1']."</span>"; } else { echo "";}
    if($companyRow['Address2']!="") {echo "<span class='f11'>". $companyRow['Address2']."</span>"; } else { echo "";}
    if($companyRow['Address3']!="") {echo ",<span class='f11'>". $companyRow['Address3']."</span>"; } else { echo "";}
    if($companyRow['City']!="") {echo ",<span class='f11'>". $companyRow['City']."</span>"; } else { echo "";}
    if($companyRow['State']!="") {echo ",<span class='f11'>". $companyRow['State']."</span>"; } else { echo "";}
    if($companyRow['Country']!="") {echo ",<span class='f11'>".  $companyRow['Country']."</span>";
    if($companyRow['Zipcode']!="") {echo " - <span class='f11'>".$companyRow['Zipcode']."</span>"; } else { echo "";}

     } else { echo "";}
    echo "<br><span class='f11'>"."Phone No.".$companyRow['Phone'].", Fax No.".$companyRow['fax'].",   Email ID.".$companyRow['email'].",  Website".$companyRow['website']."</span>"; 
  ?>
    <br/>
        <strong>Branch:</strong><?php echo $s->getField('locations','loccode',$_SESSION['site'],'locationname'); ?>
         <?php if($_SESSION['pf_month']!='') {?><strong>Month:</strong><?php echo $arr[$_SESSION['pf_month']]; ?> <?php } ?>
        <strong>Year:</strong><?php echo $_SESSION['pf_year'];?>

        </div>
  </div>

        <div class="clr"></div>

<?php 
 $employer_esi=DB_fetch_array(DB_query("select * from esi_master where site='".$_REQUEST['site']."' and salto<='15000'",$db));
	  $Employee_per=$employer_esi['esiper']; 
	  $Employer_per=$employer_esi['employerper'];
?>
	<div class="div_forth">
  <table width="100%" border="0" cellspacing="0" cellpadding="3">
  <thead>
  <tr>
    <th width="5%" rowspan="2" class="f12">S.<br>No.</th>
    <th width="5%" rowspan="2" class="f12">Emp. No.</th>
    <th width="6%" rowspan="2" class="f12">P.F. No</th>
    <th rowspan="2" class="f12">Employee Name</th>
    <th width="5%" rowspan="2" class="f12">Date of Birth</th>
    <th width="5%" rowspan="2" class="f12">Date of Joining</th>
    <th width="3%" rowspan="2" class="f12">Abs Days</th>
    <th width="5%" rowspan="2" class="f12">Wages</th>
    <th width="5%" rowspan="2" class="f12">Employee's PF(12%)</th>
    <th width="10%" colspan="3" class="f12">Employer's PF</th>
    <th width="4%" rowspan="2" class="f12">Total PF</th>
    <th width="6%" rowspan="2" class="f12">Basic above 15000</th>
    <th width="10%" colspan="3" class="f12">Admin Expenses</th>
    <th width="5%" rowspan="2" class="f12">Date of Leaving</th>
  </tr>
  <tr>
    <th width="3%" class="f12">PF<br />(3.67%)</th>
    <th width="3%" class="f12">EPS<br />(8.33%)</th>
    <th class="f12">Total</th>
    <th width="3%" class="f12">PF<br />(1.1%)</th>
    <th width="3%" class="f12">PF<br />(0.5%)</th>
    <th class="f12" style="border-right:#000000 1px solid !important;">PF<br />(0.01%)</th>
  </tr>
  </thead>
    <tbody>
   <?php
	if(!empty($_SESSION['Pf_Emp_details']))
	{
     $i=1;
	    $GetProcess = $_SESSION['Pf_Emp_details'];	 	   
       foreach($GetProcess as $key=>$value)
       {

	  ?> 
  <tr class="f11">
    <td><?php   echo $i; ?></td>
    <td><?php   echo $value['Pf_no']; ?></td>
    <td><?php   echo $value['Emp_code']; ?></td>
    <td><?php   echo $value['Emp_name']; ?></td>
    <td><?php   echo $value['dob']; ?></td>
    <td><?php   echo $value['doj']; ?></td>
    <td align="right"><?php   echo $value['abs_days']; ?></td>
    <td align="right" class="align_right"><?php   echo $value['basic_salary']; ?></td>
    <td align="right" class="align_right"><?php   echo $value['totalpf1']; ?></td>
    <td align="right" class="align_right"><?php   echo $value['totalpf2']; ?></td>
    <td align="right" class="align_right"><?php   echo $value['totalpf3']; ?></td>
    <td align="right" class="align_right"><?php   echo $value['totalpf']; ?></td>
    <td align="right" class="align_right"><?php   echo $value['totalpf_amt']; ?></td>
    <td align="right" class="align_right"><?php echo $value['above']; ?></td>
    <td align="right" class="align_right"><?php   echo $value['totalpf4']; ?></td>
    <td align="right" class="align_right"><?php   echo $value['totalpf5']; ?></td>
    <td align="right" class="align_right"><?php   echo $value['totalpf6']; ?></td>
    <td align="right" class="align_right">&nbsp;<?php   echo $value['leaving_date']; ?></td>
  </tr>
  	<?php $grand_pf=$grand_pf+$value['totalpf_amt'];   $i++;  } ?>
    <div class="pagebreak"></div>
   <tr>
     <td colspan="12" style="text-align:right"><strong>Grand Total</strong></td>
     <td style="text-align:right;"><strong><?php echo money_format('%!i',$grand_pf); ?></strong></td>
     <td colspan="5">&nbsp;</td>
  </tr>
  <?php 
   } else { ?>
     <tr>
    <td colspan="18" class="f11"><strong>No Records Found</strong></td>
    </tr>
    <?php } ?>
    </tbody>
</table>
	</div>
       
        <div class="clr"></div>

<script type="text/javascript" language="javascript">
  function toggle_visibility(id) {
       var e = document.getElementById(id);
	      e.style.display = 'none';
		       //alert(e.style.display);
			   window.print();
    }
  
</script>

</div>
</body>
</html>	