session_start(); include("../conn.php"); function findrank($present_rank){ if($present_rank==null) return '---'; $results=mysql_query("SELECT rank_eng FROM rank_master WHERE rank_id=$present_rank") or die(mysql_error()); if(mysql_num_rows($results)>0){ $x = mysql_fetch_array($results); return $x['rank_eng']; }return '---'; } $cd=(isset($_REQUEST['cd'])?htmlspecialchars($_REQUEST['cd']):0); if($_REQUEST['id']!='0'){ /*if($_SESSION['defType']=="2"){ $checkrs=mysql_query("select b.* from (SELECT concat_ws(first_name_of_employee_english,middle_name_of_employee_english, last_name_of_employee_english)as name FROM new_posting_detail WHERE new_posting_detail.personal_number='".$_REQUEST['id']."' and joining_unit = (SELECT distinct hqrs_code from nondef where (hqrs_code ='".$_SESSION['Unit']."' OR main_unit_code1 = '".$_SESSION['Unit']."' OR unit_code= '".$_SESSION['Unit']."' OR subunit_code = '".$_SESSION['Unit']."')))b UNION ALL SELECT concat_ws(first_name_of_employee_english,middle_name_of_employee_english, last_name_of_employee_english) as name FROM new_posting_detail INNER JOIN (SELECT distinct subunit_code from nondef where (hqrs_code ='".$_SESSION['Unit']."' OR main_unit_code1 = '".$_SESSION['Unit']."' OR unit_code= '".$_SESSION['Unit']."' OR subunit_code = '".$_SESSION['Unit']."')) a ON new_posting_detail.joining_sub_unit =a.subunit_code and new_posting_detail.personal_number='".$_REQUEST['id']."'"); } else {*/ $checkrs=mysql_query("select employee_master.first_name_of_employee_english, employee_master.middle_name_of_employee_english, employee_master.last_name_of_employee_english,employee_master.rank FROM new_posting_detail Inner JOin employee_master On new_posting_detail.personal_number=employee_master.personal_number where (joining_unit = '".$_SESSION['Unit']."' or joining_sub_unit='".$_SESSION['Unit']."') and new_posting_detail.personal_number='".$_REQUEST['id']."'") or die(mysql_error()); /*}*/ if(mysql_num_rows($checkrs)) { $res=mysql_fetch_assoc($checkrs); echo '
| Employee Name : | '.$res['first_name_of_employee_english'].' '.$res['middle_name_of_employee_english'].' '.$res['last_name_of_employee_english'].' |
| Rank : | '.findrank($res['rank']).' |