$i=1;
/* while($pnoArr=mysql_fetch_array($pnoquery)){
$salaryDetail=mysql_query("select * from salary_detail where personal_number='".$pnoArr['personal_number']."' and for_month=".$month." and for_year=".$year." and gpf_shedule_code=".$gpf_code." and gpf_subs!=0 ORDER by date") or die(mysql_error());*/
$cader=$_POST['cadre'];
$section=$_POST['section'];
if($cader==''){
$cadcond=" and a.bill_category is null";
}else{
$cadcond=" and a.bill_category='".$cader."'";
}
if(trim($section)!=""){
$sectionCondition=" and record_number like '".$section."'";
}else{
$sectionCondition="";
}
if($month==gmdate("m",time()+19800)){
$dc=" and (b.joining_unit='".$_SESSION['Unit']."' OR b.joining_sub_unit='".$_SESSION['Unit']."' or b.archive_date='".$_SESSION['Unit']."')";
}else{
$dc=" and (a.posting_unit='".$_SESSION['Unit']."')";
}
$rptCond="";
if($rptType=="0"){
$rptCond="";
}else if($rptType=="OLD"){
$rptCond=" and a.gpf_no not like 'NEU%'";
}else if($rptType=="NEW"){
$rptCond=" and a.gpf_no like 'NEU%'";
}
$qry="select a.gpf_no,a.employee_name,a.basic_pay,a.gpf_subs,a.gpf_recv,a.no_of_installment1,a.total_installment1 from salary_detail a, new_posting_detail b where a.personal_number=b.personal_number ".$dc." and a.for_month=".$month." and a.for_year=".$year." and a.gpf_shedule_code=".$gpf_code." and gpf_subs!=0 and a.sus_status!=4 ".$cadcond.$sectionCondition.$rptCond." order by a.gpf_no,a.employee_name";
$salaryDetail=mysql_query($qry) or die(mysql_error());
if(mysql_num_rows($salaryDetail)!=0){
while($row=mysql_fetch_array($salaryDetail)){
if($i%50==0 && $i!=0){
echo '