summaryrefslogtreecommitdiffstats
path: root/application/modules/user/controllers/ClientController.php
diff options
context:
space:
mode:
authorSimon2011-03-30 12:48:08 +0200
committerSimon2011-03-30 12:48:08 +0200
commitd4ceeed0570fb10d95adeb115cbe127461bda1db (patch)
treea99b3e76c509905696031a33f7a0926010f4877f /application/modules/user/controllers/ClientController.php
parentvorbereitung für pagination (diff)
downloadpbs2-d4ceeed0570fb10d95adeb115cbe127461bda1db.tar.gz
pbs2-d4ceeed0570fb10d95adeb115cbe127461bda1db.tar.xz
pbs2-d4ceeed0570fb10d95adeb115cbe127461bda1db.zip
Pagination in clients
Diffstat (limited to 'application/modules/user/controllers/ClientController.php')
-rw-r--r--application/modules/user/controllers/ClientController.php14
1 files changed, 6 insertions, 8 deletions
diff --git a/application/modules/user/controllers/ClientController.php b/application/modules/user/controllers/ClientController.php
index 023de4a..7d0e7e7 100644
--- a/application/modules/user/controllers/ClientController.php
+++ b/application/modules/user/controllers/ClientController.php
@@ -48,7 +48,7 @@ class User_ClientController extends Zend_Controller_Action
$clientsInGroup = $clientMapper->findBy('groupID',$this->membership->getGroupID());
#print_a($clientsInGroup);
- $perpage = 5;
+ $perpage = 10;
$req_page = $this->_request->getParam('page');
$all = count($clientsInGroup);
$numpages = ceil($all/$perpage);
@@ -56,12 +56,11 @@ class User_ClientController extends Zend_Controller_Action
$req_page = 0;
if($req_page >= $numpages)
$req_page = $numpages-1;
- $startitem = $req_page * $perpage;
- $this->pagination = array('max' => $numpages, 'selected' => $req_page);
+ $startitem = $req_page * $perpage;
- print_a($all,$numpages,$startitem,$req_page);
- $pagination = new Pbs_Pagination();
- $this->pagination = $pagination->pagination('/user/client/index',$req_page,$numpages);
+ $pagination = new Pbs_Pagination();
+ $str = $pagination->pagination('/user/client/index',$req_page,$numpages);
+ $this->view->pagination = $str;
$this->view->clients = array_slice($clientsInGroup,$startitem,$perpage);
}
@@ -80,8 +79,7 @@ class User_ClientController extends Zend_Controller_Action
$this->view->addclient = $addclient;
}
else{
- $addclient = new user_Form_Client(array('buttontext' => 'Create Client'),$_POST);
- print_a($_POST);
+ $addclient = new user_Form_Client(array('buttontext' => 'Create Client'),$_POST);
if ($addclient->isValid($_POST) || ($mac != '' && $hh != '') ) {
$client = new Application_Model_Client($_POST);
$mac = ($mac!='')?$mac:$_POST['macadress'];