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'); }
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'); }
<?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'); }
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'); }