article as $item) { $art_title = iconv("UTF-8","euc-kr",$item->art_title); $art_category = iconv("UTF-8","euc-kr",$item->art_category); $art_finename = iconv("UTF-8","euc-kr",$item->art_filename); $art_servicedate = iconv("UTF-8","euc-kr",$item->art_servicedate); $art_date = iconv("UTF-8","euc-kr",$item->art_date); $art_photo = iconv("UTF-8","euc-kr",$item->thumb); $art_doc = iconv("UTF-8","euc-kr",$item->art_doc); $art_doc = mb_substr($art_doc,0,185,"euc-kr"); if ($art_title == $art_title_old) { continue; } $art_title_old = $art_title; $tmparr = array('title'=>$art_title, 'category'=>$art_category, 'finename'=>$art_finename, 'servicedate'=>$art_servicedate, 'date'=>$art_date, 'photo'=>$art_photo, 'doc'=>$art_doc); array_push($list, $tmparr); // $cnt++; // if ($cnt == 15 ) { // break; // } $art_title_old = $art_title; } $current_page = $_GET["page"]; if ($current_page == '' || $current_page == 0) { $current_page = 1; } $total_cnt = count($list); // 총 글 수 $page_size = 15; // 한 페이지에 보여줄 글 수 $block_size = 10; // 한 블록에 보여줄 페이지 수 $page_count = ceil($total_cnt / $page_size); $start_row = ($current_page-1) * $page_size; $end_row = $start_row + $page_size -1; $end_row = $end_row < $total_cnt ? $end_row : $total_cnt -1; ?>
$page_count ? $page_count : $end_page_num; if ($current_page > $block_size) { ?> 이전 $total_cnt='.$total_cnt; // echo '
$page_count='.$page_count; // echo '
$start_row='.$start_row; // echo '
$end_row='.$end_row; // echo '
$start_page_num='.$start_page_num; // echo '
$end_page_num='.$end_page_num; for ($i = $start_page_num; $i <= $end_page_num; $i++) { if ($current_page == $i) { ?>
$end_page_num) { ?> 다음