本文整理汇总了PHP中tools::paginate方法的典型用法代码示例。如果您正苦于以下问题:PHP tools::paginate方法的具体用法?PHP tools::paginate怎么用?PHP tools::paginate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类tools
的用法示例。
在下文中一共展示了tools::paginate方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: debits
function debits()
{
if (isset($_SESSION['user_id'])) {
$user_id = $_SESSION['user_id'];
if (isset($_GET['page'])) {
$page = tools::filter($_GET['page']);
} else {
$page = 1;
}
$sql = "SELECT auction_id, description, debit, created FROM " . DB_PREFIX . "bids";
if (isset($_GET['auction_id'])) {
$conditions = "WHERE user_id=" . $user_id . " AND debit > 0 AND credit = 0 AND auction_id=" . $_GET['auction_id'] . " ORDER BY created DESC";
} else {
$conditions = "WHERE user_id=" . $user_id . " AND debit > 0 AND credit = 0 ORDER BY created DESC";
}
list($bids, $pagination) = tools::paginate($sql, $conditions, "" . DB_PREFIX . "bids", $page, $this->settings['app']['per_page']);
$this->smarty->assign(array('bids' => $bids, 'pagination' => $pagination));
$this->smarty->display('user/debits.tpl');
} else {
tools::setFlash($this->l('Please log in to access this area'), 'error');
tools::redirect('/user/login');
}
}