$_SESSION['totaljoin']=0;
$_SESSION['totalreliev']=0;
$_SESSION['totaltrans']=0;
$query ="SELECT distinct sub_unit_code pno_unit_code,sub_unit_hindi unit_hindi,def_type FROM `sub_unitmaster` WHERE def_type=2 order by sub_unit" ;
$empquery=mysql_query($query) or die("Error in query = ".mysql_error());
$i=1;
while($row=mysql_fetch_array($empquery)){
$joinrs=mysql_query("SELECT count(*) as joinings from new_posting_detail where joining_sub_unit=".$row['pno_unit_code']." and transfer_posting_flag='TP'") or die(mysql_error());
$relivingrs=mysql_query("SELECT count(*) as reliving from new_posting_detail where joining_sub_unit=".$row['pno_unit_code']." and transfer_posting_flag='T'");
$transfers=mysql_query("SELECT count(*) as transfer from new_posting_detail where joining_sub_unit=".$row['pno_unit_code']." and transfer_posting_flag='A'");
// }
// $transfercnt=mysql_fetch_assoc($transrs);
$joiningcnt=mysql_fetch_assoc($joinrs);
$relivingcnt=mysql_fetch_assoc($relivingrs);
$transfercnt=mysql_fetch_assoc($transfers);
?>