"; include("php_scripts/personal_master_form.php"); if ($form1command=="personal"){ $POS_ID = $sendPOS; include("php_scripts/find_personal_position.php"); } } //echo "$BKK_FLAG || $ISCS_FLAG || $CARD_NO_FILL --------- COMMAND : $command // TOPIC : $show_topic // $POS_ID = $sendPOS -----------"; $db_dpis1 = new connect_dpis($dpisdb_host, $dpisdb_name, $dpisdb_user, $dpisdb_pwd, $dpisdb_port); $db_dpis2 = new connect_dpis($dpisdb_host, $dpisdb_name, $dpisdb_user, $dpisdb_pwd, $dpisdb_port); $db_dpis3 = new connect_dpis($dpisdb_host, $dpisdb_name, $dpisdb_user, $dpisdb_pwd, $dpisdb_port); // รวมไว้ที่เดียวเลย switch($CTRL_TYPE){ case 2 : $search_pv_code = $PROVINCE_CODE; $search_pv_name = $PROVINCE_NAME; $PROVINCE_CODE = $PROVINCE_CODE; $PROVINCE_NAME = $PROVINCE_NAME; break; case 3 : $search_ministry_id = $MINISTRY_ID; $search_ministry_name = $MINISTRY_NAME; $MAIN_MINISTRY_ID = $MINISTRY_ID; $MAIN_MINISTRY_NAME = $MINISTRY_NAME; break; case 4 : $search_ministry_id = $MINISTRY_ID; $search_ministry_name = $MINISTRY_NAME; $search_department_id = $DEPARTMENT_ID; $search_department_name = $DEPARTMENT_NAME; $MAIN_MINISTRY_ID = $MINISTRY_ID; $MAIN_MINISTRY_NAME = $MINISTRY_NAME; $MAIN_DEPARTMENT_ID = $DEPARTMENT_ID; $MAIN_DEPARTMENT_NAME = $DEPARTMENT_NAME; break; } // end switch case switch($SESS_USERGROUP_LEVEL){ case 2 : $search_pv_code = $PROVINCE_CODE; $search_pv_name = $PROVINCE_NAME; $PROVINCE_CODE = $PROVINCE_CODE; $PROVINCE_NAME = $PROVINCE_NAME; break; case 3 : $search_ministry_id = $MINISTRY_ID; $search_ministry_name = $MINISTRY_NAME; $MAIN_MINISTRY_ID = $MINISTRY_ID; $MAIN_MINISTRY_NAME = $MINISTRY_NAME; break; case 4 : $search_ministry_id = $MINISTRY_ID; $search_ministry_name = $MINISTRY_NAME; $search_department_id = $DEPARTMENT_ID; $search_department_name = $DEPARTMENT_NAME; $MAIN_MINISTRY_ID = $MINISTRY_ID; $MAIN_MINISTRY_NAME = $MINISTRY_NAME; $MAIN_DEPARTMENT_ID = $DEPARTMENT_ID; $MAIN_DEPARTMENT_NAME = $DEPARTMENT_NAME; break; case 5 : $search_ministry_id = $MINISTRY_ID; $search_ministry_name = $MINISTRY_NAME; $search_department_id = $DEPARTMENT_ID; $search_department_name = $DEPARTMENT_NAME; $search_org_id = $ORG_ID; $search_org_name = $ORG_NAME; $MAIN_MINISTRY_ID = $MINISTRY_ID; $MAIN_MINISTRY_NAME = $MINISTRY_NAME; $MAIN_DEPARTMENT_ID = $DEPARTMENT_ID; $MAIN_DEPARTMENT_NAME = $DEPARTMENT_NAME; $MAIN_ORG_ID = $ORG_ID; $MAIN_ORG_NAME = $ORG_NAME; break; case 6 : $search_ministry_id = $MINISTRY_ID; $search_ministry_name = $MINISTRY_NAME; $search_department_id = $DEPARTMENT_ID; $search_department_name = $DEPARTMENT_NAME; $search_org_id = $ORG_ID; $search_org_name = $ORG_NAME; $search_org_id_1 = $ORG_ID_1; $search_org_name_1 = $ORG_NAME_1; $MAIN_MINISTRY_ID = $MINISTRY_ID; $MAIN_MINISTRY_NAME = $MINISTRY_NAME; $MAIN_DEPARTMENT_ID = $DEPARTMENT_ID; $MAIN_DEPARTMENT_NAME = $DEPARTMENT_NAME; $MAIN_ORG_ID = $ORG_ID; $MAIN_ORG_NAME = $ORG_NAME; break; } // end switch case //---เพิ่มมาจาก personal_master_form if($SESS_PER_TYPE && $SESS_PER_TYPE!=0) $PER_TYPE=$SESS_PER_TYPE; if(!$PER_TYPE){ $PER_TYPE=1; } if(!$PER_STATUS){ $PER_STATUS=0; if ($PER_TYPE==1) $PER_MEMBER=1; } //default เพิ่มใหม่ รอบรรจุ if(!$PER_DISABILITY){ $PER_DISABILITY=1; } $search_per_status = (isset($search_per_status))? $search_per_status : 2; if ($search_data==20) { $search_per_status = 5; $order_by = 1; } if($DPISDB=="odbc") { $POS_NO_NUM = "CLng(POS_NO)"; $POEM_NO_NUM = "CLng(POEM_NO)"; $POEMS_NO_NUM = "CLng(POEMS_NO)"; $POT_NO_NUM = "CLng(POT_NO)"; } elseif($DPISDB=="oci8") { $POS_NO_NUM = "to_number(replace(POS_NO,'-',''))"; $POEM_NO_NUM = "to_number(replace(POEM_NO,'-',''))"; $POEMS_NO_NUM = "to_number(replace(POEMS_NO,'-',''))"; $POT_NO_NUM = "to_number(replace(POT_NO,'-',''))"; } elseif($DPISDB=="mysql") { $POS_NO_NUM = "POS_NO+0"; $POEM_NO_NUM = "POEM_NO+0"; $POEMS_NO_NUM = "POEMS_NO+0"; $POT_NO_NUM = "POT_NO+0"; } // end if // ส่วนของการค้นหา จากเงื่อนไขที่เลือกมา // if (!$search_cardno || $SESS_USERGROUP!=1) { if($search_org_id_1 && !$search_org_id_2 && !$search_org_id_3 && !$search_org_id_4 && !$search_org_id_5){ /* Release 5.1.0.4 */ if($select_org_structure==0){ //โครงสร้างตามกฎหมาย $arr_search_condition[] = "(c.ORG_ID_1=$search_org_id_1 or d.ORG_ID_1=$search_org_id_1 or e.ORG_ID_1=$search_org_id_1 or g.ORG_ID_1=$search_org_id_1)"; }else if($select_org_structure==1){ //โครงสร้างตามมอบหมายงาน $arr_search_condition[] = "(a.ORG_ID_1=$search_org_id_1)"; } }elseif($search_org_id_1 && $search_org_id_2 && !$search_org_id_3 && !$search_org_id_4 && !$search_org_id_5){ /* Release 5.1.0.4 */ if($select_org_structure==0){ //โครงสร้างตามกฎหมาย $arr_search_condition[] = "(c.ORG_ID_2=$search_org_id_2 or d.ORG_ID_2=$search_org_id_2 or e.ORG_ID_2=$search_org_id_2 or g.ORG_ID_2=$search_org_id_2)"; }else if($select_org_structure==1){ //โครงสร้างตามมอบหมายงาน $arr_search_condition[] = "(a.ORG_ID_2=$search_org_id_2)"; } }elseif($search_org_id_1 && $search_org_id_2 && $search_org_id_3 && !$search_org_id_4 && !$search_org_id_5){ /* Release 5.1.0.4 */ if($select_org_structure==0){ //โครงสร้างตามกฎหมาย $arr_search_condition[] = "(c.ORG_ID_3=$search_org_id_3 or d.ORG_ID_3=$search_org_id_3 or e.ORG_ID_3=$search_org_id_3 or g.ORG_ID_3=$search_org_id_3)"; }else if($select_org_structure==1){ //โครงสร้างตามมอบหมายงาน $arr_search_condition[] = "(a.ORG_ID_3=$search_org_id_3)"; } }elseif($search_org_id_1 && $search_org_id_2 && $search_org_id_3 && $search_org_id_4 && !$search_org_id_5){ /* Release 5.1.0.4 */ if($select_org_structure==0){ //โครงสร้างตามกฎหมาย $arr_search_condition[] = "(c.ORG_ID_4=$search_org_id_4 or d.ORG_ID_4=$search_org_id_4 or e.ORG_ID_4=$search_org_id_4 or g.ORG_ID_4=$search_org_id_4)"; }else if($select_org_structure==1){ //โครงสร้างตามมอบหมายงาน $arr_search_condition[] = "(a.ORG_ID_4=$search_org_id_4)"; } }elseif($search_org_id_1 && $search_org_id_2 && $search_org_id_3 && $search_org_id_4 && $search_org_id_5){ /* Release 5.1.0.4 */ if($select_org_structure==0){ //โครงสร้างตามกฎหมาย $arr_search_condition[] = "(c.ORG_ID_5=$search_org_id_5 or d.ORG_ID_5=$search_org_id_5 or e.ORG_ID_5=$search_org_id_5 or g.ORG_ID_5=$search_org_id_5)"; }else if($select_org_structure==1){ //โครงสร้างตามมอบหมายงาน $arr_search_condition[] = "(a.ORG_ID_5=$search_org_id_5)"; } }elseif($search_org_id){ if($select_org_structure==0){ $arr_search_condition[] = "(c.ORG_ID=$search_org_id or d.ORG_ID=$search_org_id or e.ORG_ID=$search_org_id or g.ORG_ID=$search_org_id)"; }else if($select_org_structure==1){ $arr_search_condition[] = "(a.ORG_ID=$search_org_id )"; // $arr_search_condition[] = "(a.ORG_ID=$search_org_id or c.ORG_ID=$search_org_id)"; } }elseif($search_department_id){ $arr_search_condition[] = "(a.DEPARTMENT_ID = $search_department_id)"; }elseif($search_ministry_id){ unset($arr_department); $cmd = " select ORG_ID from PER_ORG where ORG_ID_REF=$search_ministry_id and OL_CODE='02' "; if($SESS_ORG_STRUCTURE==1){ $cmd = str_replace("PER_ORG","PER_ORG_ASS",$cmd); } $db_dpis->send_cmd($cmd); while($data = $db_dpis->get_array()) $arr_department[] = $data[ORG_ID]; $arr_search_condition[] = "(a.DEPARTMENT_ID in (". implode(",", $arr_department) ."))"; }elseif($PROVINCE_CODE){ $cmd = " select distinct ORG_ID_REF from PER_ORG where PV_CODE='$PROVINCE_CODE' and OL_CODE='03' "; if($SESS_ORG_STRUCTURE==1){ $cmd = str_replace("PER_ORG","PER_ORG_ASS",$cmd); } $db_dpis->send_cmd($cmd); while($data = $db_dpis->get_array()) $arr_department[] = $data[ORG_ID_REF]; $arr_search_condition[] = "(a.DEPARTMENT_ID in (". implode(",", $arr_department) ."))"; } // end if } if(!$sort_by) $sort_by=2; $sort_type = (isset($sort_type))? $sort_type : "1:asc"; $arrSort=explode(":",$sort_type); $SortType[$arrSort[0]] =$arrSort[1]; if(!$order_by) $order_by=2; /*Release 5.2.1.7 .... 25/04/2017 */ if($search_per_type == "1"){ if(trim($search_pl_code)) $arr_search_condition[] = "(trim(c.PL_CODE) = '". trim($search_pl_code) ."')"; } else if($search_per_type == "2"){ if(trim($search_pl_code)) $arr_search_condition[] = "(trim(d.PN_CODE) = '". trim($search_pl_code) ."')"; } else if($search_per_type == "3"){ if(trim($search_pl_code)) $arr_search_condition[] = "(trim(e.EP_CODE) = '". trim($search_pl_code) ."')"; } else if($search_per_type == "4"){ if(trim($search_pl_code)) $arr_search_condition[] = "(trim(g.TP_CODE) = '". trim($search_pl_code) ."')"; } else if($search_per_type == "0"){ if(trim($search_pl_code)) $arr_search_condition[] = "(trim(c.PL_CODE) = '". trim($search_pl_code) ."')"; } /*END Release 5.2.1.7 .... 25/04/2017*/ if(trim($search_pm_code)) $arr_search_condition[] = "(trim(PM_CODE) = '". trim($search_pm_code) ."')"; if(trim($search_name)) if($command == "SEARCH") $arr_search_condition[] = "(PER_NAME like '$search_name%' or UPPER(PER_ENG_NAME) like UPPER('$search_name%'))"; elseif($command == "SEARCHNAMEHIS") $arr_search_condition[] = "(PER_NAME like '$search_name%' or UPPER(PER_ENG_NAME) like UPPER('$search_name%') or NH_NAME like '$search_name%')"; if(trim($search_surname)) if($command == "SEARCH") $arr_search_condition[] = "(PER_SURNAME like '$search_surname%' or UPPER(PER_ENG_SURNAME) like UPPER('$search_surname%'))"; elseif($command == "SEARCHNAMEHIS") $arr_search_condition[] = "(PER_SURNAME like '$search_surname%' or UPPER(PER_ENG_SURNAME) like UPPER('$search_surname%') or NH_SURNAME like '$search_surname%')";; if(trim($search_cardno)) $arr_search_condition[] = "(a.PER_CARDNO = '$search_cardno')"; if(trim($search_offno)) $arr_search_condition[] = "(PER_OFFNO = '$search_offno')"; if(trim($search_pos_no)) { if ($search_per_type == 1 || $search_per_type==5) $arr_search_condition[] = "(trim(POS_NO) = '$search_pos_no')"; elseif ($search_per_type == 2) $arr_search_condition[] = "(trim(POEM_NO) = '$search_pos_no')"; elseif ($search_per_type == 3) $arr_search_condition[] = "(trim(POEMS_NO) = '$search_pos_no')"; elseif ($search_per_type == 4) $arr_search_condition[] = "(trim(POT_NO) = '$search_pos_no')"; else if ($search_per_type==0) //ทั้งหมด $arr_search_condition[] = "((trim(POS_NO) = '$search_pos_no') or (trim(POEM_NO) = '$search_pos_no') or (trim(POEMS_NO) = '$search_pos_no') or (trim(POT_NO) = '$search_pos_no')) "; } if(trim($search_pos_no_name)){ if ($search_per_type == 1 || $search_per_type==5) $arr_search_condition[] = "(trim(POS_NO_NAME) like '$search_pos_no_name%')"; elseif ($search_per_type == 2) $arr_search_condition[] = "(trim(POEM_NO_NAME) like '$search_pos_no_name%')"; elseif ($search_per_type == 3) $arr_search_condition[] = "(trim(POEMS_NO_NAME) like '$search_pos_no_name%')"; elseif ($search_per_type == 4) $arr_search_condition[] = "(trim(POT_NO_NAME) like '$search_pos_no_name%')"; else if ($search_per_type==0) //ทั้งหมด $arr_search_condition[] = "((trim(POS_NO_NAME) like '$search_pos_no_name%') or (trim(POEM_NO_NAME) like '$search_pos_no_name%') or (trim(POEMS_NO_NAME) like '$search_pos_no_name%') or (trim(POT_NO_NAME) like '$search_pos_no_name%')) "; } if(trim($search_pay_no)) $arr_search_condition[] = "(trim(POS_NO) = '$search_pay_no' and a.PER_TYPE = 1)"; if(trim($search_level_no)) $arr_search_condition[] = "(trim(a.LEVEL_NO) = '". trim($search_level_no) ."')"; if(trim($search_per_type)) $arr_search_condition[] = "(a.PER_TYPE = $search_per_type)"; if(trim($search_per_status) < 5) { $temp_per_status = $search_per_status - 1; $arr_search_condition[] = "(PER_STATUS = $temp_per_status)"; } $check_condition = ""; if ($search_data==1) $check_condition = " and (a.PER_ID not in (select b.PER_ID from PER_EDUCATE b where a.PER_ID = b.PER_ID and EDU_TYPE like '%1%')) "; elseif ($search_data==2) $check_condition = " and (a.PER_ID not in (select b.PER_ID from PER_EDUCATE b where a.PER_ID = b.PER_ID and EDU_TYPE like '%2%')) "; elseif ($search_data==3) $check_condition = " and (a.PER_ID not in (select b.PER_ID from PER_POSITIONHIS b where a.PER_ID = b.PER_ID)) "; elseif ($search_data==4) $check_condition = " and (a.PER_ID not in (select b.PER_ID from PER_SALARYHIS b where a.PER_ID = b.PER_ID)) "; elseif ($search_data==5) $check_condition = " and (a.PER_ID not in (select b.PER_ID from PER_DECORATEHIS b where a.PER_ID = b.PER_ID)) "; elseif ($search_data==6) $check_condition = " and (a.PER_ID in (select b.PER_ID from PER_EDUCATE b where a.PER_ID = b.PER_ID and EDU_TYPE like '%1%' group by b.PER_ID having count(*) > 1)) "; elseif ($search_data==7) $check_condition = " and (a.PER_ID in (select b.PER_ID from PER_EDUCATE b where a.PER_ID = b.PER_ID and EDU_TYPE like '%2%' group by b.PER_ID having count(*) > 1)) "; elseif ($search_data==8) $check_condition = " and (a.PER_ID in (select b.PER_ID from PER_EDUCATE b where a.PER_ID = b.PER_ID and INS_CODE is NULL and EDU_INSTITUTE is NULL)) "; elseif ($search_data==9) $check_condition = " and (a.PER_ID not in (select b.PER_ID from PER_EDUCATE b where a.PER_ID = b.PER_ID and EDU_TYPE like '%4%')) "; elseif ($search_data==10) $check_condition = " and (a.PER_ID in (select b.PER_ID from PER_EDUCATE b where a.PER_ID = b.PER_ID and EDU_TYPE like '%4%' group by b.PER_ID having count(*) > 1)) "; elseif ($search_data==11) { // PIC_SIGN ไม่เท่ากับ 1 หรือ = NULL แปลว่า เป็นรูปที่ใช้แสดง และไม่ใช้ลายเซ็น // $check_condition = " and (a.PER_ID not in (select b.PER_ID from PER_PERSONALPIC b where a.PER_ID = b.PER_ID and PIC_SHOW = 1 and (PIC_SIGN <> 1 or PIC_SIGN is NULL))) "; $check_condition = ""; } elseif ($search_data==12) $check_condition = " and (a.ORG_ID is NULL) "; elseif ($search_data==13) { // PIC_SIGN = 1 แปลว่า เป็นรูป "ลายเซ็น" ที่ใช้แสดง $check_condition = " and (a.PER_ID not in (select b.PER_ID from PER_PERSONALPIC b where a.PER_ID = b.PER_ID and PIC_SHOW = 1 and PIC_SIGN = 1)) "; $check_condition = ""; } elseif ($search_data==14) $check_condition = " and (c.PL_CODE in (select d.PL_CODE from PER_LINE d where c.PL_CODE = d.PL_CODE and a.LEVEL_NO not between LEVEL_NO_MIN and LEVEL_NO_MAX)) "; elseif ($search_data==15) $check_condition = " and (a.POS_ID in (select POS_ID from PER_PERSONAL where PER_TYPE = 1 and PER_STATUS = 1 group by POS_ID having count(*) > 1)) "; elseif ($search_data==16) $check_condition = " and (a.PER_ID in (select b.PER_ID from PER_POSITIONHIS b where a.PER_ID = b.PER_ID and b.POH_EFFECTIVEDATE < '$PT_DATE' and (b.LEVEL_NO in ('O1', 'O2', 'O3', 'O4', 'K1', 'K2', 'K3', 'K4', 'K5', 'D1', 'D2', 'M1', 'M2') or b.POH_LEVEL_NO in ('O1', 'O2', 'O3', 'O4', 'K1', 'K2', 'K3', 'K4', 'K5', 'D1', 'D2', 'M1', 'M2')))) "; elseif ($search_data==17) $check_condition = " and (a.PER_ID in (select b.PER_ID from PER_SALARYHIS b where a.PER_ID = b.PER_ID and b.SAH_EFFECTIVEDATE < '$PT_DATE' and b.LEVEL_NO in ('O1', 'O2', 'O3', 'O4', 'K1', 'K2', 'K3', 'K4', 'K5', 'D1', 'D2', 'M1', 'M2'))) "; elseif ($search_data==18) $check_condition = " and (a.PER_ID not in (select b.PER_ID from PER_ABSENTHIS b where a.PER_ID = b.PER_ID)) "; elseif ($search_data==19) { $cmd = " select PER_ID from PER_PERSONAL where POS_ID in (select POS_ID from PER_POS_MGTSALARY a, PER_EXTRATYPE b where a.EX_CODE=b.EX_CODE and POS_STATUS = 1 and MGT_FLAG = 1) and PER_TYPE = 1 and PER_STATUS = 1 minus select PER_ID from PER_POS_MGTSALARYHIS a, PER_EXTRATYPE b where a.EX_CODE=b.EX_CODE and MGT_FLAG = 1 and PMH_ACTIVE = 1 and (PMH_ENDDATE is NULL or PMH_ENDDATE >= '$UPDATE_DATE') "; $db_dpis2->send_cmd($cmd); // echo "$cmd
"; while ($data2 = $db_dpis2->get_array()) { $arr_per_id[] = $data2[PER_ID]; } $check_condition = " and (a.PER_ID in (".implode(",",$arr_per_id).")) "; } elseif ($search_data==20) { $cmd = " select PER_ID, PER_NAME, PER_SURNAME from PER_PERSONAL order by PER_NAME, PER_SURNAME "; $db_dpis2->send_cmd($cmd); // echo "$cmd
"; while ($data2 = $db_dpis2->get_array()) { if ($CHK_PER_NAME == trim($data2[PER_NAME]) && $CHK_PER_SURNAME == trim($data2[PER_SURNAME])) { $count = $count + 2; if ($count < 1000) { $arr_per_id[] = $data2[PER_ID]; $arr_per_id[] = $CHK_PER_ID; } elseif ($count < 2000) { $arr_per_id2[] = $data2[PER_ID]; $arr_per_id2[] = $CHK_PER_ID; } elseif ($count < 3000) { $arr_per_id3[] = $data2[PER_ID]; $arr_per_id3[] = $CHK_PER_ID; } elseif ($count < 4000) { $arr_per_id4[] = $data2[PER_ID]; $arr_per_id4[] = $CHK_PER_ID; } elseif ($count < 5000) { $arr_per_id5[] = $data2[PER_ID]; $arr_per_id5[] = $CHK_PER_ID; } elseif ($count < 6000) { $arr_per_id6[] = $data2[PER_ID]; $arr_per_id6[] = $CHK_PER_ID; } elseif ($count < 7000) { $arr_per_id7[] = $data2[PER_ID]; $arr_per_id7[] = $CHK_PER_ID; } elseif ($count < 8000) { $arr_per_id8[] = $data2[PER_ID]; $arr_per_id8[] = $CHK_PER_ID; } elseif ($count < 9000) { $arr_per_id9[] = $data2[PER_ID]; $arr_per_id9[] = $CHK_PER_ID; } elseif ($count < 10000) { $arr_per_id10[] = $data2[PER_ID]; $arr_per_id10[] = $CHK_PER_ID; } elseif ($count < 11000) { $arr_per_id11[] = $data2[PER_ID]; $arr_per_id11[] = $CHK_PER_ID; } else { $arr_per_id12[] = $data2[PER_ID]; $arr_per_id12[] = $CHK_PER_ID; } } $CHK_PER_ID = $data2[PER_ID]; $CHK_PER_NAME = trim($data2[PER_NAME]); $CHK_PER_SURNAME = trim($data2[PER_SURNAME]); } if (count($arr_per_id) > 0) { if (count($arr_per_id11)) $check_condition = " and ((a.PER_ID in (". implode(",", $arr_per_id) .")) or (a.PER_ID in (". implode(",", $arr_per_id2) .")) or (a.PER_ID in (". implode(",", $arr_per_id3) .")) or (a.PER_ID in (". implode(",", $arr_per_id4) .")) or (a.PER_ID in (". implode(",", $arr_per_id5) .")) or (a.PER_ID in (". implode(",", $arr_per_id6) .")) or (a.PER_ID in (". implode(",", $arr_per_id7) .")) or (a.PER_ID in (". implode(",", $arr_per_id8) .")) or (a.PER_ID in (". implode(",", $arr_per_id9) .")) or (a.PER_ID in (". implode(",", $arr_per_id10) .")) or (a.PER_ID in (". implode(",", $arr_per_id11) .")) or (a.PER_ID in (". implode(",", $arr_per_id12) .")))"; elseif (count($arr_per_id11)) $check_condition = " and ((a.PER_ID in (". implode(",", $arr_per_id) .")) or (a.PER_ID in (". implode(",", $arr_per_id2) .")) or (a.PER_ID in (". implode(",", $arr_per_id3) .")) or (a.PER_ID in (". implode(",", $arr_per_id4) .")) or (a.PER_ID in (". implode(",", $arr_per_id5) .")) or (a.PER_ID in (". implode(",", $arr_per_id6) .")) or (a.PER_ID in (". implode(",", $arr_per_id7) .")) or (a.PER_ID in (". implode(",", $arr_per_id8) .")) or (a.PER_ID in (". implode(",", $arr_per_id9) .")) or (a.PER_ID in (". implode(",", $arr_per_id10) .")) or (a.PER_ID in (". implode(",", $arr_per_id11) .")))"; elseif (count($arr_per_id10)) $check_condition = " and ((a.PER_ID in (". implode(",", $arr_per_id) .")) or (a.PER_ID in (". implode(",", $arr_per_id2) .")) or (a.PER_ID in (". implode(",", $arr_per_id3) .")) or (a.PER_ID in (". implode(",", $arr_per_id4) .")) or (a.PER_ID in (". implode(",", $arr_per_id5) .")) or (a.PER_ID in (". implode(",", $arr_per_id6) .")) or (a.PER_ID in (". implode(",", $arr_per_id7) .")) or (a.PER_ID in (". implode(",", $arr_per_id8) .")) or (a.PER_ID in (". implode(",", $arr_per_id9) .")) or (a.PER_ID in (". implode(",", $arr_per_id10) .")))"; elseif (count($arr_per_id9)) $check_condition = " and ((a.PER_ID in (". implode(",", $arr_per_id) .")) or (a.PER_ID in (". implode(",", $arr_per_id2) .")) or (a.PER_ID in (". implode(",", $arr_per_id3) .")) or (a.PER_ID in (". implode(",", $arr_per_id4) .")) or (a.PER_ID in (". implode(",", $arr_per_id5) .")) or (a.PER_ID in (". implode(",", $arr_per_id6) .")) or (a.PER_ID in (". implode(",", $arr_per_id7) .")) or (a.PER_ID in (". implode(",", $arr_per_id8) .")) or (a.PER_ID in (". implode(",", $arr_per_id9) .")))"; elseif (count($arr_per_id8)) $check_condition = " and ((a.PER_ID in (". implode(",", $arr_per_id) .")) or (a.PER_ID in (". implode(",", $arr_per_id2) .")) or (a.PER_ID in (". implode(",", $arr_per_id3) .")) or (a.PER_ID in (". implode(",", $arr_per_id4) .")) or (a.PER_ID in (". implode(",", $arr_per_id5) .")) or (a.PER_ID in (". implode(",", $arr_per_id6) .")) or (a.PER_ID in (". implode(",", $arr_per_id7) .")) or (a.PER_ID in (". implode(",", $arr_per_id8) .")))"; elseif (count($arr_per_id7)) $check_condition = " and ((a.PER_ID in (". implode(",", $arr_per_id) .")) or (a.PER_ID in (". implode(",", $arr_per_id2) .")) or (a.PER_ID in (". implode(",", $arr_per_id3) .")) or (a.PER_ID in (". implode(",", $arr_per_id4) .")) or (a.PER_ID in (". implode(",", $arr_per_id5) .")) or (a.PER_ID in (". implode(",", $arr_per_id6) .")) or (a.PER_ID in (". implode(",", $arr_per_id7) .")))"; elseif (count($arr_per_id6)) $check_condition = " and ((a.PER_ID in (". implode(",", $arr_per_id) .")) or (a.PER_ID in (". implode(",", $arr_per_id2) .")) or (a.PER_ID in (". implode(",", $arr_per_id3) .")) or (a.PER_ID in (". implode(",", $arr_per_id4) .")) or (a.PER_ID in (". implode(",", $arr_per_id5) .")) or (a.PER_ID in (". implode(",", $arr_per_id6) .")))"; elseif (count($arr_per_id5)) $check_condition = " and ((a.PER_ID in (". implode(",", $arr_per_id) .")) or (a.PER_ID in (". implode(",", $arr_per_id2) .")) or (a.PER_ID in (". implode(",", $arr_per_id3) .")) or (a.PER_ID in (". implode(",", $arr_per_id4) .")) or (a.PER_ID in (". implode(",", $arr_per_id5) .")))"; elseif (count($arr_per_id4)) $check_condition = " and ((a.PER_ID in (". implode(",", $arr_per_id) .")) or (a.PER_ID in (". implode(",", $arr_per_id2) .")) or (a.PER_ID in (". implode(",", $arr_per_id3) .")) or (a.PER_ID in (". implode(",", $arr_per_id4) .")))"; elseif (count($arr_per_id3)) $check_condition = " and ((a.PER_ID in (". implode(",", $arr_per_id) .")) or (a.PER_ID in (". implode(",", $arr_per_id2) .")) or (a.PER_ID in (". implode(",", $arr_per_id3) .")))"; elseif (count($arr_per_id2)) $check_condition = " and ((a.PER_ID in (". implode(",", $arr_per_id) .")) or (a.PER_ID in (". implode(",", $arr_per_id2) .")))"; else $check_condition = " and (a.PER_ID in (".implode(",",$arr_per_id).")) "; } } else if($search_data==21){/* เพิ่มการเช็ค มีข้อมูลความเชี่ยวชาญพิเศษ 3/11/2559*/ $check_condition = " and (a.PER_ID in (select b.PER_ID from PER_SPECIAL_SKILL b where a.PER_ID = b.PER_ID and b.ss_code != '-1')) "; }else if($search_data==22){/* เพิ่มการเช็คที่มีการตรวจสอบเเล้ว มีข้อมูลความเชี่ยวชาญพิเศษ 3/11/2559*/ $check_condition = " and (a.PER_ID in (select b.PER_ID from PER_SPECIAL_SKILL b where a.PER_ID = b.PER_ID and b.ss_code != '-1' and b.AUDIT_FLAG = '2')) "; }else if($search_data==23){ $cmd = " select AUDIT_FLAG from PER_SPECIAL_SKILL "; $db_dpis->send_cmd($cmd); while($data = $db_dpis->get_array()){ $data[AUDIT_FLAG]; } if($data[AUDIT_FLAG] != "1" || $data[AUDIT_FLAG] != "2" || $data[AUDIT_FLAG] != "3"){/* เพิ่มการเช็คที่ยังไม่ได้ตรวจสอบ มีข้อมูลความเชี่ยวชาญพิเศษ 3/11/2559*/ $check_condition = " and (a.PER_ID in (select b.PER_ID from PER_SPECIAL_SKILL b where a.PER_ID = b.PER_ID AND b.AUDIT_FLAG is null OR AUDIT_FLAG='N' and b.ss_code != '-1')) "; } }// credit by kong else if($search_data==24){ $check_condition = " and (a.PER_ID in (select b.PER_ID from PER_PERSONAL b where a.PER_ID = b.PER_ID and b.LEVEL_NO IS NULL)) "; }else if($search_data==25){ $check_condition = " and (a.PER_ID not in (select b.PER_ID from PER_SPECIAL_SKILL b where a.PER_ID = b.PER_ID)) "; }else if($search_data==26){ $check_condition = " and (a.PER_ID in (select b.PER_ID from PER_SPECIAL_SKILL b where a.PER_ID = b.PER_ID and b.ss_code = '-1')) "; }else if($search_data==27){ $check_condition = " and (a.PER_ID in (select b.PER_ID from PER_SPECIAL_SKILL b where a.PER_ID = b.PER_ID and b.ss_code != '-1' and b.AUDIT_FLAG = '1')) "; } /* Release 5.2.1.7 ปรับเปลี่ยน flag เหลือ 3 else if($search_data==28){ $check_condition = " and (a.PER_ID in (select b.PER_ID from PER_SPECIAL_SKILL b where a.PER_ID = b.PER_ID and b.ss_code != '-1' and b.AUDIT_FLAG = '3')) "; } */ $search_condition = ""; if(count($arr_search_condition)) $search_condition = " where " . implode(" and ", $arr_search_condition); if($order_by==1) { //ชื่อ if($DPISDB=="oci8"){ $order_str = "NLSSORT(PER_NAME,'NLS_SORT=THAI_DICTIONARY') $SortType[$order_by], NLSSORT(PER_SURNAME,'NLS_SORT=THAI_DICTIONARY') $SortType[$order_by] "; }else{ $order_str = "PER_NAME $SortType[$order_by], PER_SURNAME $SortType[$order_by] "; } } elseif($order_by==2){ //(ค่าเริ่มต้น) เลขที่ตำแหน่ง $org_cond = ""; if ($POSITION_NO_CHAR=="Y") $org_cond = ", i.ORG_SEQ_NO $SortType[$order_by], i.ORG_CODE $SortType[$order_by]"; if($DPISDB=="odbc") { if ($search_per_type==0 || $search_per_type==1 || $search_per_type==5) $order_str = "a.DEPARTMENT_ID $SortType[$order_by]".$org_cond.", POS_NO_NAME $SortType[$order_by], iif(isnull(POS_NO),0,$POS_NO_NUM) $SortType[$order_by]"; elseif ($search_per_type==0 || $search_per_type==2) $order_str = "a.DEPARTMENT_ID $SortType[$order_by]".$org_cond.", POEM_NO_NAME $SortType[$order_by], iif(isnull(POEM_NO),0,$POEM_NO_NUM) $SortType[$order_by]"; elseif ($search_per_type==0 || $search_per_type==3) $order_str = "a.DEPARTMENT_ID $SortType[$order_by]".$org_cond.", POEMS_NO_NAME $SortType[$order_by], iif(isnull(POEMS_NO),0,$POEMS_NO_NUM) $SortType[$order_by]"; elseif ($search_per_type==0 || $search_per_type==4) $order_str = "a.DEPARTMENT_ID $SortType[$order_by]".$org_cond.", POT_NO_NAME $SortType[$order_by], iif(isnull(POT_NO),0,$POT_NO_NUM) $SortType[$order_by]"; }elseif($DPISDB=="oci8" || $DPISDB=="mysql"){ if ($search_per_type==0 || $search_per_type==1 || $search_per_type==5) $order_str = "a.DEPARTMENT_ID $SortType[$order_by]".$org_cond.", POS_NO_NAME $SortType[$order_by], $POS_NO_NUM $SortType[$order_by]"; elseif ($search_per_type==0 || $search_per_type==2) $order_str = "a.DEPARTMENT_ID $SortType[$order_by]".$org_cond.", POEM_NO_NAME $SortType[$order_by], $POEM_NO_NUM $SortType[$order_by]"; elseif ($search_per_type==0 || $search_per_type==3) $order_str = "a.DEPARTMENT_ID $SortType[$order_by]".$org_cond.", POEMS_NO_NAME $SortType[$order_by], $POEMS_NO_NUM $SortType[$order_by]"; elseif ($search_per_type==0 || $search_per_type==4) $order_str = "a.DEPARTMENT_ID $SortType[$order_by]".$org_cond.", POT_NO_NAME $SortType[$order_by], $POT_NO_NUM $SortType[$order_by]"; } } elseif($order_by==3) {//ระดับตำแหน่ง if($DPISDB=="odbc") { if ($search_per_type==0 || $search_per_type==1 || $search_per_type==5) $order_str = "f.LEVEL_SEQ_NO $SortType[$order_by], iif(isnull(POS_NO),0,$POS_NO_NUM) $SortType[$order_by]"; elseif ($search_per_type==0 || $search_per_type==2) $order_str = "f.LEVEL_SEQ_NO $SortType[$order_by], iif(isnull(POEM_NO),0,$POEM_NO_NUM) $SortType[$order_by]"; elseif ($search_per_type==0 || $search_per_type==3) $order_str = "f.LEVEL_SEQ_NO $SortType[$order_by], iif(isnull(POEMS_NO),0,$POEMS_NO_NUM) $SortType[$order_by]"; elseif ($search_per_type==0 || $search_per_type==4) $order_str = "f.LEVEL_SEQ_NO $SortType[$order_by], iif(isnull(POT_NO),0,$POT_NO_NUM) $SortType[$order_by]"; }elseif($DPISDB=="oci8" || $DPISDB=="mysql"){ if ($search_per_type==0 || $search_per_type==1 || $search_per_type==5) $order_str = "f.LEVEL_SEQ_NO $SortType[$order_by], $POS_NO_NUM $SortType[$order_by]"; elseif ($search_per_type==0 || $search_per_type==2) $order_str = "f.LEVEL_SEQ_NO $SortType[$order_by], $POEM_NO_NUM $SortType[$order_by]"; elseif ($search_per_type==0 || $search_per_type==3) $order_str = "f.LEVEL_SEQ_NO $SortType[$order_by], $POEMS_NO_NUM $SortType[$order_by]"; elseif ($search_per_type==0 || $search_per_type==4) $order_str = "f.LEVEL_SEQ_NO $SortType[$order_by], $POT_NO_NUM $SortType[$order_by]"; } } elseif($order_by==4) { $order_str = "a.DEPARTMENT_ID $SortType[$order_by], PER_NAME $SortType[$order_by], PER_SURNAME $SortType[$order_by]"; } elseif($order_by==5) { if ($search_per_type==0 || $search_per_type==1 || $search_per_type==5) $order_str = "c.ORG_ID $SortType[$order_by], PER_NAME $SortType[$order_by], PER_SURNAME $SortType[$order_by]"; elseif ($search_per_type==0 || $search_per_type==2) $order_str = "d.ORG_ID $SortType[$order_by], PER_NAME $SortType[$order_by], PER_SURNAME $SortType[$order_by]"; elseif ($search_per_type==0 || $search_per_type==3) $order_str = "e.ORG_ID $SortType[$order_by], PER_NAME $SortType[$order_by], PER_SURNAME $SortType[$order_by]"; elseif ($search_per_type==0 || $search_per_type==4) $order_str = "f.ORG_ID $SortType[$order_by], PER_NAME $SortType[$order_by], PER_SURNAME $SortType[$order_by]"; } elseif($order_by==6) { if ($SESS_DEPARTMENT_NAME=="กรมวิชาการเกษตร") $order_str = "PER_SEQ_NO $SortType[$order_by]"; else $order_str = "PER_FILE_NO $SortType[$order_by]"; } if($command == "SEARCH" || $command == "SEARCHNAMEHIS" || $command == "SEARCHPAY"){ if($command == "SEARCH" || $command == "SEARCHNAMEHIS") $search_con = "a.POS_ID=c.POS_ID"; elseif($command == "SEARCHPAY") $search_con = "a.PAY_ID=c.POS_ID"; if($search_pos_no || $search_pos_no_name) $search_con = "a.POS_ID=c.POS_ID"; elseif($search_pay_no) $search_con = "a.PAY_ID=c.POS_ID"; /* by jerd ********************************** //สำหรับเงื่อนไข check คนที่ไม่มีรูปประจำตัว if ($search_data==11){ if($DPISDB=="odbc"){ $cmd = " select a.PER_CARDNO, a.PER_ID, a.PN_CODE, PER_NAME, PER_SURNAME, NH_NAME, NH_SURNAME from ( ( ( ( ( ( PER_PERSONAL a left join PER_POSITION c on ($search_con) ) left join PER_POS_EMP d on (a.POEM_ID=d.POEM_ID) ) left join PER_POS_EMPSER e on (a.POEMS_ID=e.POEMS_ID) ) left join PER_LEVEL f on (a.LEVEL_NO=f.LEVEL_NO) ) left join PER_POS_TEMP g on (a.POT_ID=g.POT_ID) ) left join PER_NAMEHIS h on (a.PER_ID=h.PER_ID) ) left join PER_ORG i on (c.ORG_ID=i.ORG_ID) $search_condition $check_condition order by $order_str "; }elseif($DPISDB=="oci8"){ $search_condition = str_replace(" where ", " and ", $search_condition); $cmd = "select a.PER_CARDNO, a.PER_ID, a.PN_CODE, PER_NAME, PER_SURNAME, NH_NAME, NH_SURNAME from PER_PERSONAL a, PER_POSITION c, PER_POS_EMP d, PER_POS_EMPSER e, PER_LEVEL f, PER_POS_TEMP g, PER_NAMEHIS h, PER_ORG i where $search_con(+) and a.POEM_ID=d.POEM_ID(+) and a.POEMS_ID=e.POEMS_ID(+) and a.LEVEL_NO=f.LEVEL_NO(+) and a.POT_ID=g.POT_ID(+) and a.PER_ID=h.PER_ID(+) and c.ORG_ID=i.ORG_ID(+) $search_condition $check_condition order by $order_str "; }elseif($DPISDB=="mysql"){ $cmd = " select a.PER_CARDNO, a.PER_ID, a.PN_CODE, PER_NAME, PER_SURNAME, NH_NAME, NH_SURNAME from ( ( ( ( ( ( PER_PERSONAL a left join PER_POSITION c on ($search_con) ) left join PER_POS_EMP d on (a.POEM_ID=d.POEM_ID) ) left join PER_POS_EMPSER e on (a.POEMS_ID=e.POEMS_ID) ) left join PER_LEVEL f on (a.LEVEL_NO=f.LEVEL_NO) ) left join PER_POS_TEMP g on (a.POT_ID=g.POT_ID) ) left join PER_NAMEHIS h on (a.PER_ID=h.PER_ID) ) left join PER_ORG i on (c.ORG_ID=i.ORG_ID) $search_condition $check_condition order by $order_str "; } // echo "
$cmd
"; $db_dpis->send_cmd($cmd); // $db_dpis->show_error(); $countNOPIC=0; while ($data = $db_dpis->get_array()) { $PER_ID= trim($data[PER_ID]); $PER_NAME_SHOW = $data[PER_NAME]; $PER_SURNAME_SHOW = $data[PER_SURNAME]; $FULLNAME = "$PER_NAME_SHOW $PER_SURNAME_SHOW"; $FULLNAMEO = "$NH_NAME $NH_SURNAME"; $PER_CARDNO=trim($data[PER_CARDNO]); if(!file_exists("../attachment/pic_personal/".$PER_CARDNO."-001.jpg")){ //echo "[ไม่มี] $PER_CARDNO = $PER_ID :: $FULLNAME
"; $arrNOPIC[]="'".$PER_ID."'"; }else{ //มี //echo "[มี] $PER_CARDNO = $PER_ID :: $FULLNAME
"; $arrHAVEPIC[]="'".$PER_ID."'"; } } //end while //ใน query IN ต้องมีจำนวน list ไม่มากกว่า 1000 ถ้ามากกว่า มันจะ error if(is_array($arrNOPIC)){ $countNOPIC=count($arrNOPIC); for($i=0; $i < $countNOPIC; $i++){ if($i%1000==0){ $aa[]=$i; } } //วน loop เพื่อสร้าง string for($i=0; $i"; for($j=($aa[$i]); $j<($aa[$i+1]); $j++){ $strfirst.=$arrNOPIC[$j].","; } }else{ if($i==count($aa)-1){ //ตำแหน่งสุดท้าย //__echo ($aa[$i])." < ".$countNOPIC."
"; for($j=($aa[$i]); $j<($countNOPIC); $j++){ $strlast.=$arrNOPIC[$j].","; } }else{ //ตำแหน่งอื่นๆ ซึ่งมีมากกว่า 1 อัน //__echo ($aa[$i])." < ".$aa[$i+1]."
"; $count++; for($j=($aa[$i]); $j<($aa[$i+1]); $j++){ $strmid[$count] .=$arrNOPIC[$j].","; } } } } // end for //##สร้างเงื่อนไขให้ query (==First==)## $strfirst=substr($strfirst,0,-1); $check_condition = " and (a.PER_ID in (".$strfirst.") "; for($i=1; $i <= count($strmid); $i++){ $arr_strmid[$i]=" or a.PER_ID in ( ".substr($strmid[$i],0,-1).") "; } //end for //==Middle==// for($i=1; $i <= count($arr_strmid); $i++){ $check_condition .= $arr_strmid[$i]; } //end for //==Last==// $strlast=substr($strlast,0,-1); $check_condition .= " or a.PER_ID in (".$strlast.")) "; } //end if(is_array($arrNOPIC)) if(is_array($arrHAVEPIC)){ $countHAVEPIC=count($arrHAVEPIC); //$check_condition = " and (a.PER_ID not in (". implode(",", $arrHAVEPIC) .")) "; //ตัดคนที่มีออก เอาคนที่ไม่มีมา } //___echo $check_condition."

"; } //end if check คนที่ไม่มีรูปประจำตัว by jerd ***************************************/ if($command == "SEARCH") { if($DPISDB=="odbc"){ $cmd = " select count(a.PER_ID) as count_data from ((( PER_PERSONAL a left join PER_POSITION c on ($search_con) ) left join PER_POS_EMP d on (a.POEM_ID=d.POEM_ID) ) left join PER_POS_EMPSER e on (a.POEMS_ID=e.POEMS_ID) ) left join PER_POS_TEMP g on (a.POT_ID=g.POT_ID) $search_condition $check_condition "; }elseif($DPISDB=="oci8"){ $search_condition = str_replace(" where ", " and ", $search_condition); $cmd = " select count(a.PER_ID) as count_data from PER_PERSONAL a, PER_POSITION c, PER_POS_EMP d, PER_POS_EMPSER e, PER_POS_TEMP g where $search_con(+) and a.POEM_ID=d.POEM_ID(+) and a.POEMS_ID=e.POEMS_ID(+) and a.POT_ID=g.POT_ID(+) $search_condition $check_condition "; }elseif($DPISDB=="mysql"){ $cmd = " select count(a.PER_ID) as count_data from ((( PER_PERSONAL a left join PER_POSITION c on ($search_con) ) left join PER_POS_EMP d on (a.POEM_ID=d.POEM_ID) ) left join PER_POS_EMPSER e on (a.POEMS_ID=e.POEMS_ID) ) left join PER_POS_TEMP g on (a.POT_ID=g.POT_ID) $search_condition $check_condition "; } // end if } elseif($command == "SEARCHNAMEHIS") { if($DPISDB=="odbc"){ $cmd = " select count(a.PER_ID) as count_data from (((( PER_PERSONAL a left join PER_POSITION c on ($search_con) ) left join PER_POS_EMP d on (a.POEM_ID=d.POEM_ID) ) left join PER_POS_EMPSER e on (a.POEMS_ID=e.POEMS_ID) ) left join PER_POS_TEMP g on (a.POT_ID=g.POT_ID) ) left join PER_NAMEHIS h on (a.PER_ID=h.PER_ID) $search_condition $check_condition "; }elseif($DPISDB=="oci8"){ $search_condition = str_replace(" where ", " and ", $search_condition); $cmd = " select count(a.PER_ID) as count_data from PER_PERSONAL a, PER_POSITION c, PER_POS_EMP d, PER_POS_EMPSER e, PER_POS_TEMP g, PER_NAMEHIS h where $search_con(+) and a.POEM_ID=d.POEM_ID(+) and a.POEMS_ID=e.POEMS_ID(+) and a.POT_ID=g.POT_ID(+) and a.PER_ID=h.PER_ID(+) $search_condition $check_condition "; }elseif($DPISDB=="mysql"){ $cmd = " select count(a.PER_ID) as count_data from (((( PER_PERSONAL a left join PER_POSITION c on ($search_con) ) left join PER_POS_EMP d on (a.POEM_ID=d.POEM_ID) ) left join PER_POS_EMPSER e on (a.POEMS_ID=e.POEMS_ID) ) left join PER_POS_TEMP g on (a.POT_ID=g.POT_ID) ) left join PER_NAMEHIS h on (a.PER_ID=h.PER_ID) $search_condition $check_condition "; } // end if } // end if $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]; // if(isset($countNOPIC)){ $count_data = $countNOPIC; } // echo "$cmd ($count_data)
"; // เกี่ยวกับรูปภาพ if ($count_data > 0) { if ($search_data==11 || $search_data==13) { // กรณีค้นหา ไม่มีรูปภาพ หรือ ไม่มีลายเซ็น $cmd1 = str_replace("count(a.PER_ID) as count_data","a.PER_ID",$cmd); // echo "$cmd1
"; $db_dpis1->send_cmd($cmd1); $arr_per_id = $arr_per_id2 = $arr_per_id3 = $arr_per_id4 = $arr_per_id5 = $arr_per_id6 = (array) null; // select per_id not in $arr_per_id $cnt_deduct = $count = 0; while ($data1 = $db_dpis1->get_array()) { $TMP_PER_ID = $data1[PER_ID]; // echo "TMP_PER_ID=$TMP_PER_ID
"; if ($TMP_PER_ID) { if ($search_data==11) { // รูปภาพ $cmd2 = " select * from PER_PERSONALPIC where PER_ID=$TMP_PER_ID and PIC_SHOW=1 and (PIC_SIGN <> 1 or PIC_SIGN is NULL) order by PER_ID, PER_PICSEQ "; } else { // รูปลายเซ็น $search_data==13 $cmd2 = " select * from PER_PERSONALPIC where PER_ID=$TMP_PER_ID and PIC_SHOW=1 and PIC_SIGN = 1 order by PER_ID, PER_PICSEQ "; } $db_dpis2->send_cmd($cmd2); // echo "cmd2=$cmd2
"; $founded = false; while ($data2 = $db_dpis2->get_array()) { $TMP_PIC_SEQ = $data2[PER_PICSEQ]; // echo "CARD=".$data2[PER_CARDNO]."-".$TMP_PIC_SEQ."
"; $current_list .= ((trim($current_list))?",":"") . $TMP_PIC_SEQ; $T_PIC_SEQ = substr("000",0,3-strlen("$TMP_PIC_SEQ"))."$TMP_PIC_SEQ"; $TMP_SERVER = $data2[PIC_SERVER_ID]; $TMP_PIC_SIGN= $data2[PIC_SIGN]; if ($TMP_SERVER) { $cmd3 = " SELECT * FROM OTH_SERVER WHERE SERVER_ID=$TMP_SERVER "; $db_dpis3->send_cmd($cmd3); $data3 = $db_dpis3->get_array(); $tmp_SERVER_NAME = trim($data3[SERVER_NAME]); $tmp_ftp_server = trim($data3[FTP_SERVER]); $tmp_ftp_username = trim($data3[FTP_USERNAME]); $tmp_ftp_password = trim($data3[FTP_PASSWORD]); $tmp_main_path = trim($data3[MAIN_PATH]); $tmp_http_server = trim($data3[HTTP_SERVER]); } else { $TMP_SERVER = 0; $tmp_SERVER_NAME = ""; $tmp_ftp_server = ""; $tmp_ftp_username = ""; $tmp_ftp_password = ""; $tmp_main_path = ""; $tmp_http_server = ""; } $SIGN_NAME = ""; if($TMP_PIC_SIGN==1){ $SIGN_NAME = "SIGN"; } if (trim($data2[PER_CARDNO]) && trim($data2[PER_CARDNO]) != "NULL") { $TMP_PIC_NAME = $data2[PER_PICPATH].$data2[PER_CARDNO]."-".$SIGN_NAME.$T_PIC_SEQ.".jpg".($tmp_SERVER_NAME ? " [".$tmp_SERVER_NAME."]" : ""); $TMP_SHOW_PIC = ($tmp_http_server ? $tmp_http_server."/" : "").$data2[PER_PICPATH].$data2[PER_CARDNO]."-".$SIGN_NAME.$T_PIC_SEQ.".jpg"; } else { $TMP_PIC_NAME = $data2[PER_PICPATH].$data2[PER_GENNAME]."-".$SIGN_NAME.$T_PIC_SEQ.".jpg".($tmp_SERVER_NAME ? " [".$tmp_SERVER_NAME."]" : ""); $TMP_SHOW_PIC = ($tmp_http_server ? $tmp_http_server."/" : "").$data2[PER_PICPATH].$data2[PER_CARDNO]."-".$SIGN_NAME.$T_PIC_SEQ.".jpg"; } if (file_exists($TMP_SHOW_PIC)) { // echo "$TMP_SHOW_PIC exist
"; // $arr_per_id[] = $TMP_PER_ID; $founded = true; break; // } else { // echo "$TMP_SHOW_PIC not exist
"; // $cnt_deduct++; } } // end while ($data2 = $db_dpis2->get_array()) if ($founded) { // echo "$TMP_PER_ID-$TMP_SHOW_PIC exist
"; $count++; if ($count < 1000) $arr_per_id[] = $TMP_PER_ID; elseif ($count < 2000) $arr_per_id2[] = $TMP_PER_ID; elseif ($count < 3000) $arr_per_id3[] = $TMP_PER_ID; elseif ($count < 4000) $arr_per_id4[] = $TMP_PER_ID; elseif ($count < 5000) $arr_per_id5[] = $TMP_PER_ID; else $arr_per_id6[] = $TMP_PER_ID; } else { // echo "$TMP_PER_ID-$TMP_SHOW_PIC not exist
"; // $cnt_deduct++; } } } // end while if (count($arr_per_id) > 0) { if (count($arr_per_id6)) $check_condition = " and (a.PER_ID not in (". implode(",", $arr_per_id) .")) and (a.PER_ID not in (". implode(",", $arr_per_id2) .")) and (a.PER_ID not in (". implode(",", $arr_per_id3) .")) and (a.PER_ID not in (". implode(",", $arr_per_id4) .")) and (a.PER_ID not in (". implode(",", $arr_per_id5) .")) and (a.PER_ID not in (". implode(",", $arr_per_id6) ."))"; elseif (count($arr_per_id5)) $check_condition = " and (a.PER_ID not in (". implode(",", $arr_per_id) .")) and (a.PER_ID not in (". implode(",", $arr_per_id2) .")) and (a.PER_ID not in (". implode(",", $arr_per_id3) .")) and (a.PER_ID not in (". implode(",", $arr_per_id4) .")) and (a.PER_ID not in (". implode(",", $arr_per_id5) ."))"; elseif (count($arr_per_id4)) $check_condition = " and (a.PER_ID not in (". implode(",", $arr_per_id) .")) and (a.PER_ID not in (". implode(",", $arr_per_id2) .")) and (a.PER_ID not in (". implode(",", $arr_per_id3) .")) and (a.PER_ID not in (". implode(",", $arr_per_id4) ."))"; elseif (count($arr_per_id3)) $check_condition = " and (a.PER_ID not in (". implode(",", $arr_per_id) .")) and (a.PER_ID not in (". implode(",", $arr_per_id2) .")) and (a.PER_ID not in (". implode(",", $arr_per_id3) ."))"; elseif (count($arr_per_id2)) $check_condition = " and (a.PER_ID not in (". implode(",", $arr_per_id) .")) and (a.PER_ID not in (". implode(",", $arr_per_id2) ."))"; else $check_condition = " and (a.PER_ID not in (".implode(",",$arr_per_id).")) "; $count_data -= count($arr_per_id)+count($arr_per_id2)+count($arr_per_id3)+count($arr_per_id4)+count($arr_per_id5)+count($arr_per_id6); } // $count_data -= $cnt_deduct; } // end if ($search_data==11 || $search_data==13) } // end if ($count_data > 0) // จบ เกี่ยวกับรูปภาพ $total_page = ceil( $count_data / $data_per_page ); $page_link = create_link_page($total_page, $current_page); $limit_data = ""; } // end if $command == "SEARCH" || $command == "SEARCHNAMEHIS" || $command == "SEARCHPAY" // echo "6.command=$command LEVEL_NO=$LEVEL_NO
"; $PAGE_AUTH["del"] = "N"; /*pitak*/ ?> <?=$webpage_title?> - <?=$MENU_TITLE_LV0?><?if($MENU_ID_LV1){?> - <?=$MENU_TITLE_LV1?><?}?><?if($MENU_ID_LV2){?> - <?=$MENU_TITLE_LV2?><?}?><?if($MENU_ID_LV3){?> - <?=$MENU_TITLE_LV3?><?}?>
"> ข้อมูล ">
;">
send_cmd($cmd); if($count>0){ if($SEARCHHIS){ $disFlg=1; } ?>
 :   : 
 :   : 
 :   : 
 :   : 
onClick="form0.search_org_id.value='';form0.search_org_name.value='';form0.search_org_id_1.value='';form0.search_org_name_1.value='';" >  onClick="form0.search_org_id.value='';form0.search_org_name.value='';form0.search_org_id_1.value='';form0.search_org_name_1.value='';" >
 :   : 
 :   : 
 :  > >  :   : 
 :     :   
เลือกดู :   : 
 :  ตรวจสอบข้อมูล : 
  ตรวจสอบประวัติที่ยังป้อนข้อมูลไม่ครบถ้วนซึ่งจะมีผลในการจัดทำรายงานทำให้จำนวนข้อมูลที่แสดงไม่ถูกต้อง
<?=$CLEAR_TITLE?>
"; if($current_page > 1){ if($DPISDB=="odbc"){ if($command == "SEARCH") { $cmd = " select top $start_record trim(a.PER_ID) as concat_pk from ( ( ( ( ( PER_PERSONAL a left join PER_POSITION c on ($search_con) ) left join PER_POS_EMP d on (a.POEM_ID=d.POEM_ID) ) left join PER_POS_EMPSER e on (a.POEMS_ID=e.POEMS_ID) ) left join PER_LEVEL f on (a.LEVEL_NO=f.LEVEL_NO) ) left join PER_POS_TEMP g on (a.POT_ID=g.POT_ID) ) left join PER_ORG i on (c.ORG_ID=i.ORG_ID) $search_condition $check_condition order by $order_str "; } elseif($command == "SEARCHNAMEHIS") { $cmd = " select top $start_record trim(a.PER_ID) as concat_pk from ( ( ( ( ( ( PER_PERSONAL a left join PER_POSITION c on ($search_con) ) left join PER_POS_EMP d on (a.POEM_ID=d.POEM_ID) ) left join PER_POS_EMPSER e on (a.POEMS_ID=e.POEMS_ID) ) left join PER_LEVEL f on (a.LEVEL_NO=f.LEVEL_NO) ) left join PER_POS_TEMP g on (a.POT_ID=g.POT_ID) ) left join PER_NAMEHIS h on (a.PER_ID=h.PER_ID) ) left join PER_ORG i on (c.ORG_ID=i.ORG_ID) $search_condition $check_condition order by $order_str "; } $db_dpis->send_cmd($cmd); while($data = $db_dpis->get_array()) $arr_exclude[] = $data[concat_pk]; $limit_data = (trim($search_condition)?" and ":" where ")." trim(a.PER_ID) not in (". implode(", ", $arr_exclude) .")"; }elseif($DPISDB=="mysql"){ $limit_data = " limit " . (($current_page - 1) * $data_per_page) . ", " . $data_per_page; } } // end if if($command == "SEARCH") { if($DPISDB=="odbc"){ $cmd = " select top $data_per_page a.PER_ID, a.PN_CODE, PER_NAME, PER_SURNAME, a.POS_ID, a.POEM_ID, a.POEMS_ID, a.POT_ID, a.LEVEL_NO, a.PER_TYPE, a.PER_STATUS, ES_CODE, PL_NAME_WORK, ORG_NAME_WORK, PAY_ID, a.PER_CARDNO, a.DEPARTMENT_ID, a.ORG_ID, a.ORG_ID_1, a.ORG_ID_2, PER_SEQ_NO, PER_FILE_NO, a.DEPARTMENT_ID_ASS from ( ( ( ( ( PER_PERSONAL a left join PER_POSITION c on ($search_con) ) left join PER_POS_EMP d on (a.POEM_ID=d.POEM_ID) ) left join PER_POS_EMPSER e on (a.POEMS_ID=e.POEMS_ID) ) left join PER_LEVEL f on (a.LEVEL_NO=f.LEVEL_NO) ) left join PER_POS_TEMP g on (a.POT_ID=g.POT_ID) ) left join PER_ORG i on (c.ORG_ID=i.ORG_ID) $search_condition $check_condition $limit_data order by $order_str "; }elseif($DPISDB=="oci8"){ $search_condition = str_replace(" where ", " and ", $search_condition); $rec_start = (($current_page-1) * $data_per_page) + 1; $rec_end = ($current_page > 1)? ($current_page * $data_per_page) : $data_per_page; $cmd = "select * from ( select rownum rnum, q1.* from ( select a.PER_ID, a.PN_CODE, PER_NAME, PER_SURNAME, a.POS_ID, a.POEM_ID, a.POEMS_ID, a.POT_ID, a.LEVEL_NO, a.PER_TYPE, a.PER_STATUS, ES_CODE, PL_NAME_WORK, ORG_NAME_WORK, PAY_ID, a.PER_CARDNO, a.DEPARTMENT_ID, a.ORG_ID, a.ORG_ID_1, a.ORG_ID_3, a.ORG_ID_4, a.ORG_ID_5,a.ORG_ID_2, PER_SEQ_NO, PER_FILE_NO, a.DEPARTMENT_ID_ASS from PER_PERSONAL a, PER_POSITION c, PER_POS_EMP d, PER_POS_EMPSER e, PER_LEVEL f, PER_POS_TEMP g, PER_ORG i where $search_con(+) and a.POEM_ID=d.POEM_ID(+) and a.POEMS_ID=e.POEMS_ID(+) and a.LEVEL_NO=f.LEVEL_NO(+) and a.POT_ID=g.POT_ID(+) and c.ORG_ID=i.ORG_ID(+) $search_condition $check_condition order by $order_str ) q1 ) where rnum between $rec_start and $rec_end "; }elseif($DPISDB=="mysql"){ $cmd = " select a.PER_ID, a.PN_CODE, PER_NAME, PER_SURNAME, a.POS_ID, a.POEM_ID, a.POEMS_ID, a.POT_ID, a.LEVEL_NO, a.PER_TYPE, a.PER_STATUS, ES_CODE, PL_NAME_WORK, ORG_NAME_WORK, PAY_ID, a.PER_CARDNO, a.DEPARTMENT_ID, a.ORG_ID, a.ORG_ID_1, a.ORG_ID_2, PER_SEQ_NO, PER_FILE_NO, a.DEPARTMENT_ID_ASS from ( ( ( ( ( PER_PERSONAL a left join PER_POSITION c on ($search_con) ) left join PER_POS_EMP d on (a.POEM_ID=d.POEM_ID) ) left join PER_POS_EMPSER e on (a.POEMS_ID=e.POEMS_ID) ) left join PER_LEVEL f on (a.LEVEL_NO=f.LEVEL_NO) ) left join PER_POS_TEMP g on (a.POT_ID=g.POT_ID) ) left join PER_ORG i on (c.ORG_ID=i.ORG_ID) $search_condition $check_condition order by $order_str $limit_data "; } // end if } elseif($command == "SEARCHNAMEHIS") { if($DPISDB=="odbc"){ $cmd = " select top $data_per_page a.PER_ID, a.PN_CODE, PER_NAME, PER_SURNAME, NH_NAME, NH_SURNAME, a.POS_ID, a.POEM_ID, a.POEMS_ID, a.POT_ID, a.LEVEL_NO, a.PER_TYPE, a.PER_STATUS, ES_CODE, PL_NAME_WORK, ORG_NAME_WORK, PAY_ID, a.PER_CARDNO, a.DEPARTMENT_ID, a.ORG_ID, a.ORG_ID_1, a.ORG_ID_2, PER_SEQ_NO, PER_FILE_NO, a.DEPARTMENT_ID_ASS from ( ( ( ( ( ( PER_PERSONAL a left join PER_POSITION c on ($search_con) ) left join PER_POS_EMP d on (a.POEM_ID=d.POEM_ID) ) left join PER_POS_EMPSER e on (a.POEMS_ID=e.POEMS_ID) ) left join PER_LEVEL f on (a.LEVEL_NO=f.LEVEL_NO) ) left join PER_POS_TEMP g on (a.POT_ID=g.POT_ID) ) left join PER_NAMEHIS h on (a.PER_ID=h.PER_ID) ) left join PER_ORG i on (c.ORG_ID=i.ORG_ID) $search_condition $check_condition $limit_data order by $order_str "; }elseif($DPISDB=="oci8"){ $search_condition = str_replace(" where ", " and ", $search_condition); $rec_start = (($current_page-1) * $data_per_page) + 1; $rec_end = ($current_page > 1)? ($current_page * $data_per_page) : $data_per_page; $cmd = "select * from ( select rownum rnum, q1.* from ( select a.PER_ID, a.PN_CODE, PER_NAME, PER_SURNAME, NH_NAME, NH_SURNAME, a.POS_ID, a.POEM_ID, a.POEMS_ID, a.POT_ID, a.LEVEL_NO, a.PER_TYPE, a.PER_STATUS, ES_CODE, PL_NAME_WORK, ORG_NAME_WORK, PAY_ID, a.PER_CARDNO, a.DEPARTMENT_ID, a.ORG_ID, a.ORG_ID_1, a.ORG_ID_2, a.ORG_ID_3, a.ORG_ID_4, a.ORG_ID_5,PER_SEQ_NO, PER_FILE_NO, a.DEPARTMENT_ID_ASS from PER_PERSONAL a, PER_POSITION c, PER_POS_EMP d, PER_POS_EMPSER e, PER_LEVEL f, PER_POS_TEMP g, PER_NAMEHIS h, PER_ORG i where $search_con(+) and a.POEM_ID=d.POEM_ID(+) and a.POEMS_ID=e.POEMS_ID(+) and a.LEVEL_NO=f.LEVEL_NO(+) and a.POT_ID=g.POT_ID(+) and a.PER_ID=h.PER_ID(+) and c.ORG_ID = i.ORG_ID(+) $search_condition $check_condition order by $order_str ) q1 ) where rnum between $rec_start and $rec_end "; }elseif($DPISDB=="mysql"){ $cmd = " select a.PER_ID, a.PN_CODE, PER_NAME, PER_SURNAME, NH_NAME, NH_SURNAME, a.POS_ID, a.POEM_ID, a.POEMS_ID, a.POT_ID, a.LEVEL_NO, a.PER_TYPE, a.PER_STATUS, ES_CODE, PL_NAME_WORK, ORG_NAME_WORK, PAY_ID, a.PER_CARDNO, a.DEPARTMENT_ID, a.ORG_ID, a.ORG_ID_1, a.ORG_ID_2, PER_SEQ_NO, PER_FILE_NO, a.DEPARTMENT_ID_ASS from ( ( ( ( ( ( PER_PERSONAL a left join PER_POSITION c on ($search_con) ) left join PER_POS_EMP d on (a.POEM_ID=d.POEM_ID) ) left join PER_POS_EMPSER e on (a.POEMS_ID=e.POEMS_ID) ) left join PER_LEVEL f on (a.LEVEL_NO=f.LEVEL_NO) ) left join PER_POS_TEMP g on (a.POT_ID=g.POT_ID) ) left join PER_NAMEHIS h on (a.PER_ID=h.PER_ID) ) left join PER_ORG i on (c.ORG_ID=i.ORG_ID) $search_condition $check_condition order by $order_str $limit_data "; } // end if } // end if // echo '
'.$cmd;
	$count_page_data = $db_dpis->send_cmd($cmd);
//echo "
".$cmd;
//	echo "$command ::: $cmd ($count_page_data)
"; // $db_dpis->show_error(); // echo "7.command=$command LEVEL_NO=$LEVEL_NO
"; ?> ตามมอบหมายงาน"; }else{ $SORT_TITLE5=$ORG_TITLE; $SORT_TITLE6="$ORG_TITLE
ตามมอบหมายงาน"; } ?> get_array()) { $show_data = 0; if ($TMP_PER_ID != $data[PER_ID]) { $TMP_PER_ID = $data[PER_ID]; $show_data = 1; } if ($show_data==1) { $num_order++; $data_count++; if($data_count > $data_per_page) break; // echo "**PER_ID=$PER_ID, TMP_PER_ID=$TMP_PER_ID, temp_PER_ID=$temp_PER_ID
"; $temp_PER_ID = trim($data[PER_ID]); if ($SESS_DEPARTMENT_NAME=="กรมวิชาการเกษตร") $TMP_SEQ_NO = $data[PER_FILE_NO]; else $TMP_SEQ_NO = $data[PER_SEQ_NO]; $TMP_PER_TYPE = trim($data[PER_TYPE]); $TMP_LEVEL_NO = trim($data[LEVEL_NO]); $PER_NAME_SHOW = trim($data[PER_NAME]); $PER_SURNAME_SHOW = trim($data[PER_SURNAME]); $NH_NAME = trim($data[NH_NAME]); $NH_SURNAME = trim($data[NH_SURNAME]); $old_name = "($NH_NAME $NH_SURNAME)"; $FULLNAME = "$PER_NAME_SHOW $PER_SURNAME_SHOW".$old_name; $TMP_ES_CODE = trim($data[ES_CODE]); $TMP_PL_NAME_WORK = trim($data[PL_NAME_WORK]); $TMP_ORG_NAME_WORK = trim($data[ORG_NAME_WORK]); $TMP_DEPARTMENT_ID = trim($data[DEPARTMENT_ID]); $TMP_DEPARTMENT_ASS_ID = trim($data[DEPARTMENT_ID_ASS]); $TMP_ORG_ASS_ID = trim($data[ORG_ID]); $TMP_ORG_ASS_ID_1 = trim($data[ORG_ID_1]); $TMP_ORG_ASS_ID_2 = trim($data[ORG_ID_2]); $TMP_ORG_ASS_ID_3 = trim($data[ORG_ID_3]); $TMP_ORG_ASS_ID_4 = trim($data[ORG_ID_4]); $TMP_ORG_ASS_ID_5 = trim($data[ORG_ID_5]); $TMP_PN_NAME = $TMP_PN_SHORTNAME = ""; $TMP_PN_CODE = trim($data[PN_CODE]); if ($TMP_PN_CODE) { $cmd = " select PN_NAME, PN_SHORTNAME from PER_PRENAME where PN_CODE='$TMP_PN_CODE'"; $db_dpis2->send_cmd($cmd); $data2 = $db_dpis2->get_array(); $TMP_PN_NAME = $data2[PN_NAME]; $TMP_PN_SHORTNAME = $data2[PN_SHORTNAME]; } $cmd = " select POSITION_LEVEL from PER_LEVEL where LEVEL_NO='$TMP_LEVEL_NO' "; $db_dpis2->send_cmd($cmd); $data2 = $db_dpis2->get_array(); $TMP_LEVEL_NAME = $data2[POSITION_LEVEL]; $TMP_PER_TYPE = $data[PER_TYPE]; $TMP_PER_STATUS = $data[PER_STATUS]; $TMP_POSEM_NO = $TMP_ORG_NAME = $TMP_PL_NAME = $TMP_PM_NAME = $TMP_PAY_NO = ""; if ($TMP_PER_TYPE == 1 || $TMP_PER_TYPE == 5) { if ($command == "SEARCHPAY") { $TMP_POS_ID = $data[PAY_ID]; if ($TMP_POS_ID) { $cmd = " select POS_NO_NAME, POS_NO, pl.PL_NAME, po.ORG_NAME, pp.PT_CODE, po.ORG_ID, pp.PM_CODE, pp.ORG_ID_1, pp.ORG_ID_2 from PER_POSITION pp, PER_LINE pl, PER_ORG po where pp.POS_ID=$TMP_POS_ID and pp.ORG_ID=po.ORG_ID and pp.PL_CODE=pl.PL_CODE "; $db_dpis2->send_cmd($cmd); $data2 = $db_dpis2->get_array(); $TMP_POSEM_NO = $data2[POS_NO_NAME].' '.$data2[POS_NO]; $TMP_PL_NAME = $data2[PL_NAME]; $TMP_PT_CODE = trim($data2[PT_CODE]); $TMP_PT_NAME = trim($data2[PT_NAME]); $TMP_PM_CODE = trim($data2[PM_CODE]); $TMP_ORG_NAME = trim($data2[ORG_NAME]); $TMP_ORG_ID_1 = trim($data2[ORG_ID_1]); $TMP_ORG_ID_2 = trim($data2[ORG_ID_2]); $cmd = " select PM_NAME from PER_MGT where PM_CODE='$TMP_PM_CODE' "; $db_dpis2->send_cmd($cmd); $data2 = $db_dpis2->get_array(); $TMP_PM_NAME = trim($data2[PM_NAME]); if ($SESS_DEPARTMENT_NAME=="กรมการปกครอง" && !$TMP_PM_NAME) $TMP_PM_NAME = $TMP_PL_NAME; } $TMP_PAY_ID = $data[POS_ID]; if ($TMP_PAY_ID) { $cmd = " select POS_NO_NAME, POS_NO, po.ORG_NAME from PER_POSITION pp, PER_ORG po where pp.POS_ID=$TMP_PAY_ID and pp.ORG_ID=po.ORG_ID "; if($SESS_ORG_STRUCTURE==1){ $cmd = str_replace("PER_ORG","PER_ORG_ASS",$cmd); } $db_dpis2->send_cmd($cmd); $data2 = $db_dpis2->get_array(); $TMP_PAY_NO = $data2[POS_NO_NAME] . $data2[POS_NO] . " " . $data2[ORG_NAME]; } } else { $TMP_POS_ID = $data[POS_ID]; //echo "hhhhh =>".$TMP_POS_ID."
"; if ($TMP_POS_ID) { $cmd = " select POS_NO_NAME, POS_NO, pl.PL_NAME, po.ORG_NAME, pp.PT_CODE, po.ORG_ID, pp.PM_CODE, pp.ORG_ID_1, pp.ORG_ID_2,pp.ORG_ID_3,pp.ORG_ID_4,pp.ORG_ID_5 from PER_POSITION pp, PER_LINE pl, PER_ORG po where pp.POS_ID=$TMP_POS_ID and pp.ORG_ID=po.ORG_ID and pp.PL_CODE=pl.PL_CODE "; $db_dpis2->send_cmd($cmd); $data2 = $db_dpis2->get_array(); // echo "
".$cmd;
					$TMP_POSEM_NO = $data2[POS_NO_NAME].' '.$data2[POS_NO];
					if ($MUNICIPALITY_FLAG==1) $TMP_POSEM_NO = pos_no_format($TMP_POSEM_NO,2);
					$TMP_PL_NAME = $data2[PL_NAME];
					$TMP_PT_CODE = trim($data2[PT_CODE]);
					$TMP_PT_NAME = trim($data2[PT_NAME]);
					$TMP_PM_CODE = trim($data2[PM_CODE]);
					$TMP_ORG_NAME = trim($data2[ORG_NAME]);
					$TMP_ORG_ID_1 = trim($data2[ORG_ID_1]);
					$TMP_ORG_ID_2 = trim($data2[ORG_ID_2]);
                    $TMP_ORG_ID_3 = trim($data2[ORG_ID_3]);
                    $TMP_ORG_ID_4 = trim($data2[ORG_ID_4]);
                    $TMP_ORG_ID_5 = trim($data2[ORG_ID_5]);
					$cmd = " 	select PM_NAME from PER_MGT	where PM_CODE='$TMP_PM_CODE'  ";
					$db_dpis2->send_cmd($cmd);
					$data2 = $db_dpis2->get_array();
					$TMP_PM_NAME = trim($data2[PM_NAME]);
                                        //echo "=> ".$TMP_PM_NAME;
					if ($SESS_DEPARTMENT_NAME=="กรมการปกครอง" && !$TMP_PM_NAME) $TMP_PM_NAME = $TMP_PL_NAME;
				}
                
				$TMP_PAY_ID = $data[PAY_ID];
				if ($TMP_PAY_ID) {
					$cmd = " 	select		POS_NO_NAME, POS_NO, po.ORG_NAME
										from		PER_POSITION pp, PER_ORG po
										where		pp.POS_ID=$TMP_PAY_ID and pp.ORG_ID=po.ORG_ID ";
					if($SESS_ORG_STRUCTURE==1){	$cmd = str_replace("PER_ORG","PER_ORG_ASS",$cmd); 	}
					$db_dpis2->send_cmd($cmd);
					$data2 = $db_dpis2->get_array();
					$TMP_PAY_NO = $data2[POS_NO_NAME] . $data2[POS_NO] . " " . $data2[ORG_NAME];
				}
			}
		} elseif ($TMP_PER_TYPE == 2) {
			$TMP_POEM_ID = $data[POEM_ID];
			if ($TMP_POEM_ID) {
				$cmd = " 	select		POEM_NO_NAME, POEM_NO, pl.PN_NAME, po.ORG_NAME, po.ORG_ID, pp.ORG_ID_1, pp.ORG_ID_2, pp.ORG_ID_3, pp.ORG_ID_4, pp.ORG_ID_5, pl.PG_CODE   
								from			PER_POS_EMP pp, PER_POS_NAME pl, PER_ORG po 
								where		pp.POEM_ID=$TMP_POEM_ID and pp.ORG_ID=po.ORG_ID and pp.PN_CODE=pl.PN_CODE  ";
								
				$db_dpis2->send_cmd($cmd);
				$data2 = $db_dpis2->get_array();
				$TMP_POSEM_NO = trim($data2[POEM_NO_NAME]).trim($data2[POEM_NO]);
				$TMP_PL_NAME = trim($data2[PN_NAME]);
				$TMP_PG_CODE = trim($data2[PG_CODE]);
				$TMP_ORG_NAME = trim($data2[ORG_NAME]);
				$TMP_ORG_ID_1 = trim($data2[ORG_ID_1]);
				$TMP_ORG_ID_2 = trim($data2[ORG_ID_2]);
                $TMP_ORG_ID_3 = trim($data2[ORG_ID_3]);
                $TMP_ORG_ID_4 = trim($data2[ORG_ID_4]);
                $TMP_ORG_ID_5 = trim($data2[ORG_ID_5]);

				$cmd = " 	select PG_NAME from PER_POS_GROUP where trim(PG_CODE)='$TMP_PG_CODE'  ";
				$db_dpis2->send_cmd($cmd);
				$data2 = $db_dpis2->get_array();
				$TMP_PM_NAME = trim($data2[PG_NAME]);
			}
		} elseif ($TMP_PER_TYPE == 3) {
			$TMP_POEMS_ID = $data[POEMS_ID];
			if ($TMP_POEMS_ID) {
				$cmd = " 	select		POEMS_NO, pl.EP_NAME, po.ORG_NAME, po.ORG_ID, pp.ORG_ID_1, pp.ORG_ID_2, pp.ORG_ID_3, pp.ORG_ID_4, pp.ORG_ID_5, le.LEVEL_NAME  
						from			PER_POS_EMPSER pp, PER_EMPSER_POS_NAME pl, PER_ORG po, PER_LEVEL le
						where		pp.POEMS_ID=$TMP_POEMS_ID and pp.ORG_ID=po.ORG_ID and pp.EP_CODE=pl.EP_CODE  and pl.LEVEL_NO = le.LEVEL_NO";
				$db_dpis2->send_cmd($cmd);
				$data2 = $db_dpis2->get_array();
				$TMP_POSEM_NO = trim($data2[POEMS_NO]);
				$TMP_PL_NAME = trim($data2[EP_NAME]);
				$TMP_PM_NAME = trim($data2[LEVEL_NAME]);
				$TMP_ORG_NAME = trim($data2[ORG_NAME]);
				$TMP_ORG_ID_1 = trim($data2[ORG_ID_1]);
				$TMP_ORG_ID_2 = trim($data2[ORG_ID_2]);
                $TMP_ORG_ID_3 = trim($data2[ORG_ID_3]);
                $TMP_ORG_ID_4 = trim($data2[ORG_ID_4]);
                $TMP_ORG_ID_5 = trim($data2[ORG_ID_5]);
			}
		} elseif ($TMP_PER_TYPE == 4) {
			$TMP_POT_ID = $data[POT_ID];
			if ($TMP_POT_ID) {
				$cmd = " 	select		POT_NO, pl.TP_NAME, po.ORG_NAME, po.ORG_ID, pp.ORG_ID_1, pp.ORG_ID_2, pp.ORG_ID_3, pp.ORG_ID_4, pp.ORG_ID_5   
								from			PER_POS_TEMP pp, PER_TEMP_POS_NAME pl, PER_ORG po 
								where		pp.POT_ID=$TMP_POT_ID and pp.ORG_ID=po.ORG_ID and pp.TP_CODE=pl.TP_CODE  ";
				$db_dpis2->send_cmd($cmd);
				$data2 = $db_dpis2->get_array();
				$TMP_POSEM_NO = trim($data2[POT_NO]);
				$TMP_PL_NAME = trim($data2[TP_NAME]);
				$TMP_ORG_NAME = trim($data2[ORG_NAME]);
				$TMP_ORG_ID_1 = trim($data2[ORG_ID_1]);
				$TMP_ORG_ID_2 = trim($data2[ORG_ID_2]);
                $TMP_ORG_ID_3 = trim($data2[ORG_ID_3]);
                $TMP_ORG_ID_4 = trim($data2[ORG_ID_4]);
                $TMP_ORG_ID_5 = trim($data2[ORG_ID_5]);
			}
		}
		if ($TMP_ORG_NAME=="-") $TMP_ORG_NAME = "";
		$TMP_ORG_NAME_1 = $TMP_ORG_NAME_2 = $TMP_ORG_NAME_3 = $TMP_ORG_NAME_4 = $TMP_ORG_NAME_5 = "";
		$MINISTRY_ID_REF = "";
		$TMP_MINISTRY_NAME = "";
		$cmd = " select ORG_ID_REF, ORG_NAME from PER_ORG where ORG_ID=$TMP_DEPARTMENT_ID ";
		$db_dpis2->send_cmd($cmd);
		$data2 = $db_dpis2->get_array();
		$MINISTRY_ID_REF = $data2[ORG_ID_REF];
		$DEPARTMENT_NAME_REF = $data2[ORG_NAME];			//กรม
		
		if ($MINISTRY_ID_REF) {
			$cmd = " select ORG_NAME from PER_ORG where ORG_ID=$MINISTRY_ID_REF ";
			$db_dpis2->send_cmd($cmd);
			$data2 = $db_dpis2->get_array();
			$TMP_MINISTRY_NAME = $data2[ORG_NAME];
		}
           

		if ($TMP_ORG_ID_1) {
			$cmd = " select ORG_NAME from PER_ORG where ORG_ID=$TMP_ORG_ID_1 ";
			$db_dpis2->send_cmd($cmd);
			$data2 = $db_dpis2->get_array();
			$TMP_ORG_NAME_1 = trim($data2[ORG_NAME]);
			if ($data2[ORG_NAME]=="โรงเรียน") {
				if ($TMP_ORG_ID_2) {
					$cmd = " select ORG_NAME from PER_ORG where ORG_ID=$TMP_ORG_ID_2 ";
					//if($SESS_ORG_STRUCTURE==1){	$cmd = str_replace("PER_ORG","PER_ORG_ASS",$cmd); 	}
					$db_dpis2->send_cmd($cmd);
					$data2 = $db_dpis2->get_array();
				}
			} 
              $TMP_ORG_NAME_1 = $TMP_ORG_NAME_2 = $TMP_ORG_NAME_4 = $TMP_ORG_NAME_5 = "";
              if($TMP_ORG_ID_1){
                     $cmd = " select ORG_NAME from PER_ORG where ORG_ID=$TMP_ORG_ID_1 ";
                     $db_dpis2->send_cmd($cmd);
                     $data2 = $db_dpis2->get_array();
                     $TMP_ORG_NAME_1 = $data2[ORG_NAME];
                }
                if($TMP_ORG_ID_2){
                     $cmd = " select ORG_NAME from PER_ORG where ORG_ID=$TMP_ORG_ID_2 ";
                     $db_dpis2->send_cmd($cmd);
                     $data2 = $db_dpis2->get_array();
                     $TMP_ORG_NAME_2 = $data2[ORG_NAME];
                }
                if($TMP_ORG_ID_3){
                     $cmd = " select ORG_NAME from PER_ORG where ORG_ID=$TMP_ORG_ID_3 ";
                     $db_dpis2->send_cmd($cmd);
                     $data2 = $db_dpis2->get_array();
                     $TMP_ORG_NAME_3 = $data2[ORG_NAME];
                }
                if($TMP_ORG_ID_4){
                     $cmd = " select ORG_NAME from PER_ORG where ORG_ID=$TMP_ORG_ID_4 ";
                     $db_dpis2->send_cmd($cmd);
                     $data2 = $db_dpis2->get_array();
                     $TMP_ORG_NAME_4 = $data2[ORG_NAME]; 
                }
                if($TMP_ORG_ID_5){
                     $cmd = " select ORG_NAME from PER_ORG where ORG_ID=$TMP_ORG_ID_5 ";
                     $db_dpis2->send_cmd($cmd);
                     $data2 = $db_dpis2->get_array();
                     $TMP_ORG_NAME_5 = $data2[ORG_NAME]; 
                }
             
            
			if ($data2[ORG_NAME]!="-") {
                //$TMP_ORG_NAME = $TMP_ORG_NAME . "
" . "  " . $TMP_ORG_NAME_1; //ของเดิม $space = ""; $space = " "; if($ORG_SETLEVEL == 2){ $TMP_ORG_NAME = $TMP_ORG_NAME.($TMP_ORG_NAME_1?"
".$space.$TMP_ORG_NAME_1:"").($TMP_ORG_NAME_2?"
".$space.$space.$TMP_ORG_NAME_2:""); } if($ORG_SETLEVEL == 3){ $TMP_ORG_NAME = $TMP_ORG_NAME.($TMP_ORG_NAME_1?"
".$space.$TMP_ORG_NAME_1:"").($TMP_ORG_NAME_2?"
".$space.$space.$TMP_ORG_NAME_2:"").($TMP_ORG_NAME_3?"
".$space.$space.$space.$TMP_ORG_NAME_3:""); } if($ORG_SETLEVEL == 4){ $TMP_ORG_NAME = $TMP_ORG_NAME.($TMP_ORG_NAME_1?"
".$space.$TMP_ORG_NAME_1:"").($TMP_ORG_NAME_2?"
".$space.$space.$TMP_ORG_NAME_2:"").($TMP_ORG_NAME_3?"
".$space.$space.$space.$TMP_ORG_NAME_3:"").($TMP_ORG_NAME_4?"
".$space.$space.$space.$space.$TMP_ORG_NAME_4:""); } if($ORG_SETLEVEL == 5){ $TMP_ORG_NAME = $TMP_ORG_NAME.($TMP_ORG_NAME_1?"
".$space.$TMP_ORG_NAME_1:"").($TMP_ORG_NAME_2?"
".$space.$space.$TMP_ORG_NAME_2:"").($TMP_ORG_NAME_3?"
".$space.$space.$space.$TMP_ORG_NAME_3:"").($TMP_ORG_NAME_4?"
".$space.$space.$space.$space.$TMP_ORG_NAME_4:"").($TMP_ORG_NAME_5?"
".$space.$space.$space.$space.$space.$TMP_ORG_NAME_5:""); } } } if ($TMP_PM_NAME=="ผู้ว่าราชการจังหวัด" || $TMP_PM_NAME=="รองผู้ว่าราชการจังหวัด" || $TMP_PM_NAME=="ปลัดจังหวัด" || $TMP_PM_NAME=="หัวหน้าสำนักงานจังหวัด") { $TMP_PM_NAME .= $TMP_ORG_NAME; $TMP_PM_NAME = str_replace("จังหวัดจังหวัด", "จังหวัด", $TMP_PM_NAME); $TMP_PM_NAME = str_replace("สำนักงานจังหวัดสำนักงานจังหวัด", "สำนักงานจังหวัด", $TMP_PM_NAME); } elseif ($TMP_PM_NAME=="นายอำเภอ") { $TMP_PM_NAME .= $TMP_ORG_NAME_1; $TMP_PM_NAME = str_replace("อำเภอที่ทำการปกครองอำเภอ", "อำเภอ", $TMP_PM_NAME); } //################################ //สำหรับมอบหมายงาน //################################ $TMP_DEPARTMENT_ASS_NAME = $TMP_ORG_ASS_NAME = $TMP_ORG_ASS_NAME_0 = $TMP_ORG_ASS_NAME_1 = $TMP_ORG_ASS_NAME_2 = $TMP_ORG_ASS_NAME_3 = $TMP_ORG_ASS_NAME_4 = $TMP_ORG_ASS_NAME_5=""; if ($TMP_DEPARTMENT_ASS_ID && $TMP_DEPARTMENT_ASS_ID != $TMP_DEPARTMENT_ID) { $cmd = " select ORG_NAME from PER_ORG_ASS where ORG_ID=$TMP_DEPARTMENT_ASS_ID "; $db_dpis2->send_cmd($cmd); $data2 = $db_dpis2->get_array(); $TMP_DEPARTMENT_ASS_NAME = $data2[ORG_NAME]; } if ($TMP_ORG_ASS_ID) { $cmd = " select ORG_NAME from PER_ORG_ASS where ORG_ID=$TMP_ORG_ASS_ID "; $db_dpis2->send_cmd($cmd); $data2 = $db_dpis2->get_array(); $TMP_ORG_ASS_NAME_0 = $data2[ORG_NAME]; if ($TMP_ORG_ASS_NAME_0=="-") $TMP_ORG_ASS_NAME_0 = ""; } if ($TMP_ORG_ASS_ID_1) { $cmd = " select ORG_NAME from PER_ORG_ASS where ORG_ID=$TMP_ORG_ASS_ID_1 "; $db_dpis2->send_cmd($cmd); $data2 = $db_dpis2->get_array(); " ".$TMP_ORG_ASS_NAME_1 = $data2[ORG_NAME]; } if ($TMP_ORG_ASS_ID_2) { $cmd = " select ORG_NAME from PER_ORG_ASS where ORG_ID=$TMP_ORG_ASS_ID_2 "; $db_dpis2->send_cmd($cmd); $data2 = $db_dpis2->get_array(); $TMP_ORG_ASS_NAME_2 = $data2[ORG_NAME]; } if ($TMP_ORG_ASS_ID_3) { $cmd = " select ORG_NAME from PER_ORG_ASS where ORG_ID=$TMP_ORG_ASS_ID_3 "; $db_dpis2->send_cmd($cmd); $data2 = $db_dpis2->get_array(); $TMP_ORG_ASS_NAME_3 = $data2[ORG_NAME]; } if ($TMP_ORG_ASS_ID_4) { $cmd = " select ORG_NAME from PER_ORG_ASS where ORG_ID=$TMP_ORG_ASS_ID_4 "; $db_dpis2->send_cmd($cmd); $data2 = $db_dpis2->get_array(); $TMP_ORG_ASS_NAME_4 = $data2[ORG_NAME]; } if ($TMP_ORG_ASS_ID_5) { $cmd = " select ORG_NAME from PER_ORG_ASS where ORG_ID=$TMP_ORG_ASS_ID_5 "; $db_dpis2->send_cmd($cmd); $data2 = $db_dpis2->get_array(); $TMP_ORG_ASS_NAME_5 = $data2[ORG_NAME]; } //$TMP_ORG_ASS_NAME = $TMP_ORG_ASS_NAME_0. "
" . " " . $TMP_ORG_ASS_NAME_1;//ของเดิม $space = ""; $space = " "; $TMP_ORG_ASS_NAME = $TMP_ORG_ASS_NAME_0; if($ORG_SETLEVEL == 2){ $TMP_ORG_ASS_NAME = $TMP_ORG_ASS_NAME_0.($TMP_ORG_ASS_NAME_1 ? "
".$space.$TMP_ORG_ASS_NAME_1:"").($TMP_ORG_ASS_NAME_2 ? "
".$space.$space.$TMP_ORG_ASS_NAME_2:""); } if($ORG_SETLEVEL == 3){ $TMP_ORG_ASS_NAME = $TMP_ORG_ASS_NAME_0.($TMP_ORG_ASS_NAME_1?"
".$space.$TMP_ORG_ASS_NAME_1:"").($TMP_ORG_ASS_NAME_2?"
".$space.$space.$TMP_ORG_ASS_NAME_2:"").($TMP_ORG_ASS_NAME_3?"
".$space.$space.$space.$TMP_ORG_ASS_NAME_3:""); } if($ORG_SETLEVEL == 4){ $TMP_ORG_ASS_NAME = $TMP_ORG_ASS_NAME_0.($TMP_ORG_ASS_NAME_1?"
".$space.$TMP_ORG_ASS_NAME_1:"").($TMP_ORG_ASS_NAME_2?"
".$space.$space.$TMP_ORG_ASS_NAME_2:"").($TMP_ORG_ASS_NAME_3?"
".$space.$space.$space.$TMP_ORG_ASS_NAME_3:"").($TMP_ORG_ASS_NAME_4?"
".$space.$space.$space.$space.$TMP_ORG_ASS_NAME_4:""); } if($ORG_SETLEVEL == 5){ $TMP_ORG_ASS_NAME = $TMP_ORG_ASS_NAME_0.($TMP_ORG_ASS_NAME_1?"
".$space.$TMP_ORG_ASS_NAME_1:"").($TMP_ORG_ASS_NAME_2?"
".$space.$space.$TMP_ORG_ASS_NAME_2:"").($TMP_ORG_ASS_NAME_3?"
".$space.$space.$space.$TMP_ORG_ASS_NAME_3:"").($TMP_ORG_ASS_NAME_4?"
".$space.$space.$space.$space.$TMP_ORG_ASS_NAME_4:"").($TMP_ORG_ASS_NAME_5?"
".$space.$space.$space.$space.$space.$TMP_ORG_ASS_NAME_5:""); } if($TMP_ORG_ASS_ID_1) $TMP_ORG_ASS_ID=$TMP_ORG_ASS_ID_1; if($TMP_ORG_ASS_ID_2) $TMP_ORG_ASS_ID=$TMP_ORG_ASS_ID_2; if(!$TMP_ORG_ASS_ID && !$TMP_ORG_ASS_ID_1 && !$TMP_ORG_ASS_ID_2) $TMP_ORG_ASS_NAME=""; if ($MFA_FLAG==1 && $TMP_ORG_ASS_NAME=="" && $TMP_DEPARTMENT_ASS_NAME) $TMP_ORG_ASS_NAME = $TMP_DEPARTMENT_ASS_NAME; /* if ($TMP_ES_CODE == "05" && $TMP_ORG_NAME_WORK) $ORG_NAME .= " (ช่วยราชการ $TMP_ORG_NAME_WORK)"; elseif ($TMP_ES_CODE == "06" && $TMP_ORG_NAME_WORK) $ORG_NAME .= " ($TMP_ORG_NAME_WORK)"; elseif (($TMP_ES_CODE == "03" || $TMP_ES_CODE == "04" || $TMP_ES_CODE == "07" || $TMP_ES_CODE == "09" || $TMP_ES_CODE == "26") && $TMP_PL_NAME_WORK) $TMP_PL_NAME .= " ($TMP_PL_NAME_WORK)"; */ $class = "table_body"; $onmouse_event = " onMouseOver=\"this.className='table_body_over';\" onMouseOut=\"this.className='table_body';\" "; // echo ">>PER_ID=$PER_ID, TMP_PER_ID=$TMP_PER_ID, temp_PER_ID=$temp_PER_ID
"; if($PER_ID==$temp_PER_ID){ $class = "table_body_over"; $onmouse_event = ""; } // end if // มันต่างกัน MENU_ID_LV2 แต่ละตัวนี้ $linkredirect =""; $curstyle=""; if(trim($SEARCHHIS_HIDE) || trim($SEARCHHIS)){ if(strtoupper($SEARCHHIS)=='PERSONAL_WORK_TIME' && $IS_OPEN_TIMEATT_ES=='OPEN'){$SEARCHHIS='es_personal_work_time';} $linkredirect="onClick=\"javascript:RedirectSite('$temp_PER_ID','$SEARCHHIS');\""; $curstyle="cursor:hand"; } if($TMP_PER_STATUS == 2){ //พ้นจากส่วนราชการ $TMP_POSEM_NO = ""; $TMP_PL_NAME = ""; if(trim($curstyle)) $curstyle .= ";"; $curstyle.="color:#FF0000"; } // end if if($ISCS_FLAG==1 && $TMP_PER_STATUS == 3){ //รอเลขที่คำสั่ง if(trim($curstyle)) $curstyle .= ";"; $curstyle.="color:#800080"; } // end if $EDIT_ALT = (trim($data[PER_FILE_NO]))?"$EDIT_TITLE ($FILE_NO_TITLE : $data[PER_FILE_NO])":$EDIT_TITLE; ?>
>
พบ ทั้งสิ้น รายการ
" style="text-align:right" onKeyPress="return NumOnly();" class="TextBox"> style="" nowrap="nowrap" >   style="" nowrap="nowrap">  style="">  style="">  style="">  style="">  style="">  style="" valign="top" width="20%">  style="" valign="top" width="20%"> 
style="" width="6%">  "><?=$DETAIL_TITLE?>  "><?=$EDIT_ALT; ?>  "><?=$DEL_TITLE.$menu_lv3_label;?>
1) : ?>
 
;"> send_cmd($cmd2); $data2 = $db_dpis->get_array(); $card_no=$data2[PER_CARDNO]; $c_duplicate=0; if($card_no){ $c_duplicate=1; $err_text = "เลขประจำตัวประชาชนซ้ำ $PER_CARDNO"; } } //end if ?>

 *  :   *  : 
 *  : 
  ตำแหน่งปัจจุบัน
send_cmd($cmd); $re = $db_dpis1->get_array(); $re_EP_NAME = $re[EP_NAME]. " อัตราค่าจ้าง ".number_format($re[POEM_MIN_SALARY])." - ".number_format($re[POEM_MAX_SALARY]); ?>
 *  :     : 
 *  :  >  ดำรงตำแหน่งบริหารที่กำหนดเป็นการภายใน
หน่วยงานตามโครงสร้างการมอบหมายงาน ตำแหน่ง :  >
 :   : 
 :   : 
 :   : 
 : 
 :  เงินตอบแทนบุคคล : 
 :   : 
 :   : 
หมวด :  กลุ่มบัญชีค่าจ้าง :   :   : 
 :   : 
 :   : 
 :   : 
 :      :    
 :    
 :   : 
 :   : 
  ช่วยราชการ / ปฏิบัติหน้าที่
 :  >
  ข้อมูล
"; ?>
 *  (ไทย) :  $value){ if(trim($value)){ ?> > ชาย     > หญิง
"; $fp = @fopen($http_server."/".$img_file, "r"); if ($fp !== false) $img_file = $http_server."/".$img_file; else $img_file = "images/my_preview.gif"; fclose($fp); } else { // echo "2.".$img_file."
"; $img_file = file_exists($img_file)?($img_file):"images/my_preview.gif"; } // echo "$img_file
"; ?>
 *  (ไทย) :  >      *  (ไทย) :  >
(อังกฤษ) :                       :  >
(อังกฤษ) :  >     (อังกฤษ) :  >
 *  :   
 *  :   
 :  > >  
 :  >  
 : 
 *  :  "รอบรรจุ",1=>"ปกติ",2=>"$RETIRE_TITLE"); if ($ISCS_FLAG==1){ $ARR_PER_STATUS[3]="รอเลขที่ตำแหน่ง"; } ?>  * สถานภาพทางกาย :  "ปกติ", 2=>"พิการ", 3=>"พิการทางการมองเห็น", 4=>"พิการทางการได้ยินและสื่อความหมาย", 5=>"พิการทางการเคลื่อนไหวหรือทางร่างกาย" , 6=>"พิการทางจิตใจหรือพฤติกรรม" , 7=>"พิการทางสติปัญญา" , 8=>"พิการทางการเรียนรู้" , 9=>"พิการทางออทิสติก"); ?>
 *  :  >  : 
สถานที่เกิด :  > ตำหนิ :  >
 :   : 
 *  :  > ";?> หน่วยงานที่เข้ารับราชการครั้งแรก :  >
 *  :  >  *  : 
 *  :  ;">  *  : 
 * กระบอกเงินเดือน : 
     * วันที่ :  >
วันที่คำสั่งล่าสุด :  > เลขที่คำสั่งล่าสุด :  >
ที่อยู่ตามทะเบียนบ้าน : 
ที่อยู่ตามภูมิลำเนาเดิม : 
ที่อยู่ที่สามารถติดต่อได้ : 
โทรศัพท์ที่บ้าน :  > โทรศัพท์ที่ทำงาน :  >
โทรสาร :  > โทรศัพท์มือถือ :  >
 : 
 : 
คู่สมรส : 
 :  >  :  >
 :  >  :  >
  >เป็นสมาชิกสหกรณ์  :  >
  >เป็นสมาชิก กบข./กสจ. วันที่เป็นสมาชิก กบข./กสจ. :  >
  >เป็นสมาชิกสหภาพข้าราชการพลเรือนสามัญ วันที่เป็นสมาชิกสหภาพ :  >
  >เป็นสมาชิกสหภาพข้าราชการระดับกรม วันที่เป็นสมาชิกสหภาพ :  >
  >เป็นสมาชิกสหภาพข้าราชการระดับกระทรวง วันที่เป็นสมาชิกสหภาพ :  >
  >เป็นสมาชิกสหภาพข้าราชการระดับจังหวัด วันที่เป็นสมาชิกสหภาพ :  >
  onClick="javascript:unCheck_PERMEM();">เป็นสมาชิกสหภาพข้าราชการประเภทตำแหน่งผู้บริหาร วันที่เป็นสมาชิกสหภาพ :  >
>ผ่านการอุปสมบท >ผ่านการคัดเลือกเข้ารับราชการทหาร รายละเอียดการอุปสมบท :  >
>HiPPS  >New Wave  >นักเรียนทุน  >  >ผู้ปฏิบัติงานด้าน HR   >สามารถออกประจำการ จำนวนครั้งที่ต่อสัญญา :  >
  >เป็นผู้ตรวจสอบการลา  >ต่ออายุราชการ   >ทดลองปฏิบัติราชการ
บุคคล-ที่อยู่และเบอร์โทรศัพท์ติดต่อยามฉุกเฉิน :   : 
 : 
 :   : 
');" value=""> <?=$DEL_TITLE?>');"> <?=$CLEAR_TITLE?>