summaryrefslogtreecommitdiffstats
path: root/system/libraries/Pagination.php
diff options
context:
space:
mode:
Diffstat (limited to 'system/libraries/Pagination.php')
-rw-r--r--system/libraries/Pagination.php21
1 files changed, 13 insertions, 8 deletions
diff --git a/system/libraries/Pagination.php b/system/libraries/Pagination.php
index efbe6c27f..b29571eee 100644
--- a/system/libraries/Pagination.php
+++ b/system/libraries/Pagination.php
@@ -105,16 +105,21 @@ class CI_Pagination {
{
return '';
}
-
+
// Calculate the total number of pages
- $num_pages = intval($this->total_rows / $this->per_page);
+ $num_pages = ceil($this->total_rows / $this->per_page);
+
+ /*
+ // Calculate the total number of pages
+ $num_pages = intval($this->total_rows / $this->per_page);
+
+ // Use modulus to see if our division has a remainder. If so, add one to our page number.
+ if ($this->total_rows % $this->per_page)
+ {
+ $num_pages++;
+ }
+ */
- // Use modulus to see if our division has a remainder.If so, add one to our page number.
- if ($this->total_rows % $this->per_page)
- {
- $num_pages++;
- }
-
// Is there only one page? Hm... nothing more to do here then.
if ($num_pages == 1)
{