当前位置: 首页>>代码示例>>PHP>>正文


PHP Pager::mod5方法代码示例

本文整理汇总了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');
}
开发者ID:jurimengs,项目名称:bangsm,代码行数:28,代码来源:wxmessagelist.php

示例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');
}
开发者ID:jurimengs,项目名称:bangsm,代码行数:24,代码来源:wxgroup.php

示例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');
        }
开发者ID:jurimengs,项目名称:bangsm,代码行数:31,代码来源:yuyue.php

示例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');
}
开发者ID:jurimengs,项目名称:bangsm,代码行数:49,代码来源:wxgroupuser.php


注:本文中的Pager::mod5方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。