summaryrefslogtreecommitdiffstats
path: root/application/modules/user/controllers/PoolController.php
diff options
context:
space:
mode:
authorSimon2011-03-30 13:13:37 +0200
committerSimon2011-03-30 13:13:37 +0200
commitbe4fb92647714849e5523468691a5a46ae27a30d (patch)
tree4db8a9f59abd8091ce8f06781b1339877e6e16c1 /application/modules/user/controllers/PoolController.php
parentMerge branch 'master' of openslx.org:lsfks/master-teamprojekt/pbs2 (diff)
downloadpbs2-be4fb92647714849e5523468691a5a46ae27a30d.tar.gz
pbs2-be4fb92647714849e5523468691a5a46ae27a30d.tar.xz
pbs2-be4fb92647714849e5523468691a5a46ae27a30d.zip
Pagination & sortierung in Filter
Diffstat (limited to 'application/modules/user/controllers/PoolController.php')
-rw-r--r--application/modules/user/controllers/PoolController.php14
1 files changed, 13 insertions, 1 deletions
diff --git a/application/modules/user/controllers/PoolController.php b/application/modules/user/controllers/PoolController.php
index 15a3f1e..ab6a078 100644
--- a/application/modules/user/controllers/PoolController.php
+++ b/application/modules/user/controllers/PoolController.php
@@ -62,7 +62,19 @@ class User_PoolController extends Zend_Controller_Action
$ff->setID($pool['poolID']);
$yourpools[] = $ff;
}
- $this->view->pools = $yourpools;
+ $perpage = 5;
+ $req_page = $this->_request->getParam('page');
+ $all = count($yourpools);
+ $numpages = ceil($all/$perpage);
+ if($req_page < 0 || !is_numeric($req_page) )
+ $req_page = 0;
+ if($req_page >= $numpages)
+ $req_page = $numpages-1;
+ $startitem = $req_page * $perpage;
+
+ $pagination = new Pbs_Pagination();
+ $this->view->pagination = $pagination->pagination('/user/pool/index',$req_page,$numpages);
+ $this->view->pools = array_slice($yourpools,$startitem,$perpage);
// Get all Clients from this group
$clientmapper = new Application_Model_ClientMapper();