PR for dev_1.0

I think this can be simplified to:
```php
$total_pages = MIN_PAGE_NUM;
if ($total_rows > $max_rows) {
    $total_pages = ceil($total_rows / $max_rows);
}
```
Don't use magic numbers po. :)