routeSQL : push on the last page if the values are too high
git-svn-id: https://svn.fournier38.fr/svn/ProgSVN/trunk@2001 bf3deb0d-5f1a-0410-827f-c0cc1f45334c
This commit is contained in:
@@ -157,14 +157,17 @@ class routeSQL
|
||||
$titles = $this->objectDB->titles ();
|
||||
if ($page === null || $page === "") $page = 1;
|
||||
if ($num === null || $num === "") $num = 10;
|
||||
$page = intval ($page);
|
||||
$num = intval ($num);
|
||||
if ($num > 1000)
|
||||
$route->redirect ("/".$this->url_prefix."?page=$page&num=1000", "");
|
||||
if ($page < 1)
|
||||
$route->redirect ("/".$this->url_prefix."?page=1&num=$num", "");
|
||||
// TODO : Push on the last page
|
||||
// Push on the last page if the values are too high
|
||||
if ($page*$num > count ($datas))
|
||||
{
|
||||
$route->redirect ("/".$this->url_prefix, "");
|
||||
$maxPage = intval(count ($datas)/$num);
|
||||
$route->redirect ("/".$this->url_prefix."?page=$maxPage&num=$num", "");
|
||||
}
|
||||
|
||||
$content = $this->showflash ();
|
||||
|
||||
Reference in New Issue
Block a user