">ข้อมูล ">
= $search_poem_no_min)"; } // end if if(trim($search_poem_no_max)){ $arr_search_condition[] = "(".$POEMS_NO_NUM." <= $search_poem_no_max)"; } // end if if(trim($search_level_no)) $arr_search_condition[] = "(trim(b.LEVEL_NO) = '". trim($search_level_no) ."')"; if(trim($search_ep_code)) $arr_search_condition[] = "(trim(a.EP_CODE) = '". trim($search_ep_code) ."')"; if(trim($search_org_id)){ if($SESS_ORG_STRUCTURE==1){ $arr_search_condition[] = "(c.ORG_ID = $search_org_id)"; }else{ $arr_search_condition[] = "(a.ORG_ID = $search_org_id)"; } }elseif(trim($search_department_id)){ $arr_search_condition[] = "(a.DEPARTMENT_ID = $search_department_id)"; }elseif(trim($search_ministry_id)){ $cmd = " select ORG_ID from PER_ORG where ORG_ID_REF=$search_ministry_id "; $db_dpis->send_cmd($cmd); unset($arr_org); while($data = $db_dpis->get_array()) $arr_org[] = $data[ORG_ID]; $arr_search_condition[] = "(a.DEPARTMENT_ID in (". implode(",", $arr_org) ."))"; }elseif($PV_CODE){ $cmd = " select a.ORG_ID as MINISTRY_ID, b.ORG_ID as DEPARTMENT_ID, c.ORG_ID from PER_ORG a, PER_ORG b, PER_ORG c where a.OL_CODE='01' and b.OL_CODE='02' and c.OL_CODE='03' and c.PV_CODE='$PV_CODE' and a.ORG_ID=b.ORG_ID_REF and b.ORG_ID=c.ORG_ID_REF order by a.DEPARTMENT_ID, a.ORG_ID, b.ORG_ID, c.ORG_ID "; $db_dpis->send_cmd($cmd); // $db_dpis->show_error(); unset($arr_org); while($data = $db_dpis->get_array()) $arr_org[] = $data[ORG_ID]; $arr_search_condition[] = "(ORG_ID in (". implode(",", $arr_org) ."))"; } if(trim($search_org_id_1)){ if($SESS_ORG_STRUCTURE==1){ $arr_search_condition[] = "(c.ORG_ID_1 = $search_org_id_1)"; }else{ $arr_search_condition[] = "(a.ORG_ID_1 = $search_org_id_1)"; } } if(trim($search_org_id_2)){ if($SESS_ORG_STRUCTURE==1){ $arr_search_condition[] = "(c.ORG_ID_2 = $search_org_id_2)"; }else{ $arr_search_condition[] = "(a.ORG_ID_2 = $search_org_id_2)"; } } if(trim($search_org_id_3)){ /*Release 5.1.0.4 */ if($SESS_ORG_STRUCTURE==1){ $arr_search_condition[] = "(c.ORG_ID_3 = $search_org_id_3)"; }else{ $arr_search_condition[] = "(a.ORG_ID_3 = $search_org_id_3)"; } } if(trim($search_org_id_4)){ /*Release 5.1.0.4 */ if($SESS_ORG_STRUCTURE==1){ $arr_search_condition[] = "(c.ORG_ID_4 = $search_org_id_4)"; }else{ $arr_search_condition[] = "(a.ORG_ID_4 = $search_org_id_4)"; } } if(trim($search_org_id_5)){ /*Release 5.1.0.4 */ if($SESS_ORG_STRUCTURE==1){ $arr_search_condition[] = "(c.ORG_ID_5 = $search_org_id_5)"; }else{ $arr_search_condition[] = "(a.ORG_ID_5 = $search_org_id_5)"; } } if(!$sort_by) $sort_by=1; $sort_type = (isset($sort_type))? $sort_type : "1:asc"; $arrSort=explode(":",$sort_type); $SortType[$arrSort[0]] =$arrSort[1]; if(!$order_by) $order_by=1; if(trim($search_poem_salary_min)) $arr_search_condition[] = "(POEM_MIN_SALARY >= $search_poem_salary_min)"; if(trim($search_poem_salary_max)) $arr_search_condition[] = "(POEM_MAX_SALARY <= $search_poem_salary_max)"; if(trim($search_pos_situation) == 1) $arr_search_condition[] = "(c.PER_STATUS IS NULL)"; if(trim($search_pos_situation) == 2) $arr_search_condition[] = "(c.PER_STATUS=1)"; if(!isset($search_pos_status)) $search_pos_status = 1; if(trim($search_pos_status) == 1) $arr_search_condition[] = "(a.POEM_STATUS = 1)"; if(trim($search_pos_status) == 2) $arr_search_condition[] = "(a.POEM_STATUS = 2)"; $search_pps = implode(",", $search_pps_code); if($search_pps){$arr_search_condition[] = "(a.PPS_CODE in($search_pps))";} //else{$arr_search_condition[] = "(a.PPS_CODE in(1,2,3,4))";} $search_condition = ""; if(count($arr_search_condition)) $search_condition = " and " . implode(" and ", $arr_search_condition); $check_condition = ""; if ($search_data==1) $check_condition = " and a.PPS_CODE is null "; if($DPISDB=="odbc") $POEMS_NO_NUM = "CLng(a.POEMS_NO)"; elseif($DPISDB=="oci8") $POEMS_NO_NUM = "to_number(replace(a.POEMS_NO,'-',''))"; elseif($DPISDB=="mysql") $POEMS_NO_NUM = "a.POEMS_NO+0"; if($order_by==1){ //(ค่าเริ่มต้น) เลขที่ตำแหน่ง if($DPISDB=="odbc") $order_str = "POEMS_NO_NAME, iif(isnull(POEMS_NO),0,$POEMS_NO_NUM)"; if($DPISDB=="oci8") $order_str = "POEMS_NO_NAME, $POEMS_NO_NUM"; if($DPISDB=="mysql") $order_str = "POEMS_NO_NAME, $POEMS_NO_NUM+0"; }elseif($order_by==2) { //กลุ่มงาน $order_str = "b.LEVEL_NO "; } elseif($order_by==3) { //ชื่อตำแหน่ง $order_str = "b.EP_NAME "; } elseif($order_by==4) { $order_str = "a.ORG_ID "; }elseif($order_by==5) { $order_str = "ORG_ID_1 "; } if(trim($order_str)){ $order_str.=" ".$SortType[$order_by]; } if($command=="SEARCH"||$command=="SEARCHALL"){ //$cmd =" select count(a.POEMS_ID) as count_data from PER_POS_EMPSER a, PER_EMPSER_POS_NAME b where a.EP_CODE=b.EP_CODE $search_condition ";/*เดิม*/ $cmd="SELECT count(*) as count_data FROM( select a.DEPARTMENT_ID, a.POEMS_ID, POEMS_NO, a.EP_CODE, b.EP_NAME, b.LEVEL_NO, POEM_MIN_SALARY, POEM_MAX_SALARY, a.ORG_ID, a.ORG_ID_1, a.ORG_ID_2, POEM_STATUS, POEMS_NO_NAME from PER_POS_EMPSER a, PER_EMPSER_POS_NAME b, (select POEMS_ID, PER_ID, PER_NAME, PER_STATUS from PER_PERSONAL where PER_TYPE=3 and PER_STATUS=1) c, (select POEMS_ID, PER_ID, PER_NAME, PER_STATUS from PER_PERSONAL where PER_TYPE=3 and PER_STATUS=0 or PER_STATUS=2) d where a.EP_CODE=b.EP_CODE and a.POEMS_ID=c.POEMS_ID(+) and a.POEMS_ID=d.POEMS_ID(+) $search_condition $check_condition group by a.DEPARTMENT_ID, a.POEMS_ID, POEMS_NO, a.EP_CODE, b.EP_NAME, b.LEVEL_NO, POEM_MIN_SALARY, POEM_MAX_SALARY, a.ORG_ID, a.ORG_ID_1, a.ORG_ID_2, POEM_STATUS, POEMS_NO_NAME )"; $db_dpis->send_cmd($cmd); // $db_dpis->show_error(); $data = $db_dpis->get_array(); $data = array_change_key_case($data, CASE_LOWER); $count_data = $data[count_data]; // echo "$count_data"; } ?>
;">
 :    -    :   
กลุ่มงาน :   :   
ชื่อตำแหน่ง :     :   
อัตราค่าจ้าง :    -    :   
 :     :   
 :     :   
 :  "ว่าง",2=>"มีคนครอง",0=>"ทั้งหมด"); ?> สถานะ : 
สถานะของตำแหน่ง :  "ตำแหน่งที่มีคนครอง", 2=>"ตำแหน่งว่างที่มีงบประมาณในการจ้างแล้ว", 3=>"ตำแหน่งว่างที่ไม่มีงบประมาณในการจ้าง", 4=>"ตำแหน่งที่มีลูกจ้างประจำครองอยู่");?>   
ตรวจสอบข้อมูล : 
 
;">
*  :  > > กลุ่มงาน : 
* ชื่อตำแหน่ง :    * ประเภทภารกิจ : 
* ประเภทกรอบอัตรากำลัง :  * สถานะของตำแหน่ง : 
อัตราค่าจ้างขั้นต่ำ :  อัตราค่าจ้างขั้นสูง : 
*  :    *  :   
*  :     :   
 :     :   
 :     :   
 :  ทักษะประสบการณ์ :  send_cmd($cmd_chk); $dataCHK = $db_dpis->get_array(); //$dataCHK[CHAR_LENGTH] = 2000; if($dataCHK[CHAR_LENGTH]=='2000'){ $maxlength = 2000; ?>
(กรอกได้ไม่เกิน 2000 ตัวอักษร)
 :  >ใช้งาน    >ยกเลิก * อัตรากำลังจังหวัดชายแดนภาคใต้ :  >ใช่    >ไม่ใช่
 :   : 
<?=$CLEAR_TITLE?> 
1 && $DPISDB=="odbc"){ $cmd = " select top $start_record a.POEMS_ID from PER_POS_EMPSER a, PER_EMPSER_POS_NAME b where a.EP_CODE=b.EP_CODE $search_condition order by a.DEPARTMENT_ID, iif(isnull(POEMS_NO),0,$POEMS_NO_NUM) "; $db_dpis->send_cmd($cmd); //$db_dpis->show_error(); while($data = $db_dpis->get_array()) $arr_exclude[] = $data[POEMS_ID]; $limit_data = " and a.POEMS_ID not in (". implode(", ", $arr_exclude) .")"; } // end if if($DPISDB=="odbc"){ $cmd = " select a.DEPARTMENT_ID, a.POEMS_ID, POEMS_NO, a.EP_CODE, b.EP_NAME, b.LEVEL_NO, POEM_MIN_SALARY, POEM_MAX_SALARY, a.ORG_ID, a.ORG_ID_1, a.ORG_ID_2, POEM_STATUS, POEMS_NO_NAME from ( ( PER_POS_EMPSER a inner join PER_EMPSER_POS_NAME b on (a.EP_CODE=b.EP_CODE) ) left join PER_PERSONAL c on (a.POEMS_ID=c.POEMS_ID and c.PER_TYPE=3 and c.PER_STATUS=1) ) left join PER_PERSONAL d on (a.POEMS_ID=d.POEMS_ID and d.PER_TYPE=3 and (d.PER_STATUS=0 or d.PER_STATUS=2)) where a.EP_CODE=b.EP_CODE $search_condition $limit_data group by a.DEPARTMENT_ID, a.POEMS_ID, POEMS_NO, a.EP_CODE, b.EP_NAME, b.LEVEL_NO, POEM_MIN_SALARY, POEM_MAX_SALARY, a.ORG_ID, a.ORG_ID_1, a.ORG_ID_2, POEM_STATUS, POEMS_NO_NAME order by a.DEPARTMENT_ID, $order_str "; }elseif($DPISDB=="oci8"){ $min_rownum = (($current_page - 1) * $data_per_page) + 1; $max_rownum = $current_page * $data_per_page; $cmd = " select temp2.* from ( select rownum as rnum, temp1.* from ( select a.DEPARTMENT_ID, a.POEMS_ID, POEMS_NO, a.EP_CODE, b.EP_NAME, b.LEVEL_NO, POEM_MIN_SALARY, POEM_MAX_SALARY, a.ORG_ID, a.ORG_ID_1, a.ORG_ID_2, POEM_STATUS, POEMS_NO_NAME from PER_POS_EMPSER a, PER_EMPSER_POS_NAME b, (select POEMS_ID, PER_ID, PER_NAME, PER_STATUS from PER_PERSONAL where PER_TYPE=3 and PER_STATUS=1) c, (select POEMS_ID, PER_ID, PER_NAME, PER_STATUS from PER_PERSONAL where PER_TYPE=3 and PER_STATUS=0 or PER_STATUS=2) d where a.EP_CODE=b.EP_CODE and a.POEMS_ID=c.POEMS_ID(+) and a.POEMS_ID=d.POEMS_ID(+) $search_condition $check_condition $limit_data group by a.DEPARTMENT_ID, a.POEMS_ID, POEMS_NO, a.EP_CODE, b.EP_NAME, b.LEVEL_NO, POEM_MIN_SALARY, POEM_MAX_SALARY, a.ORG_ID, a.ORG_ID_1, a.ORG_ID_2, POEM_STATUS, POEMS_NO_NAME order by a.DEPARTMENT_ID, $order_str ) temp1 where rownum <= $max_rownum ) temp2 where rnum between $min_rownum and $max_rownum "; }elseif($DPISDB=="mysql"){ $limit_data = " limit " . (($current_page - 1) * $data_per_page) . ", " . $data_per_page; $cmd = " select a.DEPARTMENT_ID, a.POEMS_ID, POEMS_NO, a.EP_CODE, b.EP_NAME, b.LEVEL_NO, POEM_MIN_SALARY, POEM_MAX_SALARY, a.ORG_ID, ORG_ID_1, ORG_ID_2, POEM_STATUS from ( ( PER_POS_EMPSER a inner join PER_EMPSER_POS_NAME b on (a.EP_CODE=b.EP_CODE) ) left join PER_PERSONAL c on (a.POEMS_ID=c.POEMS_ID and c.PER_TYPE=3 and c.PER_STATUS=1) ) left join PER_PERSONAL d on (a.POEMS_ID=d.POEMS_ID and d.PER_TYPE=3 and (d.PER_STATUS=0 or d.PER_STATUS=2)) where a.EP_CODE=b.EP_CODE $search_condition group by a.DEPARTMENT_ID, a.POEMS_ID, POEMS_NO, a.EP_CODE, b.EP_NAME, b.LEVEL_NO, POEM_MIN_SALARY, POEM_MAX_SALARY, a.ORG_ID, ORG_ID_1, ORG_ID_2, POEM_STATUS order by a.DEPARTMENT_ID, $order_str $limit_data "; } // end if $count_page_data = $db_dpis->send_cmd($cmd); // echo '
'.$cmd;
	//$db_dpis->show_error();
	if ($count_page_data && ($command=="SEARCH"||$command=="SEARCHALL")) {
		$current_list = "";
		$data_count = 0;
?>
  get_array()) {
		$data_count++;
		if($data_count > $data_per_page) break;

		$temp_POEMS_ID = trim($data[POEMS_ID]);
		$current_list .= ((trim($current_list))?", ":"") . $temp_POEMS_ID;
		//$POEMS_NO = trim($data[POEMS_NO]);
		$POEMS_NO = trim($data[POEMS_NO_NAME]).trim($data[POEMS_NO]);
		$EP_CODE = trim($data[EP_CODE]);
		$EP_NAME = trim($data[EP_NAME]);
		$LEVEL_NO = trim($data[LEVEL_NO]);
		$POEM_MIN_SALARY = trim($data[POEM_MIN_SALARY]);
		$POEM_MAX_SALARY = trim($data[POEM_MAX_SALARY]);
		$POEM_SALARY = number_format($POEM_MIN_SALARY) . (trim($POEM_MAX_SALARY)?(" - ".number_format($POEM_MAX_SALARY)):"");
		$ORG_ID = trim($data[ORG_ID]);
		$ORG_ID_1 = trim($data[ORG_ID_1]);
		$ORG_ID_2 = trim($data[ORG_ID_2]);
		$POEM_STATUS = trim($data[POEM_STATUS]);

		$cmd = " select LEVEL_NAME from PER_LEVEL where trim(LEVEL_NO)='".$LEVEL_NO."' ";
		$db_dpis2->send_cmd($cmd);
		$data_dpis2 = $db_dpis2->get_array();
		$LEVEL_NAME = $data_dpis2[LEVEL_NAME];

		$cmd = " select ORG_NAME, ORG_ID_REF from PER_ORG where ORG_ID=$ORG_ID ";
		if($SESS_ORG_STRUCTURE==1){	$cmd = str_replace("PER_ORG","PER_ORG_ASS",$cmd); 	}
		$db_dpis2->send_cmd($cmd);
		$data_dpis2 = $db_dpis2->get_array();
		$ORG_NAME = $data_dpis2[ORG_NAME];
		$ORG_ID_REF = $data_dpis2[ORG_ID_REF];

		$cmd = " select ORG_NAME from PER_ORG where ORG_ID=$ORG_ID_REF ";
		if($SESS_ORG_STRUCTURE==1){	$cmd = str_replace("PER_ORG","PER_ORG_ASS",$cmd); 	}
		$db_dpis2->send_cmd($cmd);
		$data_dpis2 = $db_dpis2->get_array();
		$ORG_REF_NAME = $data_dpis2[ORG_NAME];

		$ORG_NAME_1 = "";
		if ($ORG_ID_1) {
			$cmd = " select ORG_NAME from PER_ORG where ORG_ID=$ORG_ID_1 ";
			if($SESS_ORG_STRUCTURE==1){	$cmd = str_replace("PER_ORG","PER_ORG_ASS",$cmd); 	}
			$db_dpis2->send_cmd($cmd);
			$data_dpis2 = $db_dpis2->get_array();
			$ORG_NAME_1 = $data_dpis2[ORG_NAME];
			if ($ORG_NAME_1=="-") $ORG_NAME_1 = "";
		}

		$ORG_NAME_2 = "";
		if ($ORG_ID_2) {
			$cmd = " select ORG_NAME from PER_ORG where ORG_ID=$ORG_ID_2 ";
			if($SESS_ORG_STRUCTURE==1){	$cmd = str_replace("PER_ORG","PER_ORG_ASS",$cmd); 	}
			$db_dpis2->send_cmd($cmd);
			$data_dpis2 = $db_dpis2->get_array();
			$ORG_NAME_2 = $data_dpis2[ORG_NAME];
			if ($ORG_NAME_2=="-") $ORG_NAME_2 = "";
			if (!$ORG_NAME_1) { 
				$ORG_NAME_1 = $ORG_NAME_2; 
				$ORG_NAME_2 = ""; 
			}
		}

		if($DPISDB=="odbc"){
			$cmd = " select 	a.PER_ID, b.PN_NAME, a.PER_NAME, a.PER_SURNAME, a.PER_STATUS 
							 from 		PER_PERSONAL a
							 				left join PER_PRENAME b on (a.PN_CODE=b.PN_CODE)
							 where	a.POEMS_ID=$temp_POEMS_ID and (a.PER_STATUS=1 or a.PER_STATUS=0) and a.PER_TYPE=3 ";
		}elseif($DPISDB=="oci8"){
			$cmd = " select 	a.PER_ID, b.PN_NAME, a.PER_NAME, a.PER_SURNAME, a.PER_STATUS 
							 from 		PER_PERSONAL a, PER_PRENAME b
							 where	a.PN_CODE=b.PN_CODE(+) and a.POEMS_ID=$temp_POEMS_ID and (a.PER_STATUS=1 or a.PER_STATUS=0) and a.PER_TYPE=3 ";
		}elseif($DPISDB=="mysql"){
			$cmd = " select 	a.PER_ID, b.PN_NAME, a.PER_NAME, a.PER_SURNAME, a.PER_STATUS 
							 from 		PER_PERSONAL a
							 				left join PER_PRENAME b on (a.PN_CODE=b.PN_CODE)
							 where	a.POEMS_ID=$temp_POEMS_ID and (a.PER_STATUS=1 or a.PER_STATUS=0) and a.PER_TYPE=3 ";
		}
		$db_dpis2->send_cmd($cmd);
		$data_dpis2 = $db_dpis2->get_array();
		$POS_PERSON = "$data_dpis2[PN_NAME]$data_dpis2[PER_NAME] $data_dpis2[PER_SURNAME]";
		if($data_dpis2[PER_ID]) $POS_PERSON .= (($data_dpis2[PER_STATUS]==0)?" (รอบรรจุ)":"");
		
		$class = "table_body";
		$onmouse_event = " onMouseOver=\"this.className='table_body_over';\" onMouseOut=\"this.className='table_body';\" ";
		
		if($POEMS_ID==$temp_POEMS_ID){ 
			$class = "table_body_over";
			$onmouse_event = "";
		} // end if
?>
    >
       
<?=$PDF_TITLE?> <?=$RTF_TITLE?> พบข้อมูลทั้งสิ้น รายการ <?=$EXCEL_TITLE?>
กลุ่มงาน ชื่อตำแหน่ง ต่ำกว่า ผู้ครอง
ตำแหน่ง
           $ORG_NAME_2" ?>    ">เรียกดูข้อมูล  ">แก้ไขข้อมูล  "><?=$DEL_TITLE?> >
1) : ?>