"); if ($c) $session_save_name = substr($SELECTED_LIST,4,$c-4); else $session_save_name = substr($SELECTED_LIST,4); // echo "session_save_name=".$session_save_name."
"; } // echo "msg_id=$MSG_ID, selected=$SELECTED_LIST
"; // if(trim($SELECTED_LIST)) $arr_search_condition[] = "(id in ($SELECTED_LIST))"; $EXCEPT_PER_ID = $_POST['EXCEPT_PER_ID']; if (!$EXCEPT_PER_ID) $EXCEPT_PER_ID = $_GET['EXCEPT_PER_ID']; $EXCEPT_LIST = $_POST['EXCEPT_LIST']; if (!$EXCEPT_LIST) $EXCEPT_LIST = $_GET['EXCEPT_LIST']; $isLock = $_POST['isLock']; if (!$isLock) $isLock = $_GET['isLock']; $LOCK_MINISTRY_ID = $_POST['LOCK_MINISTRY_ID']; if (!$LOCK_MINISTRY_ID) $LOCK_MINISTRY_ID = $_GET['LOCK_MINISTRY_ID']; $LOCK_DEPARTMENT_ID = $_POST['LOCK_DEPARTMENT_ID']; if (!$LOCK_DEPARTMENT_ID) $LOCK_DEPARTMENT_ID = $_GET['LOCK_DEPARTMENT_ID']; // $isSubmit2Parent = $_POST['isSubmit2Parent']; $isSubmit2Parent = ""; $search_condition = ""; $search_per_status = (isset($search_per_status))? $search_per_status : 5; if(trim($search_group)) $arr_search_condition[] = "(name_th like '%$search_group%')"; if(trim($search_name)) $arr_search_condition[] = "(fullname like '%$search_name%')"; if(trim($search_address)) $arr_search_condition[] = "(address like '%$search_address%')"; if(trim($search_per_status) < 5) { $temp_per_status = $search_per_status - 1; $arr_search_condition[] = "(a.PER_STATUS = $temp_per_status and d.USER_LINK_ID = a.PER_ID)"; } $search_condition = ""; if(count($arr_search_condition)) $search_condition = " where " . implode(" and ", $arr_search_condition); //หาชื่อผู้ที่มีในระบบการ login if ($first_loaded==1) { /*เดิม 2018/09/03 */ /* $cmd1 ="select username, d.id, titlename, fullname, name_th, address from user_detail d inner join user_group g on g.id = d.group_id $search_condition order by g.group_seq_no, g.name_th, d.fullname "; */ $search_condition = str_replace(" where ", " and ", $search_condition); $cmd1 = "select DISTINCT username, d.id, titlename, fullname, name_th, address ,g.group_seq_no from user_detail d,user_group g , PER_PERSONAL a where g.id=d.group_id and (d.USER_LINK_ID = a.PER_ID or d.USER_LINK_ID is null or d.USER_LINK_ID=0) $search_condition order by g.group_seq_no, g.name_th, d.fullname"; $count_data=$db->send_cmd($cmd1); //$count_data=0; // echo $cmd1."
"; //$db->show_error(); if (!$ALL_PER_LIST && $count_data) { $ARR_ALL_PER = (array) null; $ARR_ALL_GRP= (array) null; $data_count=0; while($datausr = $db->get_array()) { $data_count++; // if ($data_count > 5000) break; $datausr = array_change_key_case($datausr, CASE_LOWER); $ARR_ALL_PER[] = $datausr[id]; $ARR_ALL_GRP[] = $datausr[name_th]; } // end while $ALL_PER_LIST = implode(",",$ARR_ALL_PER); $ALL_GRP_LIST = implode(",",$ARR_ALL_GRP); } // end if (!$ALL_PER_LIST && $count_data) } function check_full_group_php($per_id){ global $ALL_PER_LIST, $ALL_GRP_LIST, $SELECTED_LIST; // echo "per_id=$per_id
"; $arr_per = explode(",", $ALL_PER_LIST); $arr_grp = explode(",", $ALL_GRP_LIST); $arr_selected = explode(",", $SELECTED_LIST); // หา index เริ่มต้นของ กลุ่ม/PER_ID ที่ต้องการ $target_per_idx = array_search($per_id, $arr_per); $target_grp_idx = array_search($arr_grp[$target_per_idx], $arr_grp); // หา index ตัวแรกของกลุ่มนี้ $target_firstper_idx = array_search($arr_per[$target_grp_idx], $arr_per); // หา per_id แรก ตาม index แรกของกลุ่ม $target_idx = $target_firstper_idx; // $target_idx = $target_per_idx; $chk_grp = $arr_grp[$target_idx]; $cnt_full=0; $cnt_exist=0; while ($chk_grp == $arr_grp[$target_idx]) { // echo "per_id=$per_id, grp[$target_idx]=".$arr_grp[$target_idx]."
"; $c = array_search($arr_per[$target_idx], $arr_selected); if ($c !== false) $cnt_exist++; // นับเฉพาะที่เลือกไว้ $cnt_full++; // นับทั้งหมด $target_idx++; } return ($cnt_full==$cnt_exist); } // end function count_grp ?> รายชื่อผู้ใช้งาน
 
กลุ่มผู้ใช้งาน :     
 :  สังกัด : 
สถานภาพ : 
<?=$CLOSE_WINDOW_TITLE?> 
พบรายชื่อผู้ใช้งาน ทั้งสิ้น ราย
1)? ($current_page * $data_per_page) : $data_per_page; $cmd1 ="select * from ( select rownum rnum, q1.* from ( select DISTINCT username, d.id, titlename, fullname, name_th, address ,g.group_seq_no from user_detail d,user_group g , PER_PERSONAL a where g.id=d.group_id and (d.USER_LINK_ID = a.PER_ID or d.USER_LINK_ID is null or d.USER_LINK_ID=0) $search_condition order by g.group_seq_no, g.name_th, d.fullname ) q1 ) where rnum between $rec_start and $rec_end "; } //echo "
".$cmd1;
            $count_page_data = $db->send_cmd($cmd1);

    //		$db->show_error();
    	} else {
	        $count_page_data = 0;
		}
		if($count_page_data){
                //if(1==0){
?>
get_array()) :
				$data_count++;
				if($data_count > $data_per_page) break;
				$datausr = array_change_key_case($datausr, CASE_LOWER);
				$TMP_PER_ID = $datausr[id];
				$TMP_PER_FULLNAME=$datausr[titlename] . $datausr[fullname];
				$TMP_ADDRESS=$datausr[address];
                $TMP_PER_GROUPNAME = $datausr[name_th];
				$class = "table_body";
				$onmouse_event = " onMouseOver=\"this.className='table_body_over';\" onMouseOut=\"this.className='table_body';\" ";

				$returnValue = "$TMP_PER_ID<::>$TMP_PER_FULLNAME";
				
				$checked = "";
//				echo "if(in_array($TMP_PER_ID, $ARR_SELECTED))=".in_array($TMP_PER_ID, $ARR_SELECTED)."
"; if(in_array($TMP_PER_ID, $ARR_SELECTED)){ $count_selected++; $checked = "checked"; } // end if $disabled = ""; if(in_array($TMP_PER_ID, $ARR_EXCEPT)) $disabled = "disabled"; // echo "if($CUR_GROUPNAME != $TMP_PER_GROUPNAME)
"; if($CUR_GROUPNAME != $TMP_PER_GROUPNAME) { $TMP_PER_FULLNAME = $TMP_PER_GROUPNAME; $CUR_GROUPNAME = $TMP_PER_GROUPNAME; $checked_grp = ""; if (check_full_group_php($TMP_PER_ID)) $checked_grp = "checked"; ?> > "; ?> > >
สังกัด
>    
  >  
  >  
1) : ?>
  *** wait ***

"; } // end if ?>