PHP Package Good digital Paging method class
/**
* Get page number navigation html
* @param $pageNum: Current page
* @param $pageSize: Quantity per page
* @param $rowCount: Total Records
* @param $navUrl: Link page url
*/
function getnavhtml ($pageNum, $pageSize, $rowCount, $NAVURL) {
$pageCount = (int) ($rowCount/$pageSize); Total pages
if ($rowCount% $pageSize >0) {
$pageCount + +;
}
if ($pageNum > $pageCount) {
$pageNum = 1;
}
$firstNav = "Home";
$lastNav = "Last";
$prevNav = "";
$nextNav = "";
if ($pageNum >1) {
$navPageNum = $pageNum-1;
$prevNav = "Previous page";
}
if ($pageNum < $pageCount && $pageCount >1) {
$navPageNum = $pageNum +1;
$nextNav = "Next page";
}
$amongNav = "";//Key loop
for ($i =1; $i <=5; $i + +) {
$navPageNum = $pageNum + $i-3;
if ($navPageNum >0 && $navPageNum <= $pageCount) {
$navCSS = $navPageNum = = $pageNum? "class=\" Hover\ "": "";
$amongNav. = "{$navPageNum}";
}
}
Return $firstNav. $prevNav. $amongNav. $nextNav. $lastNav. " ". $pageNum." /". $pageCount." Total [". $rowCount."] Data ";
}
}
http://www.bkjia.com/PHPjc/847200.html www.bkjia.com true http://www.bkjia.com/PHPjc/847200.html techarticle PHP Package Good digital Paging method class/** * Get page number navigation HTML * @param $pageNum: Current page number * @param $pageSize: Quantity per page * @param $rowCount: Total records * @param $...< /c5>