summaryrefslogtreecommitdiffstats
path: root/application/modules/user/controllers/ClientController.php
diff options
context:
space:
mode:
authorSimon2011-03-30 11:43:23 +0200
committerSimon2011-03-30 11:43:23 +0200
commit431932fd6a4c3f8c3883abe5af2e2d10f516c998 (patch)
treef66e9d87f3da57545acfa93d5bfb4698a0d6b353 /application/modules/user/controllers/ClientController.php
parentNotifier 404 zu BootIso Download hinzugefügt (diff)
downloadpbs2-431932fd6a4c3f8c3883abe5af2e2d10f516c998.tar.gz
pbs2-431932fd6a4c3f8c3883abe5af2e2d10f516c998.tar.xz
pbs2-431932fd6a4c3f8c3883abe5af2e2d10f516c998.zip
vorbereitung für pagination
Diffstat (limited to 'application/modules/user/controllers/ClientController.php')
-rw-r--r--application/modules/user/controllers/ClientController.php18
1 files changed, 16 insertions, 2 deletions
diff --git a/application/modules/user/controllers/ClientController.php b/application/modules/user/controllers/ClientController.php
index 163ea95..023de4a 100644
--- a/application/modules/user/controllers/ClientController.php
+++ b/application/modules/user/controllers/ClientController.php
@@ -46,9 +46,23 @@ class User_ClientController extends Zend_Controller_Action
$clientMapper = new Application_Model_ClientMapper();
$clientsInGroup = $clientMapper->findBy('groupID',$this->membership->getGroupID());
+
#print_a($clientsInGroup);
-
- $this->view->clients = $clientsInGroup;
+ $perpage = 5;
+ $req_page = $this->_request->getParam('page');
+ $all = count($clientsInGroup);
+ $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;
+ $this->pagination = array('max' => $numpages, 'selected' => $req_page);
+
+ print_a($all,$numpages,$startitem,$req_page);
+ $pagination = new Pbs_Pagination();
+ $this->pagination = $pagination->pagination('/user/client/index',$req_page,$numpages);
+ $this->view->clients = array_slice($clientsInGroup,$startitem,$perpage);
}