include("public_inc.php");?> connectdb(); charSetThai(); loadControl(); ?> if ($_SERVER['SCRIPT_NAME']) { $scriptname = $_SERVER['SCRIPT_NAME']; } if ($_SERVER['QUERY_STRING']) { $scriptname .= "?".$_SERVER['QUERY_STRING']; } $Con_GalleryPage = $ArticlePage; $currentPage = $_SERVER["PHP_SELF"]; $range = 5; // จำนวนแสดงหน้าและหลังเลขหน้าที่เลือก $pageNum = 1; if (isset($_GET['page'])) { $pageNum= $_GET['page']; } $startRowQuery = ($pageNum-1 )* $Con_GalleryPage; $sql = "select * from gac_tblarticle where OnlineStatus = 'Y' Order by DateRegister DESC"; $querylimit = sprintf("%s LIMIT %d, %d", $sql, $startRowQuery, $Con_GalleryPage); $result= mysql_query($querylimit); if (isset($_GET['totalRows'])) { $totalRows = $_GET['totalRows']; } else { $allQuery= mysql_query($sql); if($allQuery){ $totalRows = mysql_num_rows($allQuery); } } $totalPages = ceil($totalRows/$Con_GalleryPage); ?> if ($pageNum == 1) { $start= 1; $limit = $Con_GalleryPage; if($limit > $totalRows){$limit = $totalRows;} }else{ $start= ($Con_GalleryPage*$pageNum)-1; $limit = ($Con_GalleryPage*$pageNum); if($limit > $totalRows){$limit = $totalRows;} } ?> $pagegoto = ($pageNum-1) * $Con_PhotoPage; // หาหน้าที่จะกระโดดไป $pagestart = $pageNum - $range; $pageend = $pageNum + $range; if ($pagestart <= 1) { $pagestart = 1; } if ($pageend >= $totalPages) { $pageend = $totalPages; } ?>
include('include_title.php')?>
|
||||||||||||||