本文整理匯總了PHP中Pager::mod5方法的典型用法代碼示例。如果您正苦於以下問題:PHP Pager::mod5方法的具體用法?PHP Pager::mod5怎麽用?PHP Pager::mod5使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Pager
的用法示例。
在下文中一共展示了Pager::mod5方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: showlist
function showlist()
{
global $db;
global $smarty;
$page_size = getPageSize();
// 每頁顯示的條目數
$sub_pages = getSubPages();
// 每次顯示的頁數
$current_page = empty($_GET["p"]) ? "1" : $_GET["p"];
// 當前被選中的頁
// 消息類型: 0表示用戶發送 1表示管理員回複 2表示管理員群發消息 3 自動回複 4聊天室信息
$sql = "SELECT a.*, b.nickname, b.localnickname, b.backup, \r\n\t\tCONCAT(SUBSTR(b.headimgurl,1,(LENGTH(b.headimgurl) - 1)),'46') as headimgurl, c.content as replycontent , TIMESTAMPDIFF(SECOND ,a.createtime, date_format(now(),'%Y%m%d%h%m%s')) timeInterval\r\n \tfrom wx_user_msg a \r\n\t\tleft join wx_user_info b\r\n\t\t\ton a.createby = b.openid \r\n\t\tleft join wx_user_msg c\r\n\t\t\ton a.id = c.replyid\r\n\t\twhere a.msgtype in('0', '4', '5')\r\n\t\torder by createtime desc";
$res = $db->query_page_list2($sql, $page_size, $current_page);
$rowList = $db->fetch_all($res);
// 查總記錄數
$countres = $db->query("SELECT count(1) as totalcount from wx_user_msg a where a.msgtype in('0', '4')");
$countObj = $db->fetch($countres);
// 總條目數
$nums = $countObj["totalcount"];
//echo $nums."=======>";
$pager = new Pager($page_size, $nums, $current_page, $sub_pages);
//$pagerlinker = $pager -> commonPager();
$pagerlinker = $pager->mod5();
//echo print_r($rowList);
$smarty->assign('pager', $pagerlinker);
$smarty->assign('messageArray', $rowList);
$smarty->display('sysadmin/wxmessagelist.html');
}
示例2: showlist
function showlist()
{
global $db;
global $smarty;
$page_size = getPageSize();
// 每頁顯示的條目數
$sub_pages = getSubPages();
// 每次顯示的頁數
$current_page = empty($_GET["p"]) ? "1" : $_GET["p"];
// 當前被選中的頁
$sql = "SELECT * FROM wx_group_info";
$res = $db->query_page_list2($sql, $page_size, $current_page);
$rowList = $db->fetch_all($res);
// 查總記錄數
$countres = $db->query("SELECT count(1) as totalcount from wx_group_info");
$countObj = $db->fetch($countres);
// 總條目數
$nums = $countObj["totalcount"];
$pager = new Pager($page_size, $nums, $current_page, $sub_pages, false);
$pagerlinker = $pager->mod5();
$smarty->assign('pager', $pagerlinker);
$smarty->assign('groupArray', $rowList);
$smarty->display('sysadmin/wxgroup.html');
}
示例3: empty
<?php
require_once 'inc.php';
$table = 'cn_about';
$action = empty($_GET["action"]) ? '' : $_GET["action"];
if ($action == "") {
$where = " ";
$where .= @$_GET['keyword'] != '' ? " AND (username like '%" . @$_GET['keyword'] . "%') or (email LIKE '%" . @$_GET['keyword'] . "%') " : '';
$order = ' ORDER BY id DESC';
$page_size = 20;
$current_page = !@$_GET['p'] ? 1 : @$_GET['p'];
$nums = $db->query_count($table, $where);
$result = $db->query_page_list($table, $page_size, $current_page, $order, $where);
$userList = $db->fetch_all($result);
$pager = new Pager($page_size, $nums, $current_page, 8);
$link = $pager->mod5();
$smarty->assign('pager', $link);
$smarty->assign('userList', $userList);
}
if ($action == "delete") {
$id = @$_POST['id'];
$isbool = true;
if (!empty($id)) {
for ($i = 0; $i < count($id); $i++) {
$isbool = $db->delete($table, "id=" . $id[$i]);
}
if ($isbool !== false) {
success_msg('刪除成功', '?');
} else {
error_msg('刪除失敗', 'back');
}
示例4: groupusermanage
function groupusermanage()
{
$groupid = $_GET["groupid"];
if (empty($groupid)) {
return;
}
global $db;
global $smarty;
// 先查本組員
$userlistsql = "SELECT a.openid , a.groupid , b.nickname, b.localnickname, b.backup FROM wx_group_user a \r\n\t\t\tleft join wx_user_info b \r\n\t\t\ton a.openid = b.openid \r\n\t\t\twhere b.openid is not null and a.groupid ='{$groupid}'";
$groupUserListTemp = $db->fetch_all($db->query($userlistsql));
$groupUserList = array();
foreach ($groupUserListTemp as $groupUser) {
$nicknametemp = $groupUser["nickname"];
$groupUser["nickname"] = base64_decode($nicknametemp);
$groupUserList[] = $groupUser;
}
$page_size = getPageSize();
// 每頁顯示的條目數
$sub_pages = getSubPages();
// 每次顯示的頁數
$current_page = empty($_GET["p"]) ? "1" : $_GET["p"];
// 當前被選中的頁
// 再查所有不在本組的微信用戶
$otherusersql = "select * from wx_user_info where openid not in \r\n\t\t\t\t\t(select openid from wx_group_user where groupid = '{$groupid}')";
//$otheruserlist = $db->fetch_all($db->query($otherusersql));
$res = $db->query_page_list2($otherusersql, $page_size, $current_page);
$otheruserlist = $db->fetch_all($res);
$userlistTemp = array();
foreach ($otheruserlist as $user) {
$nicknametemp = $user["nickname"];
$user["nickname"] = base64_decode($nicknametemp);
$userlistTemp[] = $user;
}
$countres = $db->query("SELECT count(1) as totalcount from wx_user_info where openid not in \r\n\t\t\t\t\t(select openid from wx_group_user where groupid = '{$groupid}')");
$countObj = $db->fetch($countres);
// 總條目數
$nums = $countObj["totalcount"];
$pager = new Pager($page_size, $nums, $current_page, $sub_pages, true);
$pagerlinker = $pager->mod5();
$smarty->assign('pager', $pagerlinker);
// 本組已有的用戶列表
$smarty->assign('groupUserList', $groupUserList);
// 所有用戶列表
$smarty->assign('otheruserlist', $userlistTemp);
// 目標組id
$smarty->assign('groupid', $groupid);
$smarty->display('sysadmin/wxgroupusermanage.html');
}