本文整理汇总了PHP中Pagination::getLimit方法的典型用法代码示例。如果您正苦于以下问题:PHP Pagination::getLimit方法的具体用法?PHP Pagination::getLimit怎么用?PHP Pagination::getLimit使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Pagination
的用法示例。
在下文中一共展示了Pagination::getLimit方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: index
function index()
{
$this->getView()->addStylesheetURL('assets/stylesheets/sorting.css');
$customer_id = \Yoda\Request::getInt('customer_id');
$destination = \Yoda\Request::getString('destination');
$source = \Yoda\Request::getString('source');
$success = \Yoda\Request::getString('success', '');
$from_date = \Yoda\Request::getString('from_date');
$to_date = \Yoda\Request::getString('to_date');
$order = \Yoda\Request::getString('order', 'destination');
$direction = \Yoda\Request::getString('direction', 'ASC');
$pagination = new Pagination();
$pagination->setLimit(10);
$pagination->setPage(\Yoda\Request::getInt('page', 1));
$pagination->setLink('index.php?controller=sms&customer_id=' . $customer_id . '&destination=' . $destination . '&source=' . $source . '&success=' . $success . '&from_date=' . $from_date . '&to_date=' . $to_date);
$sms = new Didww\API2\SMSCollection();
$sms->setCustomerId($customer_id);
$sms->setDestination($destination);
$sms->setSource($source);
if ($success !== '') {
$sms->setSuccess($success);
}
$sms->setFromDate($from_date);
$sms->setToDate($to_date);
$sms->setOrderBy($order);
$sms->setOrderDir(strtoupper($direction));
$sms->setLimit($pagination->getLimit());
$sms->setOffset($pagination->getOffset());
$sms_log = $sms->getList();
$total = $sms->getTotal();
$pagination->setTotal($total);
$this->getView()->setProperties(['view' => $this->getView(), 'sms_log' => $sms_log, 'customer_id' => $customer_id, 'destination' => $destination, 'source' => $source, 'success' => $success, 'from_date' => $from_date, 'to_date' => $to_date, 'pagination' => $pagination, 'order' => $order, 'direction' => $direction, 'total' => $total])->display();
}
示例2: index
function index()
{
$this->getView()->addStylesheetURL('assets/stylesheets/sorting.css');
$customer_id = \Yoda\Request::getInt('customer_id');
$did_number = \Yoda\Request::getString('did_number');
$from_date = \Yoda\Request::getString('from_date');
$to_date = \Yoda\Request::getString('to_date');
$order = \Yoda\Request::getString('order', 'duration');
$direction = \Yoda\Request::getString('direction', 'ASC');
$pagination = new Pagination();
$pagination->setLimit(10);
$pagination->setPage(\Yoda\Request::getInt('page', 1));
$pagination->setLink('index.php?controller=call_history&did_number=' . $did_number . '&customer_id=' . $customer_id . '&from_date=' . $from_date . '&to_date=' . $to_date);
$cdr = new Didww\API2\CDRCollection();
$cdr->setCustomerId($customer_id);
$cdr->setDidNumber($did_number);
$cdr->setFromDate($from_date);
$cdr->setToDate($to_date);
$cdr->setOrderBy($order);
$cdr->setOrderDir(strtoupper($direction));
$cdr->setLimit($pagination->getLimit());
$cdr->setOffset($pagination->getOffset());
$cdrs = $cdr->getList();
$total = $cdr->getTotal();
$pagination->setTotal($total);
$this->getView()->setProperties(['view' => $this->getView(), 'cdrs' => $cdrs, 'customer_id' => $customer_id, 'did_number' => $did_number, 'from_date' => $from_date, 'to_date' => $to_date, 'pagination' => $pagination, 'order' => $order, 'direction' => $direction, 'total' => $total])->display();
}
示例3: Pagination
$rsc = $conn->execute($sql);
$total_related = $rsc->fields['total_games'];
if ($total_related > 50) {
$total_related = 50;
}
$pagination = new Pagination(10, 'p_related_games_' . $game['GID'] . '_');
$limit = $pagination->getLimit($total_related);
$sql = "SELECT GID, title, addtime, rate, total_plays, type FROM game\n WHERE status = '1' AND category = '" . $game['category'] . "' AND GID != " . $gid . "\n AND ( title LIKE '%" . mysql_real_escape_string($game['title']) . "%' " . $sql_add . ")\n ORDER BY addtime DESC LIMIT " . $limit;
$rs = $conn->execute($sql);
$games = $rs->getrows();
$page_link = $pagination->getPagination('game');
$sql = "SELECT COUNT(CID) AS total_comments FROM game_comments WHERE GID = " . $gid . " AND status = '1'";
$rsc = $conn->execute($sql);
$total_comments = $rsc->fields['total_comments'];
$pagination = new Pagination(10);
$limit = $pagination->getLimit($total_comments);
$sql = "SELECT c.CID, c.UID, c.comment, c.addtime, s.username, s.photo, s.gender\n FROM game_comments AS c, signup AS s \n WHERE c.GID = " . $gid . " AND c.status = '1' AND c.UID = s.UID \n ORDER BY c.addtime DESC LIMIT " . $limit;
$rs = $conn->execute($sql);
$comments = $rs->getrows();
$page_link_c = $pagination->getPagination('game', 'p_game_comments_' . $game['GID'] . '_');
$page_link_cb = $pagination->getPagination('game', 'pp_game_comments_' . $game['GID'] . '_');
$start_num = $pagination->getStartItem();
$end_num = $pagination->getEndItem();
$self_title = $game['title'] . $seo['game_title'];
$self_description = $game['title'] . $seo['game_desc'];
$self_keywords = implode(', ', $game['tags']) . $seo['game_keywords'];
$smarty->assign('errors', $errors);
$smarty->assign('messages', $messages);
$smarty->assign('menu', 'games');
$smarty->assign('submenu', '');
$smarty->assign('play', true);
示例4: Datenbank
<?php
require_once "../../klassen/authentication.class.php";
require_once "../../config.php";
require_once "../../klassen/datenbank.class.php";
require_once "../../libs/smarty/Smarty.class.php";
require_once "../../klassen/bewohner.class.php";
require_once "../../klassen/geld.class.php";
require_once "../../klassen/pagination.class.php";
$datenbank = new Datenbank();
$sql = Geld::SQL_SELECT_COUNT;
$anzahl = $datenbank->queryDirektSingle($sql)["anzahl"];
$pagination = new Pagination($anzahl);
$sql = GELD::SQL_SELECT_ALL_JOIN_BEWOHNER . $pagination->getLimit();
$buchungen = $datenbank->queryArray($sql, array(), new BewohnerGeldFactory());
if (count($buchungen) > 0) {
$sql = Geld::SQL_SELECT_KASSENSTAND_BIS;
$kassenstand = $datenbank->queryDirektSingle($sql, array("datum" => $buchungen[0]->datum))["kassenstand"];
} else {
$kassenstand = 0;
}
$smarty = new Smarty();
$smarty->assign("flurName", $config["flurName"]);
$smarty->assign("rootDir", $config["rootDir"]);
$smarty->assign("pagination", $pagination);
$smarty->assign("buchungen", $buchungen);
$smarty->assign("filename", "/c4/geld/buchungen/index.php");
$smarty->assign("kassenstand", $kassenstand);
//$smarty->assign("", $);
$smarty->setTemplateDir("../../seiten/templates/geld/buchungen/");
$smarty->display("index.tpl");
示例5: constructQuery
if ($conn->Affected_Rows() === 1) {
$messages[] = 'Text advertise was successfuly ' . $action . 'ed!';
} else {
$errors[] = 'Failed to ' . $action . ' advertise! Are you sure this advertise exists?!';
}
$remove = '&a=' . $action . '&AID=' . $AID;
break;
default:
$errors[] = 'Invalid action! Allowed actions: delete, activate and suspend!';
}
}
$query = constructQuery();
$rs = $conn->execute($query['count']);
$total_advs = $rs->fields['total_advs'];
$pagination = new Pagination($query['items']);
$limit = $pagination->getLimit($total_advs);
$paging = $pagination->getAdminPagination($remove);
$sql = $query['select'] . " LIMIT " . $limit;
$rs = $conn->execute($sql);
$advs = $rs->getrows();
function constructQuery()
{
global $smarty;
$query = array();
$query_count = "SELECT COUNT(adv_id) AS total_advs FROM adv_text";
$query_select = "SELECT * FROM adv_text";
$query_add = NULL;
$option = array('sort' => 'adv_id', 'order' => 'DESC', 'display' => 20);
$option = isset($_SESSION['search_text_advertise']) ? $_SESSION['search_text_advertise'] : $option;
if (isset($_POST['search_text'])) {
$option['sort'] = trim($_POST['sort']);
示例6: constructQuery
$conn->execute($sql);
$_SESSION['message'] = 'Duration regenerated successfuly!';
$remove = '&=duration&VID=' . $VID;
VRedirect::go('videos.php?m=' . $module_keep . '&page=' . $page);
break;
}
} else {
$err = 'Invalid video id. Video does not exist!?';
}
}
$query = constructQuery($module_keep);
$sql = $query['count'];
$rs = $conn->execute($sql);
$total_videos = $rs->fields['total_videos'];
$pagination = new Pagination($query['page_items']);
$limit = $pagination->getLimit($total_videos);
$paging = $pagination->getAdminPagination($remove);
$sql = $query['select'] . " LIMIT " . $limit;
$rs = $conn->execute($sql);
$videos = $rs->getrows();
function constructQuery($module)
{
global $smarty;
$query_module = '';
if ($module == 'private' or $module == 'public') {
$query_module = " AND v.type = '" . $module . "'";
}
$query = array();
$query_select = "SELECT v.*,s.username FROM video AS v, signup AS s WHERE v.UID = s.UID" . $query_module;
$query_count = "SELECT count(v.VID) AS total_videos FROM video AS v WHERE v.VID != ''" . $query_module;
$query_add = $query_module != '' ? " AND" : " WHERE";
示例7: Datenbank
<?php
require_once "../../klassen/authentication.class.php";
$loginErforderlich = false;
require_once "../../config.php";
require_once "../../klassen/datenbank.class.php";
require_once "../../libs/smarty/Smarty.class.php";
require_once "../../klassen/bewohner.class.php";
require_once "../../klassen/pagination.class.php";
$datenbank = new Datenbank();
$sql = Bewohner::SQL_SELECT_COUNT;
$res = $datenbank->queryDirektSingle($sql);
$anzahl = $res["COUNT(*)"];
$pagination = new Pagination($anzahl);
$sql = Bewohner::SQL_SELECT_ALL_JOIN . $pagination->getLimit();
$bewohner = $datenbank->queryArray($sql, array(), new BewohnerFactory());
$smarty = new Smarty();
$smarty->assign("flurName", $config["flurName"]);
$smarty->assign("rootDir", $config["rootDir"]);
$smarty->setTemplateDir("../../seiten/templates/bewohner/alle");
$smarty->assign("zimmerAnzahl", $config["zimmerAnzahl"]);
$smarty->assign("bewohner", $bewohner);
$smarty->assign("pagination", $pagination);
$smarty->assign("filename", "/flur/bewohner/alle/index.php");
$smarty->display("index.tpl");
示例8: COUNT
break;
case 'mv':
$sql_add .= " ORDER BY s.profile_viewed DESC";
break;
case 'on':
$sql_add .= " ORDER BY s.logintime DESC";
break;
case 'ma':
$sql_add .= " ORDER BY s.video_viewed+s.profile_viewed+s.watched_video DESC";
break;
}
$sql = "SELECT COUNT(s.UID) AS total_users FROM signup AS s, users_online AS o\n WHERE s.account_status = 'Active' AND s.UID = o.UID" . $sql_add_count;
$rsc = $conn->execute($sql);
$total_users = $rsc->fields['total_users'];
$pagination = new Pagination($config['users_per_page']);
$limit = $pagination->getLimit($total_users);
$sql = "SELECT s.UID, s.username, s.photo, s.gender FROM signup AS s, users_online AS o\n WHERE s.account_status = 'Active' AND s.UID = o.UID" . $sql_add . " LIMIT " . $limit;
$rs = $conn->execute($sql);
$users = $rs->getrows();
$page_link = $pagination->getPagination('search');
$start_num = $pagination->getStartItem();
$end_num = $pagination->getEndItem();
$smarty->assign('users', $users);
$smarty->assign('users_total', $total_users);
$smarty->assign('page_link', $page_link);
$smarty->assign('start_num', $start_num);
$smarty->assign('end_num', $end_num);
$smarty->assign('order', $order);
$smarty->assign('gender', $gender);
$smarty->assign('interest', $interest);
$smarty->assign('avatar', $avatar);
示例9: constructQuery
case 'activate':
case 'suspend':
$status = $action == 'activate' ? 1 : 0;
$sql = "UPDATE notice SET status = '" . $status . "' WHERE NID = " . $NID . " LIMIT 1";
$conn->execute($sql);
$messages[] = 'Successfully ' . $action . 'ed notice!';
$remove = '&a=' . $action . '&NID=' . $NID;
break;
}
}
$query = constructQuery();
$sql = $query['count'];
$rsc = $conn->execute($sql);
$total_notices = $rsc->fields['total_notices'];
$pagination = new Pagination($query['page_items']);
$limit = $pagination->getLimit($total_notices);
$paging = $pagination->getAdminPagination($remove);
$sql = $query['select'] . " LIMIT " . $limit;
$rs = $conn->execute($sql);
$notices = $rs->getrows();
function constructQuery()
{
global $smarty;
$query = array();
$query_select = "SELECT * FROM notice";
$query_count = "SELECT COUNT(NID) AS total_notices FROM notice";
$query_add = " WHERE";
$query_option = array();
$option_orig = array('username' => '', 'title' => '', 'content' => '', 'sort' => 'UID', 'order' => 'DESC', 'display' => 10);
$all = isset($_GET['all']) ? intval($_GET['all']) : 0;
if ($all == 1) {
示例10: elseif
if ($wall_public == '1') {
$show_wall = true;
} else {
if ($is_friend) {
$show_wall = true;
} elseif (isset($_SESSION['uid']) && $_SESSION['uid'] == $uid) {
$show_wall = true;
}
}
if ($show_wall) {
require 'classes/pagination.class.php';
$sql = "SELECT COUNT(wall_id) AS total_walls FROM wall WHERE OID = " . $uid . " AND status = '1'";
$rsc = $conn->execute($sql);
$walls_total = $rsc->fields['total_walls'];
$pagination = new Pagination(10);
$limit = $pagination->getLimit($walls_total);
$sql = "SELECT w.wall_id, w.UID, w.message, w.addtime, u.username, u.photo, u.gender\n FROM wall AS w, signup AS u WHERE w.OID = " . $uid . " AND w.status = '1' AND w.UID = u.UID \n ORDER BY w.addtime DESC LIMIT 10";
$rs = $conn->execute($sql);
$walls = $rs->getrows();
$page_link = $pagination->getPagination('user/' . $username, 'p_wall_comments_' . $uid . '_');
$smarty->assign('page_link', $page_link);
}
$blog = array();
$sql = "SELECT BID, UID, title, content, total_views, total_comments, addtime\n FROM blog WHERE UID = " . $uid . " AND status = '1'\n ORDER BY addtime DESC LIMIT 1";
$rs = $conn->execute($sql);
if ($conn->Affected_Rows() == 1) {
$blog = $rs->getrows();
$blog = $blog['0'];
}
$sql = "UPDATE signup SET profile_viewed = profile_viewed+1, popularity = popularity+0.1 WHERE UID = " . $uid . " LIMIT 1";
$conn->execute($sql);
示例11: constructQuery
if ($action == 'activate') {
send_album_approve_email($AID);
}
$messages[] = 'Album was successfully ' . $action . 'ed!';
break;
}
} else {
$errors[] = 'Invalid album identifier. Are you sure this album exists!?';
}
}
$query = constructQuery($module_keep);
$sql = $query['count'];
$rs = $conn->execute($sql);
$total_albums = $rs->fields['total_albums'];
$pagination = new Pagination($query['page_items']);
$limit = $pagination->getLimit($total_albums);
$paging = $pagination->getAdminPagination($remove);
$sql = $query['select'] . " LIMIT " . $limit;
$rs = $conn->execute($sql);
$albums = $rs->getrows();
function constructQuery($module)
{
global $smarty;
$query_module = '';
if ($module == 'private' or $module == 'public') {
$query_module = " AND a.type = '" . $module . "'";
}
$query = array();
$query_select = "SELECT a.*, s.username FROM albums AS a, signup AS s WHERE a.UID = s.UID" . $query_module;
$query_count = "SELECT count(a.AID) AS total_albums FROM albums AS a WHERE a.AID != ''" . $query_module;
$query_add = $query_module != '' ? " AND" : " WHERE";
示例12: intval
}
if ($table == 'all') {
function compare_time($a, $b)
{
$a_time = intval($a['time']);
$b_time = intval($b['time']);
if ($a_time === $b_time) {
return 0;
}
return $a_time < $b_time ? 1 : -1;
}
usort($feeds, 'compare_time');
}
if ($subscriptions) {
$pagination = new Pagination(40);
$limit = $pagination->getLimit($total_feeds);
$page_link = $pagination->getPagination('feeds');
}
$self_title = $config['site_title'];
$self_meta_description = $config['meta_description'];
$self_meta_keywords = $config['meta_keywords'];
$smarty->assign('subscriptions', $subscriptions);
$smarty->assign('username', $username);
$smarty->assign('table', $table);
$smarty->assign('feeds', $feeds);
$smarty->assign('page_link', $page_link);
$smarty->assign('self_title', $self_title);
$smarty->assign('self_meta_description', $self_meta_description);
$smarty->assign('self_meta_keywords', $self_meta_keywords);
$smarty->display('header.tpl');
$smarty->display('errors.tpl');
示例13: constructQuery
$messages[] = 'Successfully ' . $perform . ' game!';
} else {
$errors[] = 'Failed to ' . $action . ' game! Are you sure this game exists?!';
}
$remove = '&a=' . $action . '&GID=' . $GID;
break;
default:
$errors[] = 'Invalid action. Allowed actions: delete, activate, suspend and unflag!';
}
}
$query = constructQuery();
$sql = $query['count'];
$rs = $conn->execute($sql);
$total_games = $rs->fields['total_games'];
$pagination = new Pagination($query['page_items']);
$limit = $pagination->getLimit($total_games);
$paging = $pagination->getAdminPagination($remove);
$sql = $query['select'] . " LIMIT " . $limit;
$rs = $conn->execute($sql);
$games = $rs->getrows();
function constructQuery()
{
global $smarty;
$query = array();
$query_select = "SELECT g.*, s.username, f.UID AS SUID, f.FID, f.add_date, f.reason, f.message\n FROM game AS g, signup AS s, game_flags AS f\n WHERE g.GID = f.GID AND g.UID = s.UID";
$query_count = "SELECT COUNT(g.GID) AS total_games FROM game AS g, signup AS s, game_flags AS f\n WHERE g.GID = f.GID AND g.UID = s.UID";
$query_option = array();
$option = array('username' => '', 'title' => '', 'flagger' => '', 'sort' => 'g.GID', 'order' => 'DESC', 'display' => 10);
if (isset($_POST['search_games'])) {
$option['username'] = trim($_POST['username']);
$option['title'] = trim($_POST['title']);
示例14: Datenbank
<?php
require_once "../../klassen/authentication.class.php";
$loginErforderlich = false;
require_once "../../config.php";
require_once "../../klassen/datenbank.class.php";
require_once "../../libs/smarty/Smarty.class.php";
require_once "../../klassen/bewohner.class.php";
require_once "../../klassen/belegung.class.php";
require_once "../../klassen/pagination.class.php";
$datenbank = new Datenbank();
$sql = Belegung::SQL_SELECT_COUNT;
$res = $datenbank->queryDirektSingle($sql);
$anzahl = $res["COUNT(*)"];
$pagination = new Pagination($anzahl);
$sql = Belegung::SQL_SELECT_ALLE_JOIN_BEWOHNER_SORTIERT . $pagination->getLimit();
$belegungen = $datenbank->queryArray($sql, array(), new BewohnerBelegungFactory());
$smarty = new Smarty();
$smarty->assign("flurName", $config["flurName"]);
$smarty->assign("rootDir", $config["rootDir"]);
$smarty->setTemplateDir("../../seiten/templates/belegung/alle");
$smarty->assign("zimmerAnzahl", $config["zimmerAnzahl"]);
$smarty->assign("belegungen", $belegungen);
$smarty->assign("pagination", $pagination);
$smarty->assign("filename", "/flur/belegung/alle/index.php");
$smarty->display("index.tpl");
示例15: COUNT
if ($conn->Affected_Rows() == 1) {
$sql = "DELETE FROM spam WHERE type = 'video' AND comment_id = " . $CID;
$conn->execute($sql);
$messages[] = 'Successfully deleted comment!';
} else {
$errors[] = 'Failed to delete comment! Are you sure this comment exists?!';
}
break;
case 'unspam':
$sql = "DELETE FROM spam WHERE type = 'video' AND spam_id = " . $SID;
$conn->execute($sql);
if ($conn->Affected_Rows() > 0) {
$messages[] = 'Successfully unspamed this comment!';
} else {
$errors[] = 'Failed to unspam comment! Are you sure this spam flag exists?!';
}
break;
}
}
$sql = "SELECT COUNT(spam_id) AS total_spam FROM spam WHERE type = 'video'";
$rs = $conn->execute($sql);
$total_spam = $rs->fields['total_spam'];
$pagination = new Pagination(20);
$limit = $pagination->getLimit($total_spam);
$paging = $pagination->getAdminPagination($remove);
$sql = "SELECT s.spam_id, s.UID AS RID, s.addtime AS add_time, c.*, u.username\n FROM spam AS s, video_comments AS c, signup AS u\n WHERE s.comment_id = c.CID AND s.parent_id = c.VID AND c.UID = u.UID\n LIMIT " . $limit;
$rs = $conn->execute($sql);
$comments = $rs->getrows();
$smarty->assign('comments', $comments);
$smarty->assign('total_spam', $total_spam);
$smarty->assign('paging', $paging);