/** * Applies orderby(ies) and limits to the query and returns pagination data for the client * @param Pagination $pagination [Pagination object, needed for clientside pagination] * @param string $sql [SQL's string, passed by reference in order to modify it for sort and pagination] * @return void */ public function process(Pagination $pagination, &$sql) { /** Applies changes to the SQL for sort purposes */ $this->sortQuery($sql); /** @var array pagination data for the client */ $pagination_data = $pagination->paginate($sql); /** Sets the pagination data on this object, to later be exposed to the client */ $this->setPaginationData($pagination_data); }
public function userchecklistAction($I_pageNumber) { $O_checkMapper = new CheckMapper(); $O_pagination = new Pagination($O_checkMapper); $A_limit = $O_pagination->paginate($I_pageNumber); $I_nbPage = $A_limit['nbPage']; $A_checks = $O_checkMapper->findByUserPerPage($A_limit); Buffer::flushBuffer('check/userchecklist', array('checks' => $A_checks, 'nbPage' => $I_nbPage, 'pageNumber' => $I_pageNumber)); }
public function paginateAction($I_pageNumber) { // On vérifie si l'utilisateur connecté est bien un admin $this->haveAccess(); $O_profileMapper = new ProfileMapper(); $O_pagination = new Pagination($O_profileMapper); $A_limit = $O_pagination->paginate($I_pageNumber); $I_nbPage = $A_limit['nbPage']; $A_profiles = $O_profileMapper->findPerPage($A_limit); Buffer::flushBuffer('profile/list', array('profile' => $A_profiles, 'nbPage' => $I_nbPage, 'pageNumber' => $I_pageNumber)); }
public function paginateAction($I_pageNumber) { // On vérifie si l'utilisateur connecté est bien un admin $this->isAdmin(); $O_userMapper = new UserMapper(); $O_pagination = new Pagination($O_userMapper); $A_limit = $O_pagination->paginate($I_pageNumber); $I_nbPage = $A_limit['nbPage']; $A_users = $O_userMapper->findPerPage($A_limit); Buffer::flushBuffer('user/list', array('users' => $A_users, 'nbPage' => $I_nbPage, 'pageNumber' => $I_pageNumber)); }
<?php require_once 'init.php'; require_once LIB_PATH . 'functions.lib.php'; require_once LIB_PATH . 'paging.lib.php'; chkLicense(); chkSession(); $page_title = "Report"; $page_id = "12"; chkSecurity($page_id); $ev_q = "SELECT e.id,\n\t\t\t\tCONCAT(u.fname,' ',u.lname) AS fullname,\n\t\t e.name AS evname,\n\t\t \t\te.ticker,\n\t\t\t\te.sdate,\n\t\t\t\te.edate,\n\t\t\t\te.createBy,\n\t\t\t\te.createDate,\n\t\t\t\te.qty_locket\n\t\t FROM events e\n\t\t INNER JOIN user u ON (u.id = e.createBy)\n\t WHERE e.createBy = '" . $_SESSION["uid"] . "' AND e.del = '0'\n\t\t ORDER BY e.sdate DESC "; $pagingResult = new Pagination(); $pagingResult->setPageQuery($ev_q); $pagingResult->paginate(); $this_page = $_SERVER['PHP_SELF'] . "?" . $pagingResult->getPageQString(); include THEME_DEFAULT . 'header.php'; ?> <//-----------------CONTENT-START-------------------------------------------------//> <h1 class="page-header"><?php echo $page_title; ?> Page</h1> <div class="sub-header"> <div class="panel panel-default"> <div class="panel-heading"> </div> <div class="panel-body"> <?php echo $pagingResult->pagingMenu();
?> </a></td> <td><?php echo Functions::DateFormat('m/d/Y', $comment->date_created); ?> </td> </tr> <?php } ?> </tbody> </table> </div> <?php echo $pagination->paginate(); ?> <?php } else { ?> <div class="block"><strong>No comments found</strong></div> <?php } ?> </div> <?php include 'footer.php';
<div class="panel-body"> <div class="table-responsive"> <table class="table table-bordered"> <thead> <th>ID</th> <th>Title</th> <th>Author</th> <th>Date Created</th> <th>Action</th> </thead> <?php $pages = new Pagination(); //Pagination Initialization $data = $user->getTable('news', array('id', 'title', 'author', 'date'), 'date DESC', 100); $numbers = $pages->paginate($data, 6); $result = $pages->fetchResult(); foreach ($result as $news) { //Output Last 10 Registered Users ?> <tbody> <tr> <td><?php echo escape($news->id); ?> </td> <td><?php echo escape($news->title); ?> </td>