<?php require "_header.php";
?>
<div id="main-report">
<center><h4>Yearly Gross Salary Monthwise </h4></center>
<?php 
if($_REQUEST['Yearfrom'] =="" && $_REQUEST['Yearto']== "" && $_REQUEST['month_idfrom'] == "" )
{
?>
	
	<script language="javascript" type="text/javascript">
		location.href='report-form-yearly-gross-salary-monthwise.php';
	</script>
	
<?php
}
elseif($_SESSION['VedantnrCollegeId']!="" && isset($_SESSION['VedantnrCollegeId'])) 
{
		
	    $yearfrom		= 	Escape($_REQUEST['Yearfrom']);

	//	echo $yearfrom; exit;
		$year			=	Escape($_REQUEST['Yearfrom']);
	    $yearto			= 	Escape($_REQUEST['Yearto']);
	    $monthfrom		= 	Escape($_REQUEST['month_idfrom']);
	    $monthto		= 	'12' ;
	    $employee_id 	=   Escape($_REQUEST['ID']);
		
		$months = "";
	 	$nmnth = "";
		$mnthflg = 0;
		$condition = "";
		
		for($i = $monthfrom; $i != $monthto ; $i++)
		{
		    $i;
			if($i== 13)
			{
				$i = 1;
				$mnthflg = 1;
			}
			if ($mnthflg == 0)
			    $months .= $i .",";
			if($mnthflg ==1)
				$nmnth .=$i.",";
			if($i== 1 && $monthto == 1)
			{
				$i = 0;
				$mnthflg = 1;
			}
		}
		
		if($monthto != 1)
		{
			$nmnth .= $monthto;
		}
		else
		$nmnth = substr($nmnth,0,strlen($nmnth)-1);
		$months = substr($months,0,strlen($months)-1);
		$header_row_string="Yearly Gross Salary Monthwise";
		$qry="";
	
	     if(isset($_REQUEST["ID"])){  
			if($employee_id!=""){
				$condition.=" and employee_id = '$employee_id'";
			}
		}	
	
		$objEmp = new EmployeeMgmt();
		$out1 = $objEmp->getAllRecords($limit,$start,$condition,$order_field,$order_type);	
		
		if(dbRows($out1)) 
		{
	        ob_start();
			while($row1=dbArray($out1)) {
        		extract($row1);			
?>	
  <h1>	
 
  <b style="color:#666">Employee Name:</b> <?php print $row1['employee_name'];?><br/>
  <b style="color:#666">Designation:</b> <?php print $row1['employee_designation1'];?>
  <b style="color:#666">Salary No:</b><?php print $row1['employee_salaryno'];?>
  </h1>
<?php
    $year = $yearfrom;
    $startMonth = 0;
	$arrmonthname = array("January","February","March","April","May","June","July","August","September","October","November","December");
	$headMonth = $monthfrom;
	$month = 1;
	
	$totalbasic=0;
	$totalda=0;
	$totaldp=0;
	
	
	$totalhra=0;
	$totalmedi=0;
	$totalcca=0;
	
	$totalpta=0;
	$totalprinall=0;
	$totalsupall=0;
	
	$totalhsall=0;
	$totalwasall=0;
	$totalcashall=0;
	
	$totalfall=0;
	$totalhall=0;
	$totalta=0;
	
	$totalle=0;
	$totalltc=0;
	$totalspay=0;
	
	$totalbonus=0;
	$totalarias=0;
	$totaladdda=0;
	
	$totalir=0;
	$totalotherin=0;
	
	$totalgpf=0;
	$totalcpf=0;
	
	$totalgpfl=0;
	$totalcpfl=0;
	$totalhl=0;
	
	$totalpt=0;
	$totallic=0;
	$totalit=0;
	
	$totalfood=0;
	$totalfest=0;
	
	$totals1=0;
	$totals2=0;
	
	$totalpli=0;
	$totalrec=0;
	$totalgi=0;
	
	$totalmr1=0;
	$totalmr2=0;
	
	$totalod=0;
	
	
	$totalgrosp=0;
	$totalgrosd=0;
	$totalnetp=0;
?>
  		<table class="report" cellpadding="0" cellspacing="0" style="font-size:9px">
	    <thead>
		    <tr>
              <th width="3%" align="left">Year</th>
		      <th width="4%" align="left">Month</th>
		      <th align="left">Basic/<br/>
		        DA/<br/>
		        Grade Pay</th>
		      <th align="left">HRA/<br/>
		        Medical/<br/>
		        CCA/CLA</th>
		      <th align="center">PTA/<br/>
		        Principal All./<br/>
		        Supervisor All.</th>
		      <th align="left">H.S.All./<br/>
		        Wash All./<br/>
		        Cash All.</th>
		      <th align="left">Family All./<br/>
		        Handicap All./<br/>
		        TA</th>
		      <th align="left">Leave Encash/<br/>
		        LTC/<br/>
		        Sp. Pay</th>
		      <th align="center">Bonus/<br/>
		        Arias/<br/>
		        Add. DA</th>
		      <th align="left">IR/<br/>
		        Other Income</th>
		      <th align="left">GPF/<br/>
		        CPF</th>
		      <th align="center">GPF Loan/<br/>
		        CPF Loan/<br/>
		        Housing Loan</th>
		      <th align="center">Prof. Tax/<br/>
		        LIC/<br/>
		        Income Tax</th>
		      <th align="center">Food Adv./<br/>
		        Festival Adv.</th>
		      <th align="center">Cr.Society/<br/>
		        Provident Fund</th>
		      <th align="center">Security Deposit/<br/>
		        Transport/<br/>
		        Charge.</th>
		      <th align="center">Misc.Rec.1/<br/>
		        LWP</th>
		      <th align="center">Other Deduction</th>
		      <th align="center">GrossPay/<br/>
		        Gross Deduction/<br/>
		        NetPay</th>
		      <th align="center">Notes</th>
		      <th align="center">Signature</th>
	      </tr>
		    <tr>
		      <td align="center" style="text-align:center"><?php if($headMonth == 13){$year++; echo $year;}else echo $year;?></td>
		      <td align="center" style="text-align:center"><?php if($headMonth == 13 ) $headMonth = 1;
				 echo $arrmonthname[$headMonth - 1];
				  $headMonth += 1;?></td>
				  <?php 				  
				  $result=getheaddetail($employee_id,$headMonth,$year);
				  if(dbrows($result)>0)
				  {
				    $row=dbArray($result);
					$vcol1 = explode("<br/>",$row['col1']);
					$totalbasic+=$vcol1[0];
					$totalda+=$vcol1[1];
					$totaldp+=$vcol1[2];
					
					$vcol2 = explode("<br/>",$row['col2']);
					$totalhra+=$vcol2[0];
					$totalmedi+=$vcol2[1];
					$totalcca+=$vcol2[2];
					
					$vcol3 = explode("<br/>",$row['col3']);
					$totalpta+=$vcol3[0];
					$totalprinall+=$vcol3[1];
					$totalsupall+=$vcol3[2];
					
					$vcol4 = explode("<br/>",$row['col4']);
					$totalhsall+=$vcol4[0];
					$totalwasall+=$vcol4[1];
					$totalcashall+=$vcol4[2];
					
					$vcol5 = explode("<br/>",$row['col5']);
					$totalfall+=$vcol5[0];
					$totalhall+=$vcol5[1];
					$totalta+=$vcol5[2];
					
					$vcol6 = explode("<br/>",$row['col6']);
					$totalle+=$vcol6[0];
					$totalltc+=$vcol6[1];
					$totalspay+=$vcol6[2];
					
					$vcol7 = explode("<br/>",$row['col7']);
					$totalbonus+=$vcol7[0];
					$totalarias+=$vcol7[1];
					$totaladdda+=$vcol7[2];
					
					$vcol8 = explode("<br/>",$row['col8']);
					$totalir+=$vcol8[0];
					$totalotherin+=$vcol8[1];
					
					$vcol9 = explode("<br/>",$row['col9']);
					$totalgpf+=$vcol9[0];
					$totalcpf+=$vcol9[1];
					
					$vcol10 = explode("<br/>",$row['col10']);
					$totalgpfl+=$vcol10[0];
					$totalcpfl+=$vcol10[1];
					$totalhl+=$vcol10[2];
					
					$vcol11 = explode("<br/>",$row['col11']);
					$totalpt+=$vcol11[0];
					$totallic+=$vcol11[1];
					$totalit+=$vcol11[2];
					
					$vcol12 = explode("<br/>",$row['col12']);
					$totalfood+=$vcol12[0];
					$totalfest+=$vcol12[1];
					
					$vcol13 = explode("<br/>",$row['col13']);
					$totals1+=$vcol13[0];
					$totals2+=$vcol13[1];
					
					$vcol14 = explode("<br/>",$row['col14']);
					$totalpli+=$vcol14[0];
					$totalrec+=$vcol14[1];
					$totalgi+=$vcol14[2];
					
					$vcol15 = explode("<br/>",$row['col15']);
					$totalmr1+=$vcol15[0];
					$totalmr2+=$vcol15[1];
					
					$vcol16 = explode("<br/>",$row['col16']);
					$totalod+=$vcol16[0];
					
					
					$vcol17 = explode("<br/>",$row['col17']);
					$totalgrosp+=$vcol17[0];
					$totalgrosd+=$vcol17[1];
					$totalnetp+=$vcol17[2];
					
				
				 ?>
		      <td style="text-align:right"><?php echo $row['col1'] ? $row['col1'] : " - ";?></td>
		      <td style="text-align:right"><?php  echo $row['col2'] ? $row['col2'] : " - ";?></td>
		      <td style="text-align:right"><?php  echo $row['col3'] ? $row['col3'] : " - ";?></td>
		      <td style="text-align:right"><?php echo $row['col4'] ? $row['col4'] : " - ";?></td>
		      <td style="text-align:right"><?php  echo $row['col5'] ? $row['col5'] : " - ";?></td>
		      <td style="text-align:right"><?php  echo $row['col6'] ? $row['col6'] : " - ";?></td>
		      <td style="text-align:right"><?php  echo $row['col7'] ? $row['col7'] : " - ";?></td>
		      <td style="text-align:right"><?php echo $row['col8'] ? $row['col8'] : " - ";?></td>
		      <td style="text-align:right"><?php  echo $row['col9'] ? $row['col9'] : " - ";?></td>
		      <td style="text-align:right"><?php  echo $row['col10'] ? $row['col10'] : " - ";?></td>
		      <td style="text-align:right"><?php  echo $row['col11'] ? $row['col11'] : " - ";?></td>
		      <td style="text-align:right"><?php  echo $row['col12'] ? $row['col12'] : " - ";?></td>
		      <td style="text-align:right"><?php echo $row['col13'] ? $row['col13'] : " - ";?></td>
		      <td style="text-align:right"><?php echo $row['col14'] ? $row['col14'] : " - ";?></td>
		      <td style="text-align:right"><?php echo $row['col15'] ? $row['col15'] : " - ";?></td>
		      <td style="text-align:right"><?php  echo $row['col16'] ? $row['col16'] : " - ";?></td>
		      <td style="text-align:right"><?php  echo $row['col17'] ? $row['col17'] : " - ";?></td>
		      <td align="center">&nbsp;</td>
		      <td align="center">&nbsp;</td>
			  <?php } ?>
	      </tr>
		    <tr>
		      <td align="center" style="text-align:center"><?php if($headMonth == 13){$year++; echo $year;}else echo $year;?></td>
		      <td align="center" style="text-align:center"><?php if($headMonth == 13 ) $headMonth = 1;
				 echo $arrmonthname[$headMonth - 1];
				  $headMonth += 1;?></td>
				   <?php 
				  $result=getheaddetail($employee_id,$headMonth,$year);
				  if(dbrows($result)>0)
				  {
				    $row=dbArray($result);
					$vcol1 = explode("<br/>",$row['col1'] );
					$totalbasic+=$vcol1[0];
					$totalda+=$vcol1[1];
					$totaldp+=$vcol1[2];
					
					$vcol2 = explode("<br/>",$row['col2']);
					$totalhra+=$vcol2[0];
					$totalmedi+=$vcol2[1];
					$totalcca+=$vcol2[2];
					
					$vcol3 = explode("<br/>",$row['col3']);
					$totalpta+=$vcol3[0];
					$totalprinall+=$vcol3[1];
					$totalsupall+=$vcol3[2];
					
					$vcol4 = explode("<br/>",$row['col4']);
					$totalhsall+=$vcol4[0];
					$totalwasall+=$vcol4[1];
					$totalcashall+=$vcol4[2];
					
					$vcol5 = explode("<br/>",$row['col5']);
					$totalfall+=$vcol5[0];
					$totalhall+=$vcol5[1];
					$totalta+=$vcol5[2];
					
					$vcol6 = explode("<br/>",$row['col6']);
					$totalle+=$vcol6[0];
					$totalltc+=$vcol6[1];
					$totalspay+=$vcol6[2];
					
					$vcol7 = explode("<br/>",$row['col7']);
					$totalbonus+=$vcol7[0];
					$totalarias+=$vcol7[1];
					$totaladdda+=$vcol7[2];
					
					$vcol8 = explode("<br/>",$row['col8']);
					$totalir+=$vcol8[0];
					$totalotherin+=$vcol8[1];
					
					$vcol9 = explode("<br/>",$row['col9']);
					$totalgpf+=$vcol9[0];
					$totalcpf+=$vcol9[1];
					
					$vcol10 = explode("<br/>",$row['col10']);
					$totalgpfl+=$vcol10[0];
					$totalcpfl+=$vcol10[1];
					$totalhl+=$vcol10[2];
					
					$vcol11 = explode("<br/>",$row['col11']);
					$totalpt+=$vcol11[0];
					$totallic+=$vcol11[1];
					$totalit+=$vcol11[2];
					
					$vcol12 = explode("<br/>",$row['col12']);
					$totalfood+=$vcol12[0];
					$totalfest+=$vcol12[1];
					
					$vcol13 = explode("<br/>",$row['col13']);
					$totals1+=$vcol13[0];
					$totals2+=$vcol13[1];
					
					$vcol14 = explode("<br/>",$row['col14']);
					$totalpli+=$vcol14[0];
					$totalrec+=$vcol14[1];
					$totalgi+=$vcol14[2];
					
					$vcol15 = explode("<br/>",$row['col15']);
					$totalmr1+=$vcol15[0];
					$totalmr2+=$vcol15[1];
					
					$vcol16 = explode("<br/>",$row['col16']);
					$totalod+=$vcol16[0];
					
					
					$vcol17 = explode("<br/>",$row['col17']);
					$totalgrosp+=$vcol17[0];
					$totalgrosd+=$vcol17[1];
					$totalnetp+=$vcol17[2];
					
					
				  
				
				 ?>
		     <td style="text-align:right"><?php echo $row['col1'] ? $row['col1'] : " - ";?></td>
		      <td style="text-align:right"><?php  echo $row['col2'] ? $row['col2'] : " - ";?></td>
		      <td style="text-align:right"><?php  echo $row['col3'] ? $row['col3'] : " - ";?></td>
		      <td style="text-align:right"><?php echo $row['col4'] ? $row['col4'] : " - ";?></td>
		      <td style="text-align:right"><?php  echo $row['col5'] ? $row['col5'] : " - ";?></td>
		      <td style="text-align:right"><?php  echo $row['col6'] ? $row['col6'] : " - ";?></td>
		      <td style="text-align:right"><?php  echo $row['col7'] ? $row['col7'] : " - ";?></td>
		      <td style="text-align:right"><?php echo $row['col8'] ? $row['col8'] : " - ";?></td>
		      <td style="text-align:right"><?php  echo $row['col9'] ? $row['col9'] : " - ";?></td>
		      <td style="text-align:right"><?php  echo $row['col10'] ? $row['col10'] : " - ";?></td>
		      <td style="text-align:right"><?php  echo $row['col11'] ? $row['col11'] : " - ";?></td>
		      <td style="text-align:right"><?php  echo $row['col12'] ? $row['col12'] : " - ";?></td>
		      <td style="text-align:right"><?php echo $row['col13'] ? $row['col13'] : " - ";?></td>
		      <td style="text-align:right"><?php echo $row['col14'] ? $row['col14'] : " - ";?></td>
		      <td style="text-align:right"><?php echo $row['col15'] ? $row['col15'] : " - ";?></td>
		      <td style="text-align:right"><?php  echo $row['col16'] ? $row['col16'] : " - ";?></td>
		      <td style="text-align:right"><?php  echo $row['col17'] ? $row['col17'] : " - ";?></td>
		      <td align="center">&nbsp;</td>
		      <td align="center">&nbsp;</td>
			   <?php } ?>
	      </tr>
		    <tr>
		      <td align="center" style="text-align:center"><?php if($headMonth == 13){$year++; echo $year;}else echo $year;?></td>
		      <td align="center" style="text-align:center"><?php if($headMonth == 13 ) $headMonth = 1;
				 echo $arrmonthname[$headMonth - 1];
				  $headMonth += 1;?></td>
				   <?php 
				  $result=getheaddetail($employee_id,$headMonth,$year);
				  if(dbrows($result)>0)
				  {
				    $row=dbArray($result);
					$vcol1 = explode("<br/>",$row['col1'] );
					$totalbasic+=$vcol1[0];
					$totalda+=$vcol1[1];
					$totaldp+=$vcol1[2];
					
					$vcol2 = explode("<br/>",$row['col2']);
					$totalhra+=$vcol2[0];
					$totalmedi+=$vcol2[1];
					$totalcca+=$vcol2[2];
					
					$vcol3 = explode("<br/>",$row['col3']);
					$totalpta+=$vcol3[0];
					$totalprinall+=$vcol3[1];
					$totalsupall+=$vcol3[2];
					
					$vcol4 = explode("<br/>",$row['col4']);
					$totalhsall+=$vcol4[0];
					$totalwasall+=$vcol4[1];
					$totalcashall+=$vcol4[2];
					
					$vcol5 = explode("<br/>",$row['col5']);
					$totalfall+=$vcol5[0];
					$totalhall+=$vcol5[1];
					$totalta+=$vcol5[2];
					
					$vcol6 = explode("<br/>",$row['col6']);
					$totalle+=$vcol6[0];
					$totalltc+=$vcol6[1];
					$totalspay+=$vcol6[2];
					
					$vcol7 = explode("<br/>",$row['col7']);
					$totalbonus+=$vcol7[0];
					$totalarias+=$vcol7[1];
					$totaladdda+=$vcol7[2];
					
					$vcol8 = explode("<br/>",$row['col8']);
					$totalir+=$vcol8[0];
					$totalotherin+=$vcol8[1];
					
					$vcol9 = explode("<br/>",$row['col9']);
					$totalgpf+=$vcol9[0];
					$totalcpf+=$vcol9[1];
					
					$vcol10 = explode("<br/>",$row['col10']);
					$totalgpfl+=$vcol10[0];
					$totalcpfl+=$vcol10[1];
					$totalhl+=$vcol10[2];
					
					$vcol11 = explode("<br/>",$row['col11']);
					$totalpt+=$vcol11[0];
					$totallic+=$vcol11[1];
					$totalit+=$vcol11[2];
					
					$vcol12 = explode("<br/>",$row['col12']);
					$totalfood+=$vcol12[0];
					$totalfest+=$vcol12[1];
					
					$vcol13 = explode("<br/>",$row['col13']);
					$totals1+=$vcol13[0];
					$totals2+=$vcol13[1];
					
					$vcol14 = explode("<br/>",$row['col14']);
					$totalpli+=$vcol14[0];
					$totalrec+=$vcol14[1];
					$totalgi+=$vcol14[2];
					
					$vcol15 = explode("<br/>",$row['col15']);
					$totalmr1+=$vcol15[0];
					$totalmr2+=$vcol15[1];
					
					$vcol16 = explode("<br/>",$row['col16']);
					$totalod+=$vcol16[0];
					
					
					$vcol17 = explode("<br/>",$row['col17']);
					$totalgrosp+=$vcol17[0];
					$totalgrosd+=$vcol17[1];
					$totalnetp+=$vcol17[2];
				  
				
				 ?>
		     <td style="text-align:right"><?php echo $row['col1'] ? $row['col1'] : " - ";?></td>
		      <td style="text-align:right"><?php  echo $row['col2'] ? $row['col2'] : " - ";?></td>
		      <td style="text-align:right"><?php  echo $row['col3'] ? $row['col3'] : " - ";?></td>
		      <td style="text-align:right"><?php echo $row['col4'] ? $row['col4'] : " - ";?></td>
		      <td style="text-align:right"><?php  echo $row['col5'] ? $row['col5'] : " - ";?></td>
		      <td style="text-align:right"><?php  echo $row['col6'] ? $row['col6'] : " - ";?></td>
		      <td style="text-align:right"><?php  echo $row['col7'] ? $row['col7'] : " - ";?></td>
		      <td style="text-align:right"><?php echo $row['col8'] ? $row['col8'] : " - ";?></td>
		      <td style="text-align:right"><?php  echo $row['col9'] ? $row['col9'] : " - ";?></td>
		      <td style="text-align:right"><?php  echo $row['col10'] ? $row['col10'] : " - ";?></td>
		      <td style="text-align:right"><?php  echo $row['col11'] ? $row['col11'] : " - ";?></td>
		      <td style="text-align:right"><?php  echo $row['col12'] ? $row['col12'] : " - ";?></td>
		      <td style="text-align:right"><?php echo $row['col13'] ? $row['col13'] : " - ";?></td>
		      <td style="text-align:right"><?php echo $row['col14'] ? $row['col14'] : " - ";?></td>
		      <td style="text-align:right"><?php echo $row['col15'] ? $row['col15'] : " - ";?></td>
		      <td style="text-align:right"><?php  echo $row['col16'] ? $row['col16'] : " - ";?></td>
		      <td style="text-align:right"><?php  echo $row['col17'] ? $row['col17'] : " - ";?></td>
		      <td align="center">&nbsp;</td>
		      <td align="center">&nbsp;</td>
			   <?php } ?>
	      </tr>
		    <tr>
		      <td align="center" style="text-align:center"><?php if($headMonth == 13){$year++; echo $year;}else echo $year;?></td>
		      <td align="center" style="text-align:center"><?php if($headMonth == 13 ) $headMonth = 1;
				 echo $arrmonthname[$headMonth - 1];
				  $headMonth += 1;?></td>
				   <?php 
				  $result=getheaddetail($employee_id,$headMonth,$year);
				  if(dbrows($result)>0)
				  {
				    $row=dbArray($result);
					$vcol1 = explode("<br/>",$row['col1'] );
					$totalbasic+=$vcol1[0];
					$totalda+=$vcol1[1];
					$totaldp+=$vcol1[2];
					
					$vcol2 = explode("<br/>",$row['col2']);
					$totalhra+=$vcol2[0];
					$totalmedi+=$vcol2[1];
					$totalcca+=$vcol2[2];
					
					$vcol3 = explode("<br/>",$row['col3']);
					$totalpta+=$vcol3[0];
					$totalprinall+=$vcol3[1];
					$totalsupall+=$vcol3[2];
					
					$vcol4 = explode("<br/>",$row['col4']);
					$totalhsall+=$vcol4[0];
					$totalwasall+=$vcol4[1];
					$totalcashall+=$vcol4[2];
					
					$vcol5 = explode("<br/>",$row['col5']);
					$totalfall+=$vcol5[0];
					$totalhall+=$vcol5[1];
					$totalta+=$vcol5[2];
					
					$vcol6 = explode("<br/>",$row['col6']);
					$totalle+=$vcol6[0];
					$totalltc+=$vcol6[1];
					$totalspay+=$vcol6[2];
					
					$vcol7 = explode("<br/>",$row['col7']);
					$totalbonus+=$vcol7[0];
					$totalarias+=$vcol7[1];
					$totaladdda+=$vcol7[2];
					
					$vcol8 = explode("<br/>",$row['col8']);
					$totalir+=$vcol8[0];
					$totalotherin+=$vcol8[1];
					
					$vcol9 = explode("<br/>",$row['col9']);
					$totalgpf+=$vcol9[0];
					$totalcpf+=$vcol9[1];
					
					$vcol10 = explode("<br/>",$row['col10']);
					$totalgpfl+=$vcol10[0];
					$totalcpfl+=$vcol10[1];
					$totalhl+=$vcol10[2];
					
					$vcol11 = explode("<br/>",$row['col11']);
					$totalpt+=$vcol11[0];
					$totallic+=$vcol11[1];
					$totalit+=$vcol11[2];
					
					$vcol12 = explode("<br/>",$row['col12']);
					$totalfood+=$vcol12[0];
					$totalfest+=$vcol12[1];
					
					$vcol13 = explode("<br/>",$row['col13']);
					$totals1+=$vcol13[0];
					$totals2+=$vcol13[1];
					
					$vcol14 = explode("<br/>",$row['col14']);
					$totalpli+=$vcol14[0];
					$totalrec+=$vcol14[1];
					$totalgi+=$vcol14[2];
					
					$vcol15 = explode("<br/>",$row['col15']);
					$totalmr1+=$vcol15[0];
					$totalmr2+=$vcol15[1];
					
					$vcol16 = explode("<br/>",$row['col16']);
					$totalod+=$vcol16[0];
					
					
					$vcol17 = explode("<br/>",$row['col17']);
					$totalgrosp+=$vcol17[0];
					$totalgrosd+=$vcol17[1];
					$totalnetp+=$vcol17[2];
				  
				
				 ?>
		      <td style="text-align:right"><?php echo $row['col1'] ? $row['col1'] : " - ";?></td>
		      <td style="text-align:right"><?php  echo $row['col2'] ? $row['col2'] : " - ";?></td>
		      <td style="text-align:right"><?php  echo $row['col3'] ? $row['col3'] : " - ";?></td>
		      <td style="text-align:right"><?php echo $row['col4'] ? $row['col4'] : " - ";?></td>
		      <td style="text-align:right"><?php  echo $row['col5'] ? $row['col5'] : " - ";?></td>
		      <td style="text-align:right"><?php  echo $row['col6'] ? $row['col6'] : " - ";?></td>
		      <td style="text-align:right"><?php  echo $row['col7'] ? $row['col7'] : " - ";?></td>
		      <td style="text-align:right"><?php echo $row['col8'] ? $row['col8'] : " - ";?></td>
		      <td style="text-align:right"><?php  echo $row['col9'] ? $row['col9'] : " - ";?></td>
		      <td style="text-align:right"><?php  echo $row['col10'] ? $row['col10'] : " - ";?></td>
		      <td style="text-align:right"><?php  echo $row['col11'] ? $row['col11'] : " - ";?></td>
		      <td style="text-align:right"><?php  echo $row['col12'] ? $row['col12'] : " - ";?></td>
		      <td style="text-align:right"><?php echo $row['col13'] ? $row['col13'] : " - ";?></td>
		      <td style="text-align:right"><?php echo $row['col14'] ? $row['col14'] : " - ";?></td>
		      <td style="text-align:right"><?php echo $row['col15'] ? $row['col15'] : " - ";?></td>
		      <td style="text-align:right"><?php  echo $row['col16'] ? $row['col16'] : " - ";?></td>
		      <td style="text-align:right"><?php  echo $row['col17'] ? $row['col17'] : " - ";?></td>
		      <td align="center">&nbsp;</td>
		      <td align="center">&nbsp;</td>
			   <?php } ?>
	      </tr>
		    <tr>
		      <td align="center" style="text-align:center"><?php if($headMonth == 13){$year++; echo $year;}else echo $year;?></td>
		      <td align="center" style="text-align:center"><?php if($headMonth == 13 ) $headMonth = 1;
				 echo $arrmonthname[$headMonth - 1];
				  $headMonth += 1;?></td>
				   <?php 
				  $result=getheaddetail($employee_id,$headMonth,$year);
				  if(dbrows($result)>0)
				  {
				    $row=dbArray($result);
					$vcol1 = explode("<br/>",$row['col1'] );
					$totalbasic+=$vcol1[0];
					$totalda+=$vcol1[1];
					$totaldp+=$vcol1[2];
					
					$vcol2 = explode("<br/>",$row['col2']);
					$totalhra+=$vcol2[0];
					$totalmedi+=$vcol2[1];
					$totalcca+=$vcol2[2];
					
					$vcol3 = explode("<br/>",$row['col3']);
					$totalpta+=$vcol3[0];
					$totalprinall+=$vcol3[1];
					$totalsupall+=$vcol3[2];
					
					$vcol4 = explode("<br/>",$row['col4']);
					$totalhsall+=$vcol4[0];
					$totalwasall+=$vcol4[1];
					$totalcashall+=$vcol4[2];
					
					$vcol5 = explode("<br/>",$row['col5']);
					$totalfall+=$vcol5[0];
					$totalhall+=$vcol5[1];
					$totalta+=$vcol5[2];
					
					$vcol6 = explode("<br/>",$row['col6']);
					$totalle+=$vcol6[0];
					$totalltc+=$vcol6[1];
					$totalspay+=$vcol6[2];
					
					$vcol7 = explode("<br/>",$row['col7']);
					$totalbonus+=$vcol7[0];
					$totalarias+=$vcol7[1];
					$totaladdda+=$vcol7[2];
					
					$vcol8 = explode("<br/>",$row['col8']);
					$totalir+=$vcol8[0];
					$totalotherin+=$vcol8[1];
					
					$vcol9 = explode("<br/>",$row['col9']);
					$totalgpf+=$vcol9[0];
					$totalcpf+=$vcol9[1];
					
					$vcol10 = explode("<br/>",$row['col10']);
					$totalgpfl+=$vcol10[0];
					$totalcpfl+=$vcol10[1];
					$totalhl+=$vcol10[2];
					
					$vcol11 = explode("<br/>",$row['col11']);
					$totalpt+=$vcol11[0];
					$totallic+=$vcol11[1];
					$totalit+=$vcol11[2];
					
					$vcol12 = explode("<br/>",$row['col12']);
					$totalfood+=$vcol12[0];
					$totalfest+=$vcol12[1];
					
					$vcol13 = explode("<br/>",$row['col13']);
					$totals1+=$vcol13[0];
					$totals2+=$vcol13[1];
					
					$vcol14 = explode("<br/>",$row['col14']);
					$totalpli+=$vcol14[0];
					$totalrec+=$vcol14[1];
					$totalgi+=$vcol14[2];
					
					$vcol15 = explode("<br/>",$row['col15']);
					$totalmr1+=$vcol15[0];
					$totalmr2+=$vcol15[1];
					
					$vcol16 = explode("<br/>",$row['col16']);
					$totalod+=$vcol16[0];
					
					
					$vcol17 = explode("<br/>",$row['col17']);
					$totalgrosp+=$vcol17[0];
					$totalgrosd+=$vcol17[1];
					$totalnetp+=$vcol17[2];
				  
				
				 ?>
		      <td style="text-align:right"><?php echo $row['col1'] ? $row['col1'] : " - ";?></td>
		      <td style="text-align:right"><?php  echo $row['col2'] ? $row['col2'] : " - ";?></td>
		      <td style="text-align:right"><?php  echo $row['col3'] ? $row['col3'] : " - ";?></td>
		      <td style="text-align:right"><?php echo $row['col4'] ? $row['col4'] : " - ";?></td>
		      <td style="text-align:right"><?php  echo $row['col5'] ? $row['col5'] : " - ";?></td>
		      <td style="text-align:right"><?php  echo $row['col6'] ? $row['col6'] : " - ";?></td>
		      <td style="text-align:right"><?php  echo $row['col7'] ? $row['col7'] : " - ";?></td>
		      <td style="text-align:right"><?php echo $row['col8'] ? $row['col8'] : " - ";?></td>
		      <td style="text-align:right"><?php  echo $row['col9'] ? $row['col9'] : " - ";?></td>
		      <td style="text-align:right"><?php  echo $row['col10'] ? $row['col10'] : " - ";?></td>
		      <td style="text-align:right"><?php  echo $row['col11'] ? $row['col11'] : " - ";?></td>
		      <td style="text-align:right"><?php  echo $row['col12'] ? $row['col12'] : " - ";?></td>
		      <td style="text-align:right"><?php echo $row['col13'] ? $row['col13'] : " - ";?></td>
		      <td style="text-align:right"><?php echo $row['col14'] ? $row['col14'] : " - ";?></td>
		      <td style="text-align:right"><?php echo $row['col15'] ? $row['col15'] : " - ";?></td>
		      <td style="text-align:right"><?php  echo $row['col16'] ? $row['col16'] : " - ";?></td>
		      <td style="text-align:right"><?php  echo $row['col17'] ? $row['col17'] : " - ";?></td>
		      <td align="center">&nbsp;</td>
		      <td align="center">&nbsp;</td>
			   <?php } ?>
	      </tr>
		    <tr>
		      <td align="center" style="text-align:center"><?php if($headMonth == 13){$year++; echo $year;}else echo $year;?></td>
		      <td align="center" style="text-align:center"><?php if($headMonth == 13 ) $headMonth = 1;
				 echo $arrmonthname[$headMonth - 1];
				  $headMonth += 1;?></td>
				   <?php 
				  $result=getheaddetail($employee_id,$headMonth,$year);
				  if(dbrows($result)>0)
				  {
				    $row=dbArray($result);
					$vcol1 = explode("<br/>",$row['col1'] );
					$totalbasic+=$vcol1[0];
					$totalda+=$vcol1[1];
					$totaldp+=$vcol1[2];
					
					$vcol2 = explode("<br/>",$row['col2']);
					$totalhra+=$vcol2[0];
					$totalmedi+=$vcol2[1];
					$totalcca+=$vcol2[2];
					
					$vcol3 = explode("<br/>",$row['col3']);
					$totalpta+=$vcol3[0];
					$totalprinall+=$vcol3[1];
					$totalsupall+=$vcol3[2];
					
					$vcol4 = explode("<br/>",$row['col4']);
					$totalhsall+=$vcol4[0];
					$totalwasall+=$vcol4[1];
					$totalcashall+=$vcol4[2];
					
					$vcol5 = explode("<br/>",$row['col5']);
					$totalfall+=$vcol5[0];
					$totalhall+=$vcol5[1];
					$totalta+=$vcol5[2];
					
					$vcol6 = explode("<br/>",$row['col6']);
					$totalle+=$vcol6[0];
					$totalltc+=$vcol6[1];
					$totalspay+=$vcol6[2];
					
					$vcol7 = explode("<br/>",$row['col7']);
					$totalbonus+=$vcol7[0];
					$totalarias+=$vcol7[1];
					$totaladdda+=$vcol7[2];
					
					$vcol8 = explode("<br/>",$row['col8']);
					$totalir+=$vcol8[0];
					$totalotherin+=$vcol8[1];
					
					$vcol9 = explode("<br/>",$row['col9']);
					$totalgpf+=$vcol9[0];
					$totalcpf+=$vcol9[1];
					
					$vcol10 = explode("<br/>",$row['col10']);
					$totalgpfl+=$vcol10[0];
					$totalcpfl+=$vcol10[1];
					$totalhl+=$vcol10[2];
					
					$vcol11 = explode("<br/>",$row['col11']);
					$totalpt+=$vcol11[0];
					$totallic+=$vcol11[1];
					$totalit+=$vcol11[2];
					
					$vcol12 = explode("<br/>",$row['col12']);
					$totalfood+=$vcol12[0];
					$totalfest+=$vcol12[1];
					
					$vcol13 = explode("<br/>",$row['col13']);
					$totals1+=$vcol13[0];
					$totals2+=$vcol13[1];
					
					$vcol14 = explode("<br/>",$row['col14']);
					$totalpli+=$vcol14[0];
					$totalrec+=$vcol14[1];
					$totalgi+=$vcol14[2];
					
					$vcol15 = explode("<br/>",$row['col15']);
					$totalmr1+=$vcol15[0];
					$totalmr2+=$vcol15[1];
					
					$vcol16 = explode("<br/>",$row['col16']);
					$totalod+=$vcol16[0];
					
					
					$vcol17 = explode("<br/>",$row['col17']);
					$totalgrosp+=$vcol17[0];
					$totalgrosd+=$vcol17[1];
					$totalnetp+=$vcol17[2];
				  
				
				 ?>
		       <td style="text-align:right"><?php echo $row['col1'] ? $row['col1'] : " - ";?></td>
		      <td style="text-align:right"><?php  echo $row['col2'] ? $row['col2'] : " - ";?></td>
		      <td style="text-align:right"><?php  echo $row['col3'] ? $row['col3'] : " - ";?></td>
		      <td style="text-align:right"><?php echo $row['col4'] ? $row['col4'] : " - ";?></td>
		      <td style="text-align:right"><?php  echo $row['col5'] ? $row['col5'] : " - ";?></td>
		      <td style="text-align:right"><?php  echo $row['col6'] ? $row['col6'] : " - ";?></td>
		      <td style="text-align:right"><?php  echo $row['col7'] ? $row['col7'] : " - ";?></td>
		      <td style="text-align:right"><?php echo $row['col8'] ? $row['col8'] : " - ";?></td>
		      <td style="text-align:right"><?php  echo $row['col9'] ? $row['col9'] : " - ";?></td>
		      <td style="text-align:right"><?php  echo $row['col10'] ? $row['col10'] : " - ";?></td>
		      <td style="text-align:right"><?php  echo $row['col11'] ? $row['col11'] : " - ";?></td>
		      <td style="text-align:right"><?php  echo $row['col12'] ? $row['col12'] : " - ";?></td>
		      <td style="text-align:right"><?php echo $row['col13'] ? $row['col13'] : " - ";?></td>
		      <td style="text-align:right"><?php echo $row['col14'] ? $row['col14'] : " - ";?></td>
		      <td style="text-align:right"><?php echo $row['col15'] ? $row['col15'] : " - ";?></td>
		      <td style="text-align:right"><?php  echo $row['col16'] ? $row['col16'] : " - ";?></td>
		      <td style="text-align:right"><?php  echo $row['col17'] ? $row['col17'] : " - ";?></td>
		      <td align="center">&nbsp;</td>
		      <td align="center">&nbsp;</td>
			   <?php } ?>
	      </tr>
		    <tr>
		      <td align="center" style="text-align:center"><?php if($headMonth == 13){$year++; echo $year;}else echo $year;?></td>
		      <td align="center" style="text-align:center"><?php if($headMonth == 13 ) $headMonth = 1;
				 echo $arrmonthname[$headMonth - 1];
				  $headMonth += 1;?></td>
				   <?php 
				  $result=getheaddetail($employee_id,$headMonth,$year);
				  if(dbrows($result)>0)
				  {
				    $row=dbArray($result);
					$vcol1 = explode("<br/>",$row['col1'] );
					$totalbasic+=$vcol1[0];
					$totalda+=$vcol1[1];
					$totaldp+=$vcol1[2];
					
					$vcol2 = explode("<br/>",$row['col2']);
					$totalhra+=$vcol2[0];
					$totalmedi+=$vcol2[1];
					$totalcca+=$vcol2[2];
					
					$vcol3 = explode("<br/>",$row['col3']);
					$totalpta+=$vcol3[0];
					$totalprinall+=$vcol3[1];
					$totalsupall+=$vcol3[2];
					
					$vcol4 = explode("<br/>",$row['col4']);
					$totalhsall+=$vcol4[0];
					$totalwasall+=$vcol4[1];
					$totalcashall+=$vcol4[2];
					
					$vcol5 = explode("<br/>",$row['col5']);
					$totalfall+=$vcol5[0];
					$totalhall+=$vcol5[1];
					$totalta+=$vcol5[2];
					
					$vcol6 = explode("<br/>",$row['col6']);
					$totalle+=$vcol6[0];
					$totalltc+=$vcol6[1];
					$totalspay+=$vcol6[2];
					
					$vcol7 = explode("<br/>",$row['col7']);
					$totalbonus+=$vcol7[0];
					$totalarias+=$vcol7[1];
					$totaladdda+=$vcol7[2];
					
					$vcol8 = explode("<br/>",$row['col8']);
					$totalir+=$vcol8[0];
					$totalotherin+=$vcol8[1];
					
					$vcol9 = explode("<br/>",$row['col9']);
					$totalgpf+=$vcol9[0];
					$totalcpf+=$vcol9[1];
					
					$vcol10 = explode("<br/>",$row['col10']);
					$totalgpfl+=$vcol10[0];
					$totalcpfl+=$vcol10[1];
					$totalhl+=$vcol10[2];
					
					$vcol11 = explode("<br/>",$row['col11']);
					$totalpt+=$vcol11[0];
					$totallic+=$vcol11[1];
					$totalit+=$vcol11[2];
					
					$vcol12 = explode("<br/>",$row['col12']);
					$totalfood+=$vcol12[0];
					$totalfest+=$vcol12[1];
					
					$vcol13 = explode("<br/>",$row['col13']);
					$totals1+=$vcol13[0];
					$totals2+=$vcol13[1];
					
					$vcol14 = explode("<br/>",$row['col14']);
					$totalpli+=$vcol14[0];
					$totalrec+=$vcol14[1];
					$totalgi+=$vcol14[2];
					
					$vcol15 = explode("<br/>",$row['col15']);
					$totalmr1+=$vcol15[0];
					$totalmr2+=$vcol15[1];
					
					$vcol16 = explode("<br/>",$row['col16']);
					$totalod+=$vcol16[0];
					
					
					$vcol17 = explode("<br/>",$row['col17']);
					$totalgrosp+=$vcol17[0];
					$totalgrosd+=$vcol17[1];
					$totalnetp+=$vcol17[2];
				  
				
				 ?>
		     <td style="text-align:right"><?php echo $row['col1'] ? $row['col1'] : " - ";?></td>
		      <td style="text-align:right"><?php  echo $row['col2'] ? $row['col2'] : " - ";?></td>
		      <td style="text-align:right"><?php  echo $row['col3'] ? $row['col3'] : " - ";?></td>
		      <td style="text-align:right"><?php echo $row['col4'] ? $row['col4'] : " - ";?></td>
		      <td style="text-align:right"><?php  echo $row['col5'] ? $row['col5'] : " - ";?></td>
		      <td style="text-align:right"><?php  echo $row['col6'] ? $row['col6'] : " - ";?></td>
		      <td style="text-align:right"><?php  echo $row['col7'] ? $row['col7'] : " - ";?></td>
		      <td style="text-align:right"><?php echo $row['col8'] ? $row['col8'] : " - ";?></td>
		      <td style="text-align:right"><?php  echo $row['col9'] ? $row['col9'] : " - ";?></td>
		      <td style="text-align:right"><?php  echo $row['col10'] ? $row['col10'] : " - ";?></td>
		      <td style="text-align:right"><?php  echo $row['col11'] ? $row['col11'] : " - ";?></td>
		      <td style="text-align:right"><?php  echo $row['col12'] ? $row['col12'] : " - ";?></td>
		      <td style="text-align:right"><?php echo $row['col13'] ? $row['col13'] : " - ";?></td>
		      <td style="text-align:right"><?php echo $row['col14'] ? $row['col14'] : " - ";?></td>
		      <td style="text-align:right"><?php echo $row['col15'] ? $row['col15'] : " - ";?></td>
		      <td style="text-align:right"><?php  echo $row['col16'] ? $row['col16'] : " - ";?></td>
		      <td style="text-align:right"><?php  echo $row['col17'] ? $row['col17'] : " - ";?></td>
		      <td align="center">&nbsp;</td>
		      <td align="center">&nbsp;</td>
			   <?php } ?>
	      </tr>
		    <tr>
		      <td align="center" style="text-align:center"><?php if($headMonth == 13){$year++; echo $year;}else echo $year;?></td>
		      <td align="center" style="text-align:center"><?php if($headMonth == 13 ) $headMonth = 1;
				 echo $arrmonthname[$headMonth - 1];
				  $headMonth += 1;?></td>
				   <?php 
				  $result=getheaddetail($employee_id,$headMonth,$year);
				  if(dbrows($result)>0)
				  {
				    $row=dbArray($result);
					$vcol1 = explode("<br/>",$row['col1'] );
					$totalbasic+=$vcol1[0];
					$totalda+=$vcol1[1];
					$totaldp+=$vcol1[2];
					
					$vcol2 = explode("<br/>",$row['col2']);
					$totalhra+=$vcol2[0];
					$totalmedi+=$vcol2[1];
					$totalcca+=$vcol2[2];
					
					$vcol3 = explode("<br/>",$row['col3']);
					$totalpta+=$vcol3[0];
					$totalprinall+=$vcol3[1];
					$totalsupall+=$vcol3[2];
					
					$vcol4 = explode("<br/>",$row['col4']);
					$totalhsall+=$vcol4[0];
					$totalwasall+=$vcol4[1];
					$totalcashall+=$vcol4[2];
					
					$vcol5 = explode("<br/>",$row['col5']);
					$totalfall+=$vcol5[0];
					$totalhall+=$vcol5[1];
					$totalta+=$vcol5[2];
					
					$vcol6 = explode("<br/>",$row['col6']);
					$totalle+=$vcol6[0];
					$totalltc+=$vcol6[1];
					$totalspay+=$vcol6[2];
					
					$vcol7 = explode("<br/>",$row['col7']);
					$totalbonus+=$vcol7[0];
					$totalarias+=$vcol7[1];
					$totaladdda+=$vcol7[2];
					
					$vcol8 = explode("<br/>",$row['col8']);
					$totalir+=$vcol8[0];
					$totalotherin+=$vcol8[1];
					
					$vcol9 = explode("<br/>",$row['col9']);
					$totalgpf+=$vcol9[0];
					$totalcpf+=$vcol9[1];
					
					$vcol10 = explode("<br/>",$row['col10']);
					$totalgpfl+=$vcol10[0];
					$totalcpfl+=$vcol10[1];
					$totalhl+=$vcol10[2];
					
					$vcol11 = explode("<br/>",$row['col11']);
					$totalpt+=$vcol11[0];
					$totallic+=$vcol11[1];
					$totalit+=$vcol11[2];
					
					$vcol12 = explode("<br/>",$row['col12']);
					$totalfood+=$vcol12[0];
					$totalfest+=$vcol12[1];
					
					$vcol13 = explode("<br/>",$row['col13']);
					$totals1+=$vcol13[0];
					$totals2+=$vcol13[1];
					
					$vcol14 = explode("<br/>",$row['col14']);
					$totalpli+=$vcol14[0];
					$totalrec+=$vcol14[1];
					$totalgi+=$vcol14[2];
					
					$vcol15 = explode("<br/>",$row['col15']);
					$totalmr1+=$vcol15[0];
					$totalmr2+=$vcol15[1];
					
					$vcol16 = explode("<br/>",$row['col16']);
					$totalod+=$vcol16[0];
					
					
					$vcol17 = explode("<br/>",$row['col17']);
					$totalgrosp+=$vcol17[0];
					$totalgrosd+=$vcol17[1];
					$totalnetp+=$vcol17[2];
				  
				
				 ?>
		    <td style="text-align:right"><?php echo $row['col1'] ? $row['col1'] : " - ";?></td>
		      <td style="text-align:right"><?php  echo $row['col2'] ? $row['col2'] : " - ";?></td>
		      <td style="text-align:right"><?php  echo $row['col3'] ? $row['col3'] : " - ";?></td>
		      <td style="text-align:right"><?php echo $row['col4'] ? $row['col4'] : " - ";?></td>
		      <td style="text-align:right"><?php  echo $row['col5'] ? $row['col5'] : " - ";?></td>
		      <td style="text-align:right"><?php  echo $row['col6'] ? $row['col6'] : " - ";?></td>
		      <td style="text-align:right"><?php  echo $row['col7'] ? $row['col7'] : " - ";?></td>
		      <td style="text-align:right"><?php echo $row['col8'] ? $row['col8'] : " - ";?></td>
		      <td style="text-align:right"><?php  echo $row['col9'] ? $row['col9'] : " - ";?></td>
		      <td style="text-align:right"><?php  echo $row['col10'] ? $row['col10'] : " - ";?></td>
		      <td style="text-align:right"><?php  echo $row['col11'] ? $row['col11'] : " - ";?></td>
		      <td style="text-align:right"><?php  echo $row['col12'] ? $row['col12'] : " - ";?></td>
		      <td style="text-align:right"><?php echo $row['col13'] ? $row['col13'] : " - ";?></td>
		      <td style="text-align:right"><?php echo $row['col14'] ? $row['col14'] : " - ";?></td>
		      <td style="text-align:right"><?php echo $row['col15'] ? $row['col15'] : " - ";?></td>
		      <td style="text-align:right"><?php  echo $row['col16'] ? $row['col16'] : " - ";?></td>
		      <td style="text-align:right"><?php  echo $row['col17'] ? $row['col17'] : " - ";?></td>
		      <td align="center">&nbsp;</td>
		      <td align="center">&nbsp;</td>
			   <?php } ?>
	      </tr>
		    <tr>
		      <td align="center" style="text-align:center"><?php if($headMonth == 13){$year++; echo $year;}else echo $year;?></td>
		      <td align="center" style="text-align:center"><?php if($headMonth == 13 ) $headMonth = 1;
				 echo $arrmonthname[$headMonth - 1];
				  $headMonth += 1;?></td>
				   <?php 
				  $result=getheaddetail($employee_id,$headMonth,$year);
				  if(dbrows($result)>0)
				  {
				    $row=dbArray($result);
					$vcol1 = explode("<br/>",$row['col1'] );
					$totalbasic+=$vcol1[0];
					$totalda+=$vcol1[1];
					$totaldp+=$vcol1[2];
					
					$vcol2 = explode("<br/>",$row['col2']);
					$totalhra+=$vcol2[0];
					$totalmedi+=$vcol2[1];
					$totalcca+=$vcol2[2];
					
					$vcol3 = explode("<br/>",$row['col3']);
					$totalpta+=$vcol3[0];
					$totalprinall+=$vcol3[1];
					$totalsupall+=$vcol3[2];
					
					$vcol4 = explode("<br/>",$row['col4']);
					$totalhsall+=$vcol4[0];
					$totalwasall+=$vcol4[1];
					$totalcashall+=$vcol4[2];
					
					$vcol5 = explode("<br/>",$row['col5']);
					$totalfall+=$vcol5[0];
					$totalhall+=$vcol5[1];
					$totalta+=$vcol5[2];
					
					$vcol6 = explode("<br/>",$row['col6']);
					$totalle+=$vcol6[0];
					$totalltc+=$vcol6[1];
					$totalspay+=$vcol6[2];
					
					$vcol7 = explode("<br/>",$row['col7']);
					$totalbonus+=$vcol7[0];
					$totalarias+=$vcol7[1];
					$totaladdda+=$vcol7[2];
					
					$vcol8 = explode("<br/>",$row['col8']);
					$totalir+=$vcol8[0];
					$totalotherin+=$vcol8[1];
					
					$vcol9 = explode("<br/>",$row['col9']);
					$totalgpf+=$vcol9[0];
					$totalcpf+=$vcol9[1];
					
					$vcol10 = explode("<br/>",$row['col10']);
					$totalgpfl+=$vcol10[0];
					$totalcpfl+=$vcol10[1];
					$totalhl+=$vcol10[2];
					
					$vcol11 = explode("<br/>",$row['col11']);
					$totalpt+=$vcol11[0];
					$totallic+=$vcol11[1];
					$totalit+=$vcol11[2];
					
					$vcol12 = explode("<br/>",$row['col12']);
					$totalfood+=$vcol12[0];
					$totalfest+=$vcol12[1];
					
					$vcol13 = explode("<br/>",$row['col13']);
					$totals1+=$vcol13[0];
					$totals2+=$vcol13[1];
					
					$vcol14 = explode("<br/>",$row['col14']);
					$totalpli+=$vcol14[0];
					$totalrec+=$vcol14[1];
					$totalgi+=$vcol14[2];
					
					$vcol15 = explode("<br/>",$row['col15']);
					$totalmr1+=$vcol15[0];
					$totalmr2+=$vcol15[1];
					
					$vcol16 = explode("<br/>",$row['col16']);
					$totalod+=$vcol16[0];
					
					
					$vcol17 = explode("<br/>",$row['col17']);
					$totalgrosp+=$vcol17[0];
					$totalgrosd+=$vcol17[1];
					$totalnetp+=$vcol17[2];
					
				  
				
				 ?>
		     <td style="text-align:right"><?php echo $row['col1'] ? $row['col1'] : " - ";?></td>
		      <td style="text-align:right"><?php  echo $row['col2'] ? $row['col2'] : " - ";?></td>
		      <td style="text-align:right"><?php  echo $row['col3'] ? $row['col3'] : " - ";?></td>
		      <td style="text-align:right"><?php echo $row['col4'] ? $row['col4'] : " - ";?></td>
		      <td style="text-align:right"><?php  echo $row['col5'] ? $row['col5'] : " - ";?></td>
		      <td style="text-align:right"><?php  echo $row['col6'] ? $row['col6'] : " - ";?></td>
		      <td style="text-align:right"><?php  echo $row['col7'] ? $row['col7'] : " - ";?></td>
		      <td style="text-align:right"><?php echo $row['col8'] ? $row['col8'] : " - ";?></td>
		      <td style="text-align:right"><?php  echo $row['col9'] ? $row['col9'] : " - ";?></td>
		      <td style="text-align:right"><?php  echo $row['col10'] ? $row['col10'] : " - ";?></td>
		      <td style="text-align:right"><?php  echo $row['col11'] ? $row['col11'] : " - ";?></td>
		      <td style="text-align:right"><?php  echo $row['col12'] ? $row['col12'] : " - ";?></td>
		      <td style="text-align:right"><?php echo $row['col13'] ? $row['col13'] : " - ";?></td>
		      <td style="text-align:right"><?php echo $row['col14'] ? $row['col14'] : " - ";?></td>
		      <td style="text-align:right"><?php echo $row['col15'] ? $row['col15'] : " - ";?></td>
		      <td style="text-align:right"><?php  echo $row['col16'] ? $row['col16'] : " - ";?></td>
		      <td style="text-align:right"><?php  echo $row['col17'] ? $row['col17'] : " - ";?></td>
		      <td align="center">&nbsp;</td>
		      <td align="center">&nbsp;</td>
			   <?php } ?>
	      </tr>
		    <tr>
		      <td align="center" style="text-align:center"><?php if($headMonth == 13){$year++; echo $year;}else echo $year;?></td>
		      <td align="center" style="text-align:center"><?php if($headMonth == 13 ) $headMonth = 1;
				 echo $arrmonthname[$headMonth - 1];
				  $headMonth += 1;?></td>
				   <?php 
				  $result=getheaddetail($employee_id,$headMonth,$year);
				  if(dbrows($result)>0)
				  {
				    $row=dbArray($result);
					$vcol1 = explode("<br/>",$row['col1'] );
					$totalbasic+=$vcol1[0];
					$totalda+=$vcol1[1];
					$totaldp+=$vcol1[2];
					
					$vcol2 = explode("<br/>",$row['col2']);
					$totalhra+=$vcol2[0];
					$totalmedi+=$vcol2[1];
					$totalcca+=$vcol2[2];
					
					$vcol3 = explode("<br/>",$row['col3']);
					$totalpta+=$vcol3[0];
					$totalprinall+=$vcol3[1];
					$totalsupall+=$vcol3[2];
					
					$vcol4 = explode("<br/>",$row['col4']);
					$totalhsall+=$vcol4[0];
					$totalwasall+=$vcol4[1];
					$totalcashall+=$vcol4[2];
					
					$vcol5 = explode("<br/>",$row['col5']);
					$totalfall+=$vcol5[0];
					$totalhall+=$vcol5[1];
					$totalta+=$vcol5[2];
					
					$vcol6 = explode("<br/>",$row['col6']);
					$totalle+=$vcol6[0];
					$totalltc+=$vcol6[1];
					$totalspay+=$vcol6[2];
					
					$vcol7 = explode("<br/>",$row['col7']);
					$totalbonus+=$vcol7[0];
					$totalarias+=$vcol7[1];
					$totaladdda+=$vcol7[2];
					
					$vcol8 = explode("<br/>",$row['col8']);
					$totalir+=$vcol8[0];
					$totalotherin+=$vcol8[1];
					
					$vcol9 = explode("<br/>",$row['col9']);
					$totalgpf+=$vcol9[0];
					$totalcpf+=$vcol9[1];
					
					$vcol10 = explode("<br/>",$row['col10']);
					$totalgpfl+=$vcol10[0];
					$totalcpfl+=$vcol10[1];
					$totalhl+=$vcol10[2];
					
					$vcol11 = explode("<br/>",$row['col11']);
					$totalpt+=$vcol11[0];
					$totallic+=$vcol11[1];
					$totalit+=$vcol11[2];
					
					$vcol12 = explode("<br/>",$row['col12']);
					$totalfood+=$vcol12[0];
					$totalfest+=$vcol12[1];
					
					$vcol13 = explode("<br/>",$row['col13']);
					$totals1+=$vcol13[0];
					$totals2+=$vcol13[1];
					
					$vcol14 = explode("<br/>",$row['col14']);
					$totalpli+=$vcol14[0];
					$totalrec+=$vcol14[1];
					$totalgi+=$vcol14[2];
					
					$vcol15 = explode("<br/>",$row['col15']);
					$totalmr1+=$vcol15[0];
					$totalmr2+=$vcol15[1];
					
					$vcol16 = explode("<br/>",$row['col16']);
					$totalod+=$vcol16[0];
					
					
					$vcol17 = explode("<br/>",$row['col17']);
					$totalgrosp+=$vcol17[0];
					$totalgrosd+=$vcol17[1];
					$totalnetp+=$vcol17[2];
				  ?>
				
			<td style="text-align:right"><?php echo $row['col1'] ? $row['col1'] : " - ";?></td>
		      <td style="text-align:right"><?php  echo $row['col2'] ? $row['col2'] : " - ";?></td>
		      <td style="text-align:right"><?php  echo $row['col3'] ? $row['col3'] : " - ";?></td>
		      <td style="text-align:right"><?php echo $row['col4'] ? $row['col4'] : " - ";?></td>
		      <td style="text-align:right"><?php  echo $row['col5'] ? $row['col5'] : " - ";?></td>
		      <td style="text-align:right"><?php  echo $row['col6'] ? $row['col6'] : " - ";?></td>
		      <td style="text-align:right"><?php  echo $row['col7'] ? $row['col7'] : " - ";?></td>
		      <td style="text-align:right"><?php echo $row['col8'] ? $row['col8'] : " - ";?></td>
		      <td style="text-align:right"><?php  echo $row['col9'] ? $row['col9'] : " - ";?></td>
		      <td style="text-align:right"><?php  echo $row['col10'] ? $row['col10'] : " - ";?></td>
		      <td style="text-align:right"><?php  echo $row['col11'] ? $row['col11'] : " - ";?></td>
		      <td style="text-align:right"><?php  echo $row['col12'] ? $row['col12'] : " - ";?></td>
		      <td style="text-align:right"><?php echo $row['col13'] ? $row['col13'] : " - ";?></td>
		      <td style="text-align:right"><?php echo $row['col14'] ? $row['col14'] : " - ";?></td>
		      <td style="text-align:right"><?php echo $row['col15'] ? $row['col15'] : " - ";?></td>
		      <td style="text-align:right"><?php  echo $row['col16'] ? $row['col16'] : " - ";?></td>
		      <td style="text-align:right"><?php  echo $row['col17'] ? $row['col17'] : " - ";?></td>
		      <td align="center">&nbsp;</td>
		      <td align="center">&nbsp;</td>
			   <?php } ?>
	      </tr>
		    <tr>
		      <td align="center" style="text-align:center"><?php if($headMonth == 13){$year++; echo $year;}else echo $year;?></td>
		      <td align="center" style="text-align:center"><?php if($headMonth == 13 ) $headMonth = 1;
				 echo $arrmonthname[$headMonth - 1];
				  $headMonth += 1;?></td>
				   <?php 
				  $result=getheaddetail($employee_id,$headMonth,$year);
				  if(dbrows($result)>0)
				  {
				    $row=dbArray($result);
					$vcol1 = explode("<br/>",$row['col1'] );
					$totalbasic+=$vcol1[0];
					$totalda+=$vcol1[1];
					$totaldp+=$vcol1[2];
					
					$vcol2 = explode("<br/>",$row['col2']);
					$totalhra+=$vcol2[0];
					$totalmedi+=$vcol2[1];
					$totalcca+=$vcol2[2];
					
					$vcol3 = explode("<br/>",$row['col3']);
					$totalpta+=$vcol3[0];
					$totalprinall+=$vcol3[1];
					$totalsupall+=$vcol3[2];
					
					$vcol4 = explode("<br/>",$row['col4']);
					$totalhsall+=$vcol4[0];
					$totalwasall+=$vcol4[1];
					$totalcashall+=$vcol4[2];
					
					$vcol5 = explode("<br/>",$row['col5']);
					$totalfall+=$vcol5[0];
					$totalhall+=$vcol5[1];
					$totalta+=$vcol5[2];
					
					$vcol6 = explode("<br/>",$row['col6']);
					$totalle+=$vcol6[0];
					$totalltc+=$vcol6[1];
					$totalspay+=$vcol6[2];
					
					$vcol7 = explode("<br/>",$row['col7']);
					$totalbonus+=$vcol7[0];
					$totalarias+=$vcol7[1];
					$totaladdda+=$vcol7[2];
					
					$vcol8 = explode("<br/>",$row['col8']);
					$totalir+=$vcol8[0];
					$totalotherin+=$vcol8[1];
					
					$vcol9 = explode("<br/>",$row['col9']);
					$totalgpf+=$vcol9[0];
					$totalcpf+=$vcol9[1];
					
					$vcol10 = explode("<br/>",$row['col10']);
					$totalgpfl+=$vcol10[0];
					$totalcpfl+=$vcol10[1];
					$totalhl+=$vcol10[2];
					
					$vcol11 = explode("<br/>",$row['col11']);
					$totalpt+=$vcol11[0];
					$totallic+=$vcol11[1];
					$totalit+=$vcol11[2];
					
					$vcol12 = explode("<br/>",$row['col12']);
					$totalfood+=$vcol12[0];
					$totalfest+=$vcol12[1];
					
					$vcol13 = explode("<br/>",$row['col13']);
					$totals1+=$vcol13[0];
					$totals2+=$vcol13[1];
					
					$vcol14 = explode("<br/>",$row['col14']);
					$totalpli+=$vcol14[0];
					$totalrec+=$vcol14[1];
					$totalgi+=$vcol14[2];
					
					$vcol15 = explode("<br/>",$row['col15']);
					$totalmr1+=$vcol15[0];
					$totalmr2+=$vcol15[1];
					
					$vcol16 = explode("<br/>",$row['col16']);
					$totalod+=$vcol16[0];
					
					
					$vcol17 = explode("<br/>",$row['col17']);
					$totalgrosp+=$vcol17[0];
					$totalgrosd+=$vcol17[1];
					$totalnetp+=$vcol17[2];
				  
				
				 ?>
		     <td style="text-align:right"><?php echo $row['col1'] ? $row['col1'] : " - ";?></td>
		      <td style="text-align:right"><?php  echo $row['col2'] ? $row['col2'] : " - ";?></td>
		      <td style="text-align:right"><?php  echo $row['col3'] ? $row['col3'] : " - ";?></td>
		      <td style="text-align:right"><?php echo $row['col4'] ? $row['col4'] : " - ";?></td>
		      <td style="text-align:right"><?php  echo $row['col5'] ? $row['col5'] : " - ";?></td>
		      <td style="text-align:right"><?php  echo $row['col6'] ? $row['col6'] : " - ";?></td>
		      <td style="text-align:right"><?php  echo $row['col7'] ? $row['col7'] : " - ";?></td>
		      <td style="text-align:right"><?php echo $row['col8'] ? $row['col8'] : " - ";?></td>
		      <td style="text-align:right"><?php  echo $row['col9'] ? $row['col9'] : " - ";?></td>
		      <td style="text-align:right"><?php  echo $row['col10'] ? $row['col10'] : " - ";?></td>
		      <td style="text-align:right"><?php  echo $row['col11'] ? $row['col11'] : " - ";?></td>
		      <td style="text-align:right"><?php  echo $row['col12'] ? $row['col12'] : " - ";?></td>
		      <td style="text-align:right"><?php echo $row['col13'] ? $row['col13'] : " - ";?></td>
		      <td style="text-align:right"><?php echo $row['col14'] ? $row['col14'] : " - ";?></td>
		      <td style="text-align:right"><?php echo $row['col15'] ? $row['col15'] : " - ";?></td>
		      <td style="text-align:right"><?php  echo $row['col16'] ? $row['col16'] : " - ";?></td>
		      <td style="text-align:right"><?php  echo $row['col17'] ? $row['col17'] : " - ";?></td>
		      <td align="center">&nbsp;</td>
		      <td align="center">&nbsp;</td>
			   <?php } ?>
	      </tr>
		    <tr>
		      <td align="center" style="text-align:center"><?php if($headMonth == 13){$year++; echo $year;}else echo $year;?></td>
		      <td align="center" style="text-align:center"><?php if($headMonth == 13 ) $headMonth = 1;
				 echo $arrmonthname[$headMonth - 1];
				  $headMonth += 1;?></td>
				   <?php 
				  $result=getheaddetail($employee_id,$headMonth,$year);
				  if(dbrows($result)>0)
				  {
				    $row=dbArray($result);
					$vcol1 = explode("<br/>",$row['col1'] );
					$totalbasic+=$vcol1[0];
					$totalda+=$vcol1[1];
					$totaldp+=$vcol1[2];
					
					$vcol2 = explode("<br/>",$row['col2']);
					$totalhra+=$vcol2[0];
					$totalmedi+=$vcol2[1];
					$totalcca+=$vcol2[2];
					
					$vcol3 = explode("<br/>",$row['col3']);
					$totalpta+=$vcol3[0];
					$totalprinall+=$vcol3[1];
					$totalsupall+=$vcol3[2];
					
					$vcol4 = explode("<br/>",$row['col4']);
					$totalhsall+=$vcol4[0];
					$totalwasall+=$vcol4[1];
					$totalcashall+=$vcol4[2];
					
					$vcol5 = explode("<br/>",$row['col5']);
					$totalfall+=$vcol5[0];
					$totalhall+=$vcol5[1];
					$totalta+=$vcol5[2];
					
					$vcol6 = explode("<br/>",$row['col6']);
					$totalle+=$vcol6[0];
					$totalltc+=$vcol6[1];
					$totalspay+=$vcol6[2];
					
					$vcol7 = explode("<br/>",$row['col7']);
					$totalbonus+=$vcol7[0];
					$totalarias+=$vcol7[1];
					$totaladdda+=$vcol7[2];
					
					$vcol8 = explode("<br/>",$row['col8']);
					$totalir+=$vcol8[0];
					$totalotherin+=$vcol8[1];
					
					$vcol9 = explode("<br/>",$row['col9']);
					$totalgpf+=$vcol9[0];
					$totalcpf+=$vcol9[1];
					
					$vcol10 = explode("<br/>",$row['col10']);
					$totalgpfl+=$vcol10[0];
					$totalcpfl+=$vcol10[1];
					$totalhl+=$vcol10[2];
					
					$vcol11 = explode("<br/>",$row['col11']);
					$totalpt+=$vcol11[0];
					$totallic+=$vcol11[1];
					$totalit+=$vcol11[2];
					
					$vcol12 = explode("<br/>",$row['col12']);
					$totalfood+=$vcol12[0];
					$totalfest+=$vcol12[1];
					
					$vcol13 = explode("<br/>",$row['col13']);
					$totals1+=$vcol13[0];
					$totals2+=$vcol13[1];
					
					$vcol14 = explode("<br/>",$row['col14']);
					$totalpli+=$vcol14[0];
					$totalrec+=$vcol14[1];
					$totalgi+=$vcol14[2];
					
					$vcol15 = explode("<br/>",$row['col15']);
					$totalmr1+=$vcol15[0];
					$totalmr2+=$vcol15[1];
					
					$vcol16 = explode("<br/>",$row['col16']);
					$totalod+=$vcol16[0];
					
					
					$vcol17 = explode("<br/>",$row['col17']);
					$totalgrosp+=$vcol17[0];
					$totalgrosd+=$vcol17[1];
					$totalnetp+=$vcol17[2];
				  
				
				 ?>
		     <td style="text-align:right"><?php echo $row['col1'] ? $row['col1'] : " - ";?></td>
		      <td style="text-align:right"><?php  echo $row['col2'] ? $row['col2'] : " - ";?></td>
		      <td style="text-align:right"><?php  echo $row['col3'] ? $row['col3'] : " - ";?></td>
		      <td style="text-align:right"><?php echo $row['col4'] ? $row['col4'] : " - ";?></td>
		      <td style="text-align:right"><?php  echo $row['col5'] ? $row['col5'] : " - ";?></td>
		      <td style="text-align:right"><?php  echo $row['col6'] ? $row['col6'] : " - ";?></td>
		      <td style="text-align:right"><?php  echo $row['col7'] ? $row['col7'] : " - ";?></td>
		      <td style="text-align:right"><?php echo $row['col8'] ? $row['col8'] : " - ";?></td>
		      <td style="text-align:right"><?php  echo $row['col9'] ? $row['col9'] : " - ";?></td>
		      <td style="text-align:right"><?php  echo $row['col10'] ? $row['col10'] : " - ";?></td>
		      <td style="text-align:right"><?php  echo $row['col11'] ? $row['col11'] : " - ";?></td>
		      <td style="text-align:right"><?php  echo $row['col12'] ? $row['col12'] : " - ";?></td>
		      <td style="text-align:right"><?php echo $row['col13'] ? $row['col13'] : " - ";?></td>
		      <td style="text-align:right"><?php echo $row['col14'] ? $row['col14'] : " - ";?></td>
		      <td style="text-align:right"><?php echo $row['col15'] ? $row['col15'] : " - ";?></td>
		      <td style="text-align:right"><?php  echo $row['col16'] ? $row['col16'] : " - ";?></td>
		      <td style="text-align:right"><?php  echo $row['col17'] ? $row['col17'] : " - ";?></td>
		      <td align="center">&nbsp;</td>
		      <td align="center">&nbsp;</td>
			   <?php } ?>
	      </tr>
		    <tr>
			
		 <td colspan="2"  style="text-align:center"><b>Total</b></td>
		  <td align="right" style="text-align:right" width="5%"><?php  echo $totalbasic."<br/>";echo $totalda."<br/>";echo $totaldp."<br/>";?></td>
		  <td align="right" style="text-align:right" width="5%"><?php  echo $totalhra."<br/>";  echo $totalmedi."<br/>";echo $totalcca."<br/>";?></td>
		 <td align="right" style="text-align:right" width="5%"><?php  echo $totalpta."<br/>"; echo $totalprinall."<br/>";echo $totalsupall."<br/>";?></td>
	  <td align="right" style="text-align:right" width="5%"><?php  echo $totalhsall."<br/>";  echo $totalwasall."<br/>";echo $totalcashall."<br/>";?></td>
		 <td align="right" style="text-align:right" width="5%"><?php  echo $totalfall."<br/>"; echo $totalhall."<br/>";echo $totalta."<br/>";?></td>
		  <td align="right" style="text-align:right" width="5%"><?php  echo $totalle."<br/>"; echo $totalltc."<br/>";echo $totalspay."<br/>";?></td>
		  <td align="right" style="text-align:right" width="5%"><?php  echo $totalbonus."<br/>"; echo $totalarias."<br/>";echo $totaladdda."<br/>";?></td>
		 <td align="right" style="text-align:right" width="5%"><?php  echo $totalir."<br/>";  echo $totalotherin."<br/>";?></td>
		  <td align="right" style="text-align:right" width="5%"><?php  echo $totalgpf."<br/>";  echo $totalcpf."<br/>";?></td>
		 <td align="right" style="text-align:right" width="5%"><?php  echo $totalgpfl."<br/>";  echo $totalcpfl."<br/>";echo $totalhl."<br/>";?></td>
		  <td align="right" style="text-align:right" width="5%"><?php  echo $totalpt."<br/>"; echo $totallic."<br/>";echo $totalit."<br/>";?></td>
		  <td align="right" style="text-align:right" width="5%"><?php  echo $totalfood."<br/>"; echo $totalfest."<br/>";?></td>
		  <td align="right" style="text-align:right" width="5%"><?php  echo $totals1."<br/>";  echo $totals2."<br/>";?></td>
		  <td align="right" style="text-align:right" width="5%"><?php  echo $totalpli."<br/>"; echo $totalrec."<br/>";echo $totalgi."<br/>";?></td>
		  <td align="right" style="text-align:right" width="5%"><?php  echo $totalmr1."<br/>"; echo $totalmr2."<br/>";?></td>
		 <td align="right" style="text-align:right" width="5%"><?php  echo $totalod."<br/>";?></td>
		 <td align="right" style="text-align:right" width="5%"><?php  echo $totalgrosp."<br/>"; echo $totalgrosd."<br/>";echo $totalnetp."<br/>";?></td>
			  <td align="right" width="2%"></td>
			  <td align="right" width="8%"></td>
			</tr>
		</thead>
  </table>
<?php }

 			$HtmlCode= ob_get_contents();
			ob_end_flush();
			$HtmlUrl 	=	"employee-salary-slip-yearwise-report-". $_SESSION["VedantnrUserId"].".html";
			$HtmlPath 	=	"report/".$HtmlUrl;		
			createHTMLReportPage($header_row_string,$HtmlUrl,$HtmlPath,$HtmlCode);			
?>
<br/>
		<form name="frm" id="frm" action="" method="post">		
			<input type="hidden" name="txtFile" id="txtFile" value="<?php echo $HtmlUrl ;?>" />
			<input type="hidden" name="txtOrientation" id="txtOrientation" value="L" />	
            				<input type="button" name="btnPrint" id="btnPrint" value="Print" onClick="SetPageAction('PRINT');"/>	
			<input type="button" name="btnPdf" id="btnPdf" value="Create PDF" onclick="SetPageAction('PDF');"/>
			<input type="button" name="btnHtml" id="btnHtml" value="Create HTML" onclick="SetPageAction('HTML');"/>
			<input type="button" name="btnWord" id="btnWord" value="Create WORD" onclick="SetPageAction('WORD');"/>
			<input type="button" name="btnExcel" id="btnExcel" value="Create EXCEL" onclick="SetPageAction('Excel');"/>
		</form>
		<script language="javascript" type="text/javascript">
			function SetPageAction(varAction) {
				if(varAction=="PRINT"){			
                        document.frm.action="print/create-print.php";
                        document.frm.submit();
                    }
				if(varAction=="PDF"){			
					document.frm.action="convertpdf/create-pdf.php";
					document.frm.target = "_blank";
					document.frm.submit();
				}
				else if(varAction=="HTML"){
					document.frm.action="<?php echo $HtmlPath ;?>";
					document.frm.target = "_blank";
					document.frm.submit();
				}
				else if(varAction=="WORD"){
					document.frm.action="convertword/create-word.php";
					document.frm.target="_blank";
					document.frm.submit();
				}
				else if(varAction=="Excel"){
					document.frm.action="convertword/create-excel.php";
					document.frm.target="_blank";
					document.frm.submit();
				}
			}
		</script>		
<?php						
		}
		else
			{
				echo "<b>No Data Found</b>";
			}
		}else {
		       echo "Session Expired"; 
     }
?>
</div>
<?php require "./_footer.php";?>
<?php
function getheaddetail($employeeid,$month,$year)
{
 	$month-=1;

 	$query = "SELECT  Concat(es.basic,'<br/>',es.da,'<br/>',es.dpay)as col1,
					  Concat(es.hra,'<br/>',es.medical_all,'<br/>',es.cla)as col2,
					  Concat(es.pta,'<br/>',es.princi_all,'<br/>',es.sup_all)as col3,
					  Concat(es.hs_all,'<br/>',es.wash_all,'<br/>',es.cash_all)as col4,
					  Concat(es.family_all,'<br/>',es.handicap_all,'<br/>',es.ta)as col5,
					  Concat(es.leaveencash,'<br/>',es.ltc,'<br/>',es.sp_pay)as col6,
					  Concat(es.bonus,'<br/>',es.arias_all,'<br/>',es.add_da)as col7,
					  Concat(es.ir1,'<br/>',es.oincome1)as col8,
					  Concat(es.gpf,'<br/>',es.cpf)as col9,
					  Concat(es.gpfloan,'<br/>',es.cpfloan,'<br/>',es.houseloan)as col10,
					  Concat(es.pftax,'<br/>',es.lic,'<br/>',es.incometax)as col11,
					  Concat(es.foodadv,'<br/>',es.festadv)as col12,
					  Concat(es.society,'<br/>',es.society_2)as col13,
					
					  Concat(es.pli,'<br/>',es.recadj,'<br/>',es.groupins)as col14,
					  Concat(es.misec1,'<br/>',es.misrec2)as col15,
					  es.odeduct1 as col16,
					  Concat(es.grosspay,'<br/>',es.grossdeduction,'<br/>',es.netpay)as col17					 
				  FROM cms_employeesalary es, 
					   cms_employeemaster em 
				  WHERE es.college_id='1' and 					
						em.college_id= '1' and					
						es.employee_id = em.employee_id "; 
	$condition = "";
	
	if($employeeid != ""){
		$condition .= " and es.employee_id = $employeeid";
	}
	
	if($year != ""){
		$condition .= " and es.year_id = $year";
	}
	if($month != ""){
		$condition .= " and es.month =$month";
	}	
	$condition.=" ORDER BY es.employee_id ASC";
 	$query.=$condition;
	$out = dbQuery($query);
	return $out;
}		
?>