$search_string="";
if (!empty($search_kind) && !empty($search_text)) {
$search_string .= " and ".CheckWord($search_kind)." like '%".CheckWord($search_text)."%'";
}
else {
$search_kind="";
$search_text="";
}
If (isset($_REQUEST["gotopage"])) {
If (!empty($_REQUEST["gotopage"]))
$gotopage = $_REQUEST["gotopage"];
else
$gotopage = 1;
}
else {
$gotopage = 1;
}
$board_list_url="notice_01.html";
$board_list_basic_item="?search_kind=".urlencode($search_kind)."&search_text=".urlencode($search_text)."&board_name=".urlencode($board_name);
$sql= "select * from ".$tableName."_board_table where view_ok=1 and board_name='".CheckWord($board_name)."' ".$search_string;
$rs_count = mysql_query($sql,$Conn);
$rows = mysql_num_rows($rs_count);
$total_count = $rows; // 전체 레코드 개수
$ipp = 10; // 한페이지 당 레코드 개수
$nowpage = $gotopage; // 현재 페이지
$page_count = $total_count-($ipp * ($nowpage-1)); // 출력 페이지 첫 게시물 번호
$total_page = ceil($total_count / $ipp); // 전체 페이지 개수
$offset = $ipp*($nowpage-1); // 게시물 시작 번호
$sql = "select * from ".$tableName."_board_table where view_ok=1 and board_name='".CheckWord($board_name)."' ".$search_string." order by top_view desc,no desc limit $offset, $ipp";
$rs_row = mysql_query($sql,$Conn);
?>