use ceil() for pagination rounding instead of intval()
This commit is contained in:
parent
44158a0b00
commit
aa6bbf4bd7
1 changed files with 7 additions and 2 deletions
|
|
@ -37,10 +37,15 @@ function nextButton($params) {
|
||||||
echo("<th><a href='" . $params . "'><button>Next</button></a></th>");
|
echo("<th><a href='" . $params . "'><button>Next</button></a></th>");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function totalPages($limit) {
|
||||||
|
global $cat;
|
||||||
|
return ceil(getRowCount($cat)/$limit);
|
||||||
|
}
|
||||||
|
|
||||||
function pageLinks() {
|
function pageLinks() {
|
||||||
global $page;
|
global $page;
|
||||||
global $cat;
|
global $cat;
|
||||||
for ($i=0; $i < (intval(getRowCount($cat)/14)); $i++) {
|
for ($i=0; $i < totalPages(15); $i++) {
|
||||||
if ($page == $i+1) {
|
if ($page == $i+1) {
|
||||||
echo("<td class='selectedpage'>");
|
echo("<td class='selectedpage'>");
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -57,7 +62,7 @@ function pageButtons() {
|
||||||
backButton(params($page-1));
|
backButton(params($page-1));
|
||||||
}
|
}
|
||||||
pageLinks();
|
pageLinks();
|
||||||
if ($page < intval(getRowCount($cat)/14)) {
|
if ($page < totalPages(15)) {
|
||||||
nextButton(params($page+1));
|
nextButton(params($page+1));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue