本文整理汇总了PHP中pager类的典型用法代码示例。如果您正苦于以下问题:PHP pager类的具体用法?PHP pager怎么用?PHP pager使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了pager类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: actionIndex
/**
*
* 订单数据服务费列表
*
*/
public function actionIndex()
{
$ecmsTaxModel = new EcmsTaxReceiptModel();
$dataserviceModel = new DataServiceFeeModel();
$plamfromType = CDict::$platform_type;
$getData = $this->_get();
$curr_page = $getData['page'] ? $getData['page'] : 1;
$platform_type = $this->_get('platform_type');
// 平台类型
$platfromType = CDict::$platform_type;
$whereSql = '';
if ($getData['platform_type'] != '0' && $getData['platform_type']) {
$whereSql .= "AND ORDERTYPE = '" . $getData['platform_type'] . "'";
}
if (strlen($getData['gbillno']) > 0) {
$whereSql .= "AND GENERALBILLNO LIKE '%" . $getData['gbillno'] . "%'";
}
if (strlen($getData['start-time']) > 0) {
$whereSql .= " AND TO_CHAR(REALARRIVALDATE, 'YYYY-MM-DD HH24:MI:SS') > '" . $getData['start-time'] . " 00:00:00'";
}
if (strlen($getData['end-time']) > 0) {
$whereSql .= " AND TO_CHAR(REALARRIVALDATE, 'YYYY-MM-DD HH24:MI:SS') < '" . $getData['end-time'] . " 24:00:00'";
}
$data = $dataserviceModel->getList($whereSql, $curr_page, $this->_pageSize);
$count = $dataserviceModel->getNowhereCount($whereSql);
$page = new pager($count, $curr_page, $this->_pageSize);
$pageStr = $page->GetPagerContent();
//var_dump($data);
//var_dump($getData);
//var_dump($whereSql);
$count1 = $this->_orderHeadModel->get_count(" AND HANDLESTATE='3' AND BILLSTATUS='0' ");
$count2 = $this->_orderHeadModel->get_count(" AND HANDLESTATE='3' AND BILLSTATUS='1' ");
$count3 = $this->_orderHeadModel->get_count(" AND HANDLESTATE='3' AND BILLSTATUS='2' ");
$count4 = $ecmsTaxModel->get_count(" AND TYPE='ECMS'");
$count5 = $ecmsTaxModel->get_count(" AND TYPE='UPS'");
$count6 = $dataserviceModel->getNowhereCount("");
$this->assign("count1", $count1);
$this->assign("count2", $count2);
$this->assign("count3", $count3);
$this->assign("count4", $count4);
$this->assign("count5", $count5);
$this->assign("count6", $count6);
array_unshift($plamfromType, "选择平台类型");
$this->assign('page', $pageStr);
$this->assign('count', $count);
$this->assign('platform_type', $getData['platform_type']);
$this->assign('gbillno', $getData['gbillno']);
$this->assign('starttime', $getData['start-time']);
$this->assign('endtime', $getData['end-time']);
$this->assign('data', $data);
$this->assign("platformType", $plamfromType);
$this->display('dataservicefee/dataservicefee_index.html');
}
示例2: init
function init($pages, $cur_page, $uri)
{
self::$pager = true;
self::$pages = $pages;
self::$cur_page = $cur_page;
self::$pager_uri = $uri;
}
示例3: trash
/**
* Trash
*
* @param string $type all|hidden
* @param string $orderBy
* @param int $recTotal
* @param int $recPerPage
* @param int $pageID
* @access public
* @return void
*/
public function trash($type = 'all', $orderBy = 'id_desc', $recTotal = 0, $recPerPage = 20, $pageID = 1)
{
/* Save session. */
$uri = $this->app->getURI(true);
$this->session->set('productList', $uri);
$this->session->set('productPlanList', $uri);
$this->session->set('releaseList', $uri);
$this->session->set('storyList', $uri);
$this->session->set('projectList', $uri);
$this->session->set('taskList', $uri);
$this->session->set('buildList', $uri);
$this->session->set('bugList', $uri);
$this->session->set('caseList', $uri);
$this->session->set('testtaskList', $uri);
$this->session->set('docList', $uri);
/* Get deleted objects. */
$this->app->loadClass('pager', $static = true);
$pager = pager::init($recTotal, $recPerPage, $pageID);
$trashes = $this->action->getTrashes($type, $orderBy, $pager);
/* Title and position. */
$this->view->title = $this->lang->action->trash;
$this->view->position[] = $this->lang->action->trash;
$this->view->trashes = $trashes;
$this->view->type = $type;
$this->view->orderBy = $orderBy;
$this->view->pager = $pager;
$this->view->users = $this->loadModel('user')->getPairs('noletter');
$this->display();
}
示例4: _get
public function _get()
{
$total = oo::m()->count();
$page = $this->req('page');
pager::init($page, $total);
$list = oo::m()->limit(pager::$start, pager::$num)->orderby('id desc')->getall();
method_exists($this, 'after_get') && $this->after_get($list);
$this->assign('pager', pager::get());
$this->assign('list', $list);
$this->display("{$this->form['tpl']}_list");
}
示例5: getPager
public function getPager($addWhere = '', $addSql = '', $showMax = 20, $select = '', $key = '', $form_vars = array())
{
$db = sf::getLib("db");
if ($select) {
$sql = $select . " ";
} else {
$sql = "SELECT * FROM `" . $this->table . "` ";
}
$addWhere && ($sql .= "WHERE " . $addWhere . " ");
$addSql && ($sql .= $addSql . " ");
if (!router::get("totalnum" . $key)) {
$_sql = "SELECT COUNT(*) AS NUM FROM `" . $this->table . "` ";
$addWhere && ($_sql .= "WHERE " . $addWhere . " ");
$addSql && ($_sql .= $addSql . " ");
$row = $db->fetch_first($_sql);
$total = $row['NUM'];
} else {
$total = router::get("totalnum" . $key);
}
$pager = new pager($total, $showMax, $key, $form_vars);
$sql .= "LIMIT " . $pager->getStartNum() . "," . $pager->getShowNum();
$query = $db->query($sql);
$pager->setField($db->result_array($query));
$pager->setObject(clone $this);
return $pager;
}
示例6: display
public function display($page, $nb_per_page, $enclose_block = '')
{
if ($this->rs->isEmpty()) {
echo '<p><strong>' . __('No page') . '</strong></p>';
} else {
$pager = new pager($page, $this->rs_count, $nb_per_page, 10);
$pager->html_prev = $this->html_prev;
$pager->html_next = $this->html_next;
$pager->var_page = 'page';
$html_block = '<table class="clear"><tr>' . '<th colspan="2">' . __('Title') . '</th>' . '<th>' . __('Date') . '</th>' . '<th>' . __('Author') . '</th>' . '<th>' . __('Comments') . '</th>' . '<th>' . __('Trackbacks') . '</th>' . '<th>' . __('Status') . '</th>' . '</tr>%s</table>';
if ($enclose_block) {
$html_block = sprintf($enclose_block, $html_block);
}
echo '<p>' . __('Page(s)') . ' : ' . $pager->getLinks() . '</p>';
$blocks = explode('%s', $html_block);
echo $blocks[0];
while ($this->rs->fetch()) {
echo $this->postLine();
}
echo $blocks[1];
echo '<p>' . __('Page(s)') . ' : ' . $pager->getLinks() . '</p>';
}
}
示例7: processInput
/**
* Processes available input adjusting internal state of databrowser.
*
* @return \de\toxa\txf\databrowser current instance
*/
public function processInput()
{
if (!$this->pager) {
// process all input once USING pager for semaphore
$this->pager = new pager($this->datasource->count(), $this->volatilePager);
if ($this->pager->isEnabled()) {
$this->datasource->size($this->pager->size())->offset($this->pager->offset());
if ($this->getForm()) {
$this->pager->enableButtons(true);
}
}
}
return $this;
}
示例8: index
public function index()
{
$cid = $this->req('cid', 0, 'intval');
$where = array();
$cid && ($where = array('cateid' => $cid));
$total = oo::m('product')->where($where)->count();
$page = $this->req('page');
pager::init($page, $total);
$list = oo::m('product')->limit(pager::$start, pager::$num)->orderby('id desc')->where($where)->getall();
$this->assign('list', $list);
//推荐商家
$seller = oo::m('seller')->limit(5)->getall();
$this->assign('seller', $seller);
$this->display('list');
}
示例9: indexAction
/**
* отображаем весь список материалов
*/
function indexAction()
{
if (isset($_POST['status'])) {
$_SESSION['status'] = $_POST['status'];
}
if (isset($_POST['status'])) {
$limit = 1000;
} else {
$_total_news = dbh::news_get_total_count();
$limit = pager::pager_limit($_total_news, ADMIN_NEWS_AT_PAGE);
}
// строим запрос
$_sql = 'SELECT * FROM ' . $this->tablename . ' where id>0 ' . general::get_status_for_filter($this->tablename) . ' order by created_at desc, sort limit ' . $limit;
// выполняем запрос + при необходимости выводим сам запрос
$result = mysql::query($_sql, 3);
return system::show_tpl(array('result' => $result, 'msg' => $this->msg, '_status' => isset($_POST['status']) ? $_POST['status'] : 2, 'tpl_folder' => $this->tpl_folder, '_total_news' => $_total_news), $this->tpl_folder . '/index.php');
}
示例10: indexAction
/**
* отображаем весь список материалов
*/
function indexAction()
{
// если перешли по get ссылке из меню
if (isset($_POST['name'])) {
$_SESSION['name'] = $_POST['name'];
}
if (isset($_POST['artikul'])) {
$_SESSION['artikul'] = $_POST['artikul'];
}
if ($_POST) {
if (isset($_POST['block_new'])) {
$_SESSION['block_new'] = $_POST['block_new'];
} else {
unset($_SESSION['block_new']);
}
if (isset($_POST['block_lider'])) {
$_SESSION['block_lider'] = $_POST['block_lider'];
} else {
unset($_SESSION['block_lider']);
}
}
if (isset($_POST['id_parent'])) {
$_SESSION['id_parent'] = $_POST['id_parent'];
}
if (isset($_POST['brand'])) {
$_SESSION['brand'] = $_POST['brand'];
}
if (isset($_POST['photo'])) {
$_SESSION['photo'] = $_POST['photo'];
}
if (isset($_POST['sklad'])) {
$_SESSION['sklad'] = $_POST['sklad'];
}
if (isset($_POST['status'])) {
$_SESSION['status'] = $_POST['status'];
}
// get limit
// всего в каталоге
$_total_catalog = dbh::catalog_get_total_count();
$limit = pager::pager_limit($_total_catalog, ADMIN_CATALOG_AT_PAGE);
// строим запрос
$_sql = 'SELECT * FROM ' . $this->tablename . ' where id>0 ' . general::get_status_for_filter($this->tablename) . ' order by sort limit ' . $limit;
// выполняем запрос + при необходимости выводим сам запрос
$result = mysql::query($_sql, 0);
return system::show_tpl(array('result' => $result, 'msg' => $this->msg, '_total_catalog' => $_total_catalog, '_status' => isset($_SESSION['status']) ? $_SESSION['status'] : 2, '_brand' => isset($_SESSION['brand']) ? $_SESSION['brand'] : 0, '_photo' => isset($_SESSION['photo']) ? $_SESSION['photo'] : 2, '_sklad' => isset($_SESSION['sklad']) ? $_SESSION['sklad'] : 3, 'tpl_folder' => $this->tpl_folder, 'select' => dbh::get_catolog_tree(), 'brand' => dbh::get_brand(), 'curent_id_parent' => isset($_SESSION['id_parent']) ? $_SESSION['id_parent'] : 0), $this->tpl_folder . '/index.php');
}
示例11: defaultpwd
public function defaultpwd($recTotal = 0, $recPerPage = 20, $pageID = 1)
{
/* Load pager. */
$this->app->loadClass('pager', $static = true);
if ($this->app->getViewType() == 'mhtml') {
$recPerPage = 10;
}
$pager = pager::init($recTotal, $recPerPage, $pageID);
$passwords = $this->kevinlogin->getPasswordList($pager);
if (!empty($_POST)) {
$this->kevinlogin->updateDefaultPwd();
die(js::reload('parent'));
}
$this->view->title = $this->lang->kevinlogin->common . $this->lang->colon . $this->lang->kevinlogin->defaultpwd;
$this->view->position[] = $this->lang->kevinlogin->defaultpwd;
$this->view->pager = $pager;
$this->view->passwords = $passwords;
$this->view->controlType = 'defaultpwd';
$this->display();
}
示例12: indexAction
/**
* отображаем весь список материалов
*/
function indexAction()
{
if (isset($_POST['status'])) {
$_SESSION['status'] = $_POST['status'];
}
if (isset($_POST['id_parent']) and $_POST['id_parent'] > 0) {
$limit = 1000;
} else {
// get limit
// всего в каталоге
$_total_gallery = dbh::gallery_get_total_count();
$limit = pager::pager_limit($_total_gallery, ADMIN_GALLERY_AT_PAGE);
}
// строим запрос
$_sql = 'SELECT * FROM ' . $this->tablename . ' where id>0 ' . general::get_status_for_filter($this->tablename) . ' ' . general::get_for_filter($this->tablename, 'id_parent') . ' order by sort limit ' . $limit;
// выполняем запрос + при необходимости выводим сам запрос
$result = mysql::query($_sql, 0);
// выбираем фотоальбомы
$_sql = 'SELECT * FROM gallery_grupa where status=1 and id_parent=0 order by pole';
$gallery_grupa = mysql::query($_sql, 0);
return system::show_tpl(array('result' => $result, 'msg' => $this->msg, '_status' => isset($_POST['status']) ? $_POST['status'] : 2, 'gallery_grupa' => $gallery_grupa, 'tpl_folder' => $this->tpl_folder, '_total_gallery' => $_total_gallery), $this->tpl_folder . '/index.php');
}
示例13: linkCase
/**
* Link cases to a test task.
*
* @param int $taskID
* @access public
* @return void
*/
public function linkCase($taskID, $param = 'all', $recTotal = 0, $recPerPage = 20, $pageID = 1)
{
if (!empty($_POST)) {
$this->testtask->linkCase($taskID);
$this->locate(inlink('cases', "taskID={$taskID}"));
}
/* Save session. */
$this->session->set('caseList', $this->app->getURI(true));
/* Get task and product id. */
$task = $this->testtask->getById($taskID);
$productID = $this->product->saveState($task->product, $this->products);
/* Load pager. */
$this->app->loadClass('pager', $static = true);
$pager = pager::init($recTotal, $recPerPage, $pageID);
/* Build the search form. */
$this->loadModel('testcase');
$this->config->testcase->search['params']['product']['values'] = array($productID => $this->products[$productID], 'all' => $this->lang->testcase->allProduct);
$this->config->testcase->search['params']['module']['values'] = $this->loadModel('tree')->getOptionMenu($productID, $viewType = 'case');
$this->config->testcase->search['actionURL'] = inlink('linkcase', "taskID={$taskID}");
$this->view->searchForm = $this->fetch('search', 'buildForm', $this->config->testcase->search);
/* Save session. */
$this->testtask->setMenu($this->products, $productID);
$this->view->header['title'] = $this->products[$productID] . $this->lang->colon . $this->lang->testtask->linkCase;
$this->view->position[] = html::a($this->createLink('testtask', 'browse', "productID={$productID}"), $this->products[$productID]);
$this->view->position[] = $this->lang->testtask->linkCase;
/* Get cases. */
if ($this->session->testcaseQuery == false) {
$this->session->set('testcaseQuery', ' 1 = 1');
}
$query = str_replace("`product` = 'all'", '1', $this->session->testcaseQuery);
// If search all product, replace product = all to 1=1
$linkedCases = $this->dao->select('`case`')->from(TABLE_TESTRUN)->where('task')->eq($taskID)->fetchPairs('case');
if ($param == 'all') {
$cases = $this->dao->select('*')->from(TABLE_CASE)->where($query)->andWhere('product')->eq($productID)->andWhere('id')->notIN($linkedCases)->andWhere('deleted')->eq(0)->orderBy('id desc')->page($pager)->fetchAll();
}
if ($param == 'bystory') {
$stories = $this->dao->select('stories')->from(TABLE_BUILD)->where('id')->eq($task->build)->fetch('stories');
$cases = $this->dao->select('*')->from(TABLE_CASE)->where($query)->andWhere('product')->eq($productID)->beginIF($linkedCases)->andWhere('id')->notIN($linkedCases)->fi()->andWhere('story')->in($stories)->andWhere('deleted')->eq(0)->orderBy('id desc')->page($pager)->fetchAll();
}
if ($param == 'bybug') {
$bugs = $this->dao->select('bugs')->from(TABLE_BUILD)->where('id')->eq($task->build)->fetch('bugs');
$cases = $this->dao->select('*')->from(TABLE_CASE)->where($query)->andWhere('product')->eq($productID)->beginIF($linkedCases)->andWhere('id')->notIN($linkedCases)->fi()->andWhere('fromBug')->in($bugs)->andWhere('deleted')->eq(0)->orderBy('id desc')->page($pager)->fetchAll();
}
$this->view->users = $this->loadModel('user')->getPairs('noletter');
$this->view->cases = $cases;
$this->view->taskID = $taskID;
$this->view->pager = $pager;
$this->display();
}
示例14: isset
?>
href="<?php
echo isset($_GET['id']) ? general::link('filter/id/' . $_GET['id'] . '/type_sort/2') : general::link('filter/type_sort/2');
?>
">Я>А</a> </div>
</div><!-- .srt_block-->
<div class="tovar_list_3">
<?php
foreach ($result as $obj) {
?>
<?php
echo system::show_tpl(array('obj' => $obj, 'level' => ''), '/frontend/catalog/list_index.php');
?>
<?php
}
?>
</div><!-- .tovar_list_3-->
<?php
// pager
if (isset($_GET['id'])) {
echo filter::get_count() > CATALOG_AT_PAGE ? pager::pager_J("filter/id/" . $_GET['id'], CATALOG_AT_PAGE, filter::get_count(), intval($_GET['page'])) : '';
} else {
echo filter::get_count() > CATALOG_AT_PAGE ? pager::pager_J("filter", CATALOG_AT_PAGE, filter::get_count(), intval($_GET['page'])) : '';
}
示例15: dynamic
/**
* Product dynamic.
*
* @param string $type
* @param string $orderBy
* @param int $recTotal
* @param int $recPerPage
* @param int $pageID
* @access public
* @return void
*/
public function dynamic($productID = 0, $type = 'today', $param = '', $orderBy = 'date_desc', $recTotal = 0, $recPerPage = 20, $pageID = 1)
{
/* Save session. */
$uri = $this->app->getURI(true);
$this->session->set('productList', $uri);
$this->session->set('productPlanList', $uri);
$this->session->set('releaseList', $uri);
$this->session->set('storyList', $uri);
$this->session->set('projectList', $uri);
$this->session->set('taskList', $uri);
$this->session->set('buildList', $uri);
$this->session->set('bugList', $uri);
$this->session->set('caseList', $uri);
$this->session->set('testtaskList', $uri);
$this->product->setMenu($this->products, $productID);
/* Append id for secend sort. */
$sort = $this->loadModel('common')->appendOrder($orderBy);
/* Set the pager. */
$this->app->loadClass('pager', $static = true);
$pager = pager::init($recTotal, $recPerPage, $pageID);
/* Set the user and type. */
$account = $type == 'account' ? $param : 'all';
$period = $type == 'account' ? 'all' : $type;
/* The header and position. */
$this->view->title = $this->products[$productID] . $this->lang->colon . $this->lang->product->dynamic;
$this->view->position[] = html::a($this->createLink($this->moduleName, 'browse'), $this->products[$productID]);
$this->view->position[] = $this->lang->product->dynamic;
/* Assign. */
$this->view->productID = $productID;
$this->view->type = $type;
$this->view->users = $this->loadModel('user')->getPairs('nodeleted|noletter');
$this->view->account = $account;
$this->view->orderBy = $orderBy;
$this->view->pager = $pager;
$this->view->param = $param;
$this->view->actions = $this->loadModel('action')->getDynamic($account, $period, $sort, $pager, $productID);
$this->display();
}