################################# # Function : List Directory # Sub-Function : # Date Create : 31/12/2008 # Date Modified : ################################## //echo"
"; //print_r($_REQUEST); include("inc/connection.php"); ?>Direktori Pegawai
//if ($button == 'Cari' ) { //bawa-param-lama $prm_old = ""; if (!empty($_SERVER['QUERY_STRING'])) { $params = explode("&", $_SERVER['QUERY_STRING']); $newParams = array(); foreach ($params as $param) { if (stristr($param, "page") == false && stristr($param, "per_page") == false) { if (strlen(trim($param))>0) array_push($newParams, $param); } } if (count($newParams) != 0) { $prm_old = "&" . implode("&", $newParams); } } $postString = ""; //while(list($key, $val) = each($HTTP_POST_VARS)) { while(list($key, $val) = each($_POST)) { $key = stripslashes($key); $val = stripslashes($val); $key = urlencode($key); $val = urlencode($val); if (strlen(trim($postString))>0) $postString .= "&"; $postString .= "$key=$val"; } if (strlen(trim($postString))>0) $prm_old .= "&".$postString; // condition $where_sql = ""; if (strlen(trim($in_search))>0 ) { $where_sql .= " and (( UPPER(fd_nama) like '%".str_replace("'", "''",strtoupper(trim($in_search)))."%' ) or ( UPPER(fd_tel) like '%".str_replace("'", "''",strtoupper(trim($in_search)))."%' ) or ( UPPER(fd_emel) like '%".str_replace("'", "''",strtoupper(trim($in_search)))."%' ) or ( UPPER(fd_jawatan) like '%".str_replace("'", "''",strtoupper(trim($in_search)))."%' ))"; } if ($in_department == "all" ) { $where_sql .= "order by case when fd_jabatan = 'BHEUU' Then fd_gred else '' end desc, case when fd_jabatan = 'BBG' Then fd_gred else '' end desc, case when fd_jabatan = 'JIM' Then fd_gred end desc "; } else if ($in_department == "bheuu" ) { $where_sql .= " and fd_jabatan= 'BHEUU' order by fd_gred desc"; } else if ($in_department == "bbg" ) { $where_sql .= " and fd_jabatan= 'BBG' order by fd_gred desc"; } else if ($in_department == "jim" ) { $where_sql .= " and fd_jabatan= 'JIM' order by fd_gred desc"; } //order by fd_nama asc else { if (strlen(trim($in_department)) >0 ) { $where_sql .= " and UPPER(fd_seksyen)= '$in_department' order by fd_seksyen,fd_gred desc"; } } $sql = "select count(*) as JUMREK FROM tb_staff where 1=1 and fd_kodseksyen = '16' order by fd_gred desc"; $result= mysql_query($sql) or mim_errdb(__FILE__,__LINE__,mysql_error($conn)); $row_all_rec = mysql_fetch_assoc ( $result ); $nums_all_rec = $row_all_rec['JUMREK']; //-- kira ms if (!$per_page) $per_page = 10; if (!$page) $page = 1; $prev_page = $page - 1; $next_page = $page + 1; $page_start = ($per_page * $page) - $per_page; if ($nums_all_rec <= $per_page) { $num_pages = 1; } else if (($nums_all_rec % $per_page) == 0) { $num_pages = ($nums_all_rec / $per_page); } else { $num_pages = ($nums_all_rec / $per_page) + 1; } $num_pages = (int) $num_pages; if (($page > $num_pages) || ($page < 0)) { echo ""; echo "You have specified an invalid page number"; echo ""; } $rr_s = ($page-1)*$per_page + 1; if (($rr_s + $per_page) <= $nums_all_rec) $rr_e = ($rr_s + $per_page) - 1; else $rr_e = $nums_all_rec; // jika tiada rekod if ($nums_all_rec==0) { $num_pages=0; $page=0; $rr_s = 0; } $limit = $rr_s - 1; $max_pages = ceil ( $nums_all_rec / $per_page ); ?>
rekod. Dipamirkan -. Halaman:
//-- pamir |
Bil | Nama Pegawai | Jawatan | Emel@bheuu.gov.my | No Telefon (03-8885 1000 samb.) |