function financial_rewardpunish_list() { /*//note 处理搜索会员聊天 if($_GET['action'] == 'active_chat') { $choose = MooGetGPC('choose','string'); $keyword = MooGetGPC('keyword','string'); $where = ''; if(!empty($choose) && !empty($keyword)) { if($choose == 's_content') { $where = " WHERE $choose like '%$keyword%'"; }else{ $where = " WHERE $choose = '$keyword'"; } } } //note 登陆系统后客服显示自己范围内的, 主管显示全部 $return_arr = active_chat_loginlist($where,$keyword); $where = $return_arr['where']; $member_arr = $return_arr['members']; //note 分页处理 $page = max(1,MooGetGPC('page','integer')); $limit = 15; $offset = ($page-1)*$limit; //note 查询语句 if($where != '1') { //note 只查询属于该客服下的用户 //note 数据库查询 $sql = "SELECT COUNT(*) num FROM {$GLOBALS['dbTablePre']}service_chat $where"; $total = $GLOBALS['_MooClass']['MooMySQL']->getOne($sql); $sql = "SELECT * FROM {$GLOBALS['dbTablePre']}service_chat $where ORDER BY s_id DESC LIMIT {$offset},{$limit}"; $user_arr = $GLOBALS['_MooClass']['MooMySQL']->getAll($sql); } //note 搜索分页处理 if(!empty($choose) && !empty($keyword)) { $currenturl = "index.php?action=active_chat&h=list&choose=$choose&keyword=".urlencode($keyword); }else { $currenturl = "index.php?action=active_chat&h=list"; } $pages = multipage( $total['num'], $limit, $page, $currenturl ); //note 跳转到某一页 $page_num = ceil($total['num']/$limit); */ $sql = "SELECT * FROM {$GLOBALS['dbTablePre']}financial_rewardpunish"; $user_arr = $GLOBALS['_MooClass']['MooMySQL']->getAll($sql); foreach ($user_arr as $k => $v) { $sql = "SELECT * FROM {$GLOBALS['dbTablePre']}admin_user WHERE uid='{$v['uid']}'"; $user = $GLOBALS['_MooClass']['MooMySQL']->getOne($sql); $user_arr[$k]['name'] = $user['name']; } //note 插入日志 serverlog(1, $GLOBALS['dbTablePre'] . 'financial_rewardpunish', "{$GLOBALS['username']}查看奖惩订单列表", $GLOBALS['adminid']); //note 调用模板 require adminTemplate('financial_rewardpunish_list'); }
function site_media_edit() { $ispost = MooGetGPC('ispost', 'integer', 'P'); if ($ispost) { $id = MooGetGPC('id', 'integer', 'P'); $title = MooGetGPC('title', 'string', 'P'); $type = MooGetGPC('type', 'string', 'P'); $addtime = strtotime(MooGetGPC('addtime', 'string', 'P')); $source = MooGetGPC('source', 'string', 'P'); $content = MooGetGPC('content', 'string', 'P'); if (empty($content)) { salert("内容不能为空"); } $sql = "UPDATE {$GLOBALS['dbTablePre']}media SET sid = {$GLOBALS['adminid']},type = '{$type}', title = '{$title}', content = '{$content}', addtime = '{$addtime}', source = '{$source}' WHERE id={$id}"; $GLOBALS['_MooClass']['MooMySQL']->query($sql); //note 插入日志 serverlog(2, $GLOBALS['dbTablePre'] . 'media', "{$GLOBALS['username']}编辑媒体报道", $GLOBALS['adminid']); salert("编辑成功", "index.php?action=site_media&h=edit&id=" . $id); } $isedit = 1; $id = MooGetGPC('id', 'integer', 'G'); $sql = "SELECT * FROM {$GLOBALS['dbTablePre']}media WHERE id = {$id}"; $news = $GLOBALS['_MooClass']['MooMySQL']->getOne($sql); require adminTemplate('site_media_add'); }
function transfer_modify() { $id = MooGetGPC('id', 'integer', 'G'); if ($_POST['ispost']) { $id = MooGetGPC('modifyid', 'integer', 'P'); $data['sid'] = MooGetGPC('sid', 'integer', 'P'); $data['uid'] = MooGetGPC('uid', 'integer', 'P'); $data['servicetime'] = MooGetGPC('servicetime', 'integer', 'P'); $data['payments'] = MooGetGPC('payments', 'integer', 'P'); $data['otheruid'] = MooGetGPC('otheruid', 'integer', 'P'); $data['chatnotes'] = MooGetGPC('chatnotes', 'string', 'P'); $data['intro'] = MooGetGPC('intro', 'string', 'P'); $data['otherintro'] = MooGetGPC('otherintro', 'string', 'P'); $data['lastcom'] = MooGetGPC('lastcom', 'string', 'P'); $data['remark'] = MooGetGPC('remark', 'string', 'P'); foreach ($data as $k => $v) { $set_pram[] .= $k . "='{$v}'"; } $set_pram = implode(',', $set_pram); $sql = "UPDATE {$GLOBALS['dbTablePre']}members_transfer SET {$set_pram} WHERE id=" . $id; $GLOBALS['_MooClass']['MooMySQL']->query($sql); salert('修改成功!', 'index.php?action=other_members_transfer&h=list'); } elseif ($id > 0) { $sql = "SELECT * FROM {$GLOBALS['dbTablePre']}members_transfer WHERE `id`=" . $id; $transfer = $GLOBALS['_MooClass']['MooMySQL']->getOne($sql); } require adminTemplate('transfer_modify'); }
function active_rightbottom_sitemail() { if ($_POST) { $sid = MooGetGPC('msg_sid', 'integer', 'P'); if (empty($_POST['msg_sid']) && !empty($_POST['msg_username'])) { $username = MooGetGPC('msg_username', 'string', 'P'); $sql = "SELECT uid FROM {$GLOBALS['dbTablePre']}admin_user WHERE username='******'"; $admin_user = $GLOBALS['_MooClass']['MooMySQL']->getOne($sql); if (empty($admin_user)) { salert('此用户不存在'); exit; } $sid = $admin_user['uid']; } $data['sid'] = $sid; $data['title'] = "{$GLOBALS['adminid']}号客服:" . MooGetGPC('msg_title', 'string', 'P'); $data['content'] = MooGetGPC('msg_content', 'string', 'P'); $data['awoketime'] = time() + 120; $data['dateline'] = time(); $data['send_id'] = $GLOBALS['adminid']; inserttable('admin_remark', $data); salert('发送成功'); exit; } $group_list = get_group_type(); require adminTemplate('other_rightbottom_sitemail'); }
function system_adminaction_edit() { global $menu_nav_arr, $dbTablePre; $actionid = MooGetGPC('actionid', 'integer'); $ispost = MooGetGPC('ispost', 'integer'); if (empty($actionid)) { MooMessageAdmin('参数错误', 'index.php?action=adminaction&h=list', 1); } if ($ispost) { $actiondesc = MooGetGPC('actiondesc', 'string'); $actioncode = MooGetGPC('actioncode', 'string'); $navcode = MooGetGPC('navcode', 'string'); $navname = MooGetGPC('navname', 'string'); if (empty($actiondesc) || empty($actioncode) || empty($navcode) || empty($navname)) { $admin->showMessage('请将信息填写完整', 'index.php?action=adminaction&h=add', 1); } $sql = "UPDATE {$GLOBALS['dbTablePre']}admin_action SET navname='{$navname}',navcode='{$navcode}',actioncode='{$actioncode}',actiondesc='{$actiondesc}' WHERE id='{$actionid}'"; $result = $GLOBALS['_MooClass']['MooMySQL']->query($sql); if ($result) { //note 插入日志 serverlog(2, $GLOBALS['dbTablePre'] . 'admin_action', "{$GLOBALS['username']}修改操作{$actionid}", $GLOBALS['adminid']); salert('修改成功', 'index.php?action=system_adminaction&h=list'); //MooMessageAdmin('修改成功','index.php?action=system_adminaction&h=list',1); } else { salert('修改失败', 'index.php?action=system_adminaction&h=list'); //MooMessageAdmin('修改失败','index.php?action=system_adminaction&h=list',1); } } $sql = "SELECT * FROM {$GLOBALS['dbTablePre']}admin_action WHERE id='{$actionid}'"; $adminaction = $GLOBALS['_MooClass']['MooMySQL']->getOne($sql); require_once adminTemplate('adminaction_edit'); }
function login_index() { global $memcached; $seccode = md5(uniqid(rand(), true)); MooSetCookie('seccode', $seccode, time() + 3600, ''); $session_seccode = $memcached->set($seccode, '', 0, 300); require adminTemplate("login_index"); }
function financial_telphonetime_list() { $sid_get = 1; $sid = $sid_get + 800; //note 查询出所有的客服 $sql = "SELECT * FROM {$GLOBALS['dbTablePre']}admin_user"; $user_arr = $GLOBALS['_MooClass']['MooMySQL']->getAll($sql); /* $sql = "SELECT * FROM {$GLOBALS['dbTablePre']}admin_user WHERE uid='$v[uid]'"; $sql = "SELECT * FROM {$GLOBALS['dbTablePre']}financial_telphonetime"; $user_arr = $GLOBALS['_MooClass']['MooMySQL']->getAll($sql); foreach($user_arr as $k => $v){ $sql = " SELECT * FROM {$GLOBALS['dbTablePre']}admin_user WHERE uid='$v[uid]'"; $user = $GLOBALS['_MooClass']['MooMySQL']->getOne($sql); $user_arr[$k]['name'] = $user['name']; } */ /* //note 处理导出功能 if($_GET['export']) { ob_clean(); if(empty($user_arr)){ echo '没有找到符合条件的财务报表'; exit; } $today = date("Y-m-d"); header("Content-type:application/vnd.ms-excel; charset=gbk"); header("Content-Disposition:attachment; filename={$today}.xls"); echo iconv('utf-8','gbk','客服')."\t"; echo iconv('utf-8','gbk','电话时间')."\t"; echo iconv('utf-8','gbk','日期')."\t\n"; foreach($user_arr as $k => $v){ echo iconv('utf-8','gbk',$v['name'])."\t"; echo iconv('utf-8','gbk',$v['telphonetime'])."\t"; echo iconv('utf-8','gbk',date("Y-m-d",$v['dateline']))."\t\n"; } exit; } */ //note 插入日志 serverlog(1, $GLOBALS['dbTablePre'] . 'financial_telphonetime', "{$GLOBALS['username']}查看个人电话时间", $GLOBALS['adminid']); //note 调用模板 require adminTemplate('financial_telphonetime_list'); }
function activite_edit() { $db = $GLOBALS['db']; $mid = $_REQUEST['mid']; $sql = "select * from web_activity_img where mid = '{$mid}'"; $content = $db->getOne($sql); $group = $content[group]; $sort = $content[sort]; $addresses = explode('/', $content[address]); $address = array_pop($addresses); $hreffs = explode('=', $content[href]); $href = array_pop($hreffs); require adminTemplate('activity_img_add'); exit; }
function financial_ordertotal_list() { //note 处理搜索会员聊天 if ($_GET['action'] == 'financial_ordertotal') { $bgtime = MooGetGPC('bgtime', 'string'); $endtime = MooGetGPC('endtime', 'string'); $where = ' WHERE 1=1 '; if (!empty($bgtime) && !empty($endtime)) { $bgtime_arr = explode("-", $bgtime); $bgtime_mk = mktime(0, 0, 0, $bgtime_arr[1], $bgtime_arr[2], $bgtime_arr[0]); $endtime_arr = explode("-", $endtime); $endtime_mk = mktime(0, 0, 0, $endtime_arr[1], $endtime_arr[2], $endtime_arr[0]); if ($endtime < $bgtime) { echo "<script>alert('结束日期不能小于开始日期');window.location.href='index.php?action=financial_ordertotal&h=list'</script>"; exit; } $where .= " AND dateline >= '{$bgtime_mk}' AND dateline <= '{$endtime_mk}'"; } } //note 处理导出功能 $export = MooGetGPC('export', 'string', 'G'); //if($_GET['export']) { if ($export) { ob_clean(); if (empty($user_arr)) { echo '没有找到符合条件的财务报表'; exit; } $today = date("Y-m-d"); header("Content-type:application/vnd.ms-excel; charset=gbk"); header("Content-Disposition:attachment; filename={$today}.xls"); echo iconv('utf-8', 'gbk', '成功订单总数') . "\t"; echo iconv('utf-8', 'gbk', '日期') . "\t\n"; foreach ($user_arr as $k => $v) { echo iconv('utf-8', 'gbk', $v['name']) . "\t"; echo iconv('utf-8', 'gbk', date("Y-m-d", $v['dateline'])) . "\t\n"; } exit; } //note 数据库查询 $sql = "SELECT COUNT(*) num FROM {$GLOBALS['dbTablePre']}financial_orderok {$where}"; $total = $GLOBALS['_MooClass']['MooMySQL']->getOne($sql); //note 插入日志 serverlog(1, $GLOBALS['dbTablePre'] . 'financial_orderok', "{$GLOBALS['username']}查看成功订单总数记录列表", $GLOBALS['adminid']); //note 调用模板 require adminTemplate('financial_ordertotal_list'); }
function site_search_index() { global $_MooClass, $dbTablePre; $province = MooGetGPC('workprovince', 'integer', 'P'); $city = MooGetGPC('workcity', 'integer', 'P'); if (in_array($province, array(10101201, 10101002))) { //note 修正广东省深圳和广州的区域查询 $city = $province; $province = 10101000; } if (!isset($province) || !isset($city)) { require_once adminTemplate('site_member_recommend'); exit; } if (!isset($province)) { salert('请选择省市查看'); } //获取该城市的首页展示 $user_arr = array(); // $sql = "SELECT * FROM {$dbTablePre}members_recommend WHERE city='$city' and province = '$province' order by uid desc"; // original file $sql = "SELECT uid, sort,dateline FROM {$dbTablePre}members_recommend WHERE city='{$city}' and province = '{$province}' order by uid desc"; // updated file //echo $sql;exit; $user_arr = $_MooClass['MooMySQL']->getAll($sql); $uid_list = array(); $user_arr1 = array(); if ($user_arr) { foreach ($user_arr as $user) { $uid_list[] = $user['uid']; } $allow_uid = implode(',', $uid_list); $user_arr1 = $_MooClass['MooMySQL']->getAll("select nickname, birthyear, marriage, gender, city_star, s_cid from {$dbTablePre}members_search where uid in({$allow_uid}) order by uid desc"); $count = count($uid_list); for ($i = 0; $i < $count; $i++) { if (!empty($user_arr1[$i])) { $user_arr[$i] = array_merge($user_arr[$i], $user_arr1[$i]); } } } require_once adminTemplate('site_member_recommend'); }
function system_adminmembers_move() { global $dbTablePre, $_MooClass; $kefu_list = get_kefulist(); $is_post = MooGetGPC('ispost', 'integer', 'G'); $fromuser = MooGetGPC('fromuser', 'integer', 'G'); if ($is_post && $fromuser) { $grade = MooGetGPC('grade', 'integer', 'G'); $getuser = MooGetGPC('getuser', 'integer', 'G'); $move_num = MooGetGPC('move_num', 'integer', 'G'); if ($move_num) { $limit = "limit {$move_num}"; } if ($grade) { $sql = "update {$dbTablePre}members_search m left join {$dbTablePre}member_admininfo a on m.uid=a.uid set m.sid={$getuser} where m.sid={$fromuser} and a.effect_grade={$grade} {$limit}"; $sql2 = "select m.uid as uid from {$dbTablePre}members_search m left join {$dbTablePre}member_admininfo a on m.uid=a.uid where m.sid={$fromuser} and a.effect_grade={$grade} {$limit}"; } else { $sql = "update {$dbTablePre}members_search set sid={$getuser} where sid={$fromuser} {$limit}"; $sql2 = "select uid from {$dbTablePre}members_search where sid={$fromuser} {$limit}"; } $rs = $_MooClass['MooMySQL']->getAll($sql2); if (isset($rs) && $rs) { foreach ($rs as $k => $v) { $str_arr[$v] = array($getuser); } searchApi('members_man members_women')->updateAttr(array('sid'), $str_arr); } $_MooClass['MooMySQL']->query($sql); $num = $_MooClass['MooMySQL']->affectedRows(); if ($num) { $sql = "update {$dbTablePre}admin_user set member_count=member_count-'{$num}' where uid={$fromuser}"; $_MooClass['MooMySQL']->query($sql); $sql = "update {$dbTablePre}admin_user set member_count=member_count+'{$num}' where uid={$getuser}"; $_MooClass['MooMySQL']->query($sql); serverlog(4, $GLOBALS['dbTablePre'] . "members_search", "{$GLOBALS['username']}将{$fromuser}号客服的{$num}个会员转出", $GLOBALS['adminid'], $uid); } salert("成功转移" . $num . "名会员", "index.php?action=system_adminmembers&h=move"); } require_once adminTemplate('system_adminmembers_move'); }
function site_lovetype_add() { global $love_type; $ispost = MooGetGPC('ispost', 'integer', 'P'); if ($ispost) { $pid = MooGetGPC('pid', 'integer', 'P'); $ty_pe = MooGetGPC('ty_pe', 'integer', 'P'); $bgcounts = MooGetGPC('bgcounts', 'integer', 'P'); $endcounts = MooGetGPC('endcounts', 'integer', 'P'); $results = MooGetGPC('results', 'string', 'P'); $sql = "INSERT INTO {$GLOBALS['dbTablePre']}love_type(ty_pe, bgcounts, endcounts, results, pid) VALUES({$ty_pe}, {$bgcounts}, {$endcounts} ,'{$results}', {$pid})"; $GLOBALS['_MooClass']['MooMySQL']->query($sql); //note 插入日志 serverlog(3, $GLOBALS['dbTablePre'] . 'love_type', '添加测试评分结果', $GLOBALS['adminid']); salert("添加成功", "index.php?action=site_lovetype&h=add"); } // $sql = "SELECT * FROM {$GLOBALS['dbTablePre']}love_test "; // original file $sql = "SELECT qid, title FROM {$GLOBALS['dbTablePre']}love_test "; // updated file $lovetype_list = $GLOBALS['_MooClass']['MooMySQL']->getAll($sql); require adminTemplate('site_lovetype_add'); }
function music_add() { //note 指定会员POST $post_old_uid = !empty($_POST['old_uid']) ? $_POST['old_uid'] : ''; $post_uid = !empty($_POST['uid']) ? $_POST['uid'] : ''; $old_uid = $post_old_uid ? MooGetGPC('old_uid', 'integer', 'P') : MooGetGPC('uid', 'integer', 'G'); $uid = $post_uid ? MooGetGPC('uid', 'integer', 'P') : $old_uid; if (isset($_POST['ispost']) && !empty($uid)) { $ps = '信息不全'; //是否MP3 if (preg_match('/\\.mp3$/i', $_FILES['mp3']['name'])) { //限制大小6兆 if ($_FILES['mp3']['size'] < 6 * 1024 * 1024) { MooMakeDir(MP3_DIR . '/' . substr($uid, -2)); $file = str_replace('\\\\', '\\', $_FILES['mp3']['tmp_name']); $path = substr($uid, -2) . '/' . $uid . '_' . time() . '.mp3'; if (move_uploaded_file($file, MP3_DIR . $path)) { $title = MooGetGPC('title', 'string', 'P'); $path = $path; $note = MooGetGPC('note', 'string', 'P'); $dateline = time(); $sql = "INSERT INTO {$GLOBALS['dbTablePre']}art_music (uid,path,title,note,dateline) VALUES ('{$uid}','{$path}','{$title}','{$note}','{$dateline}')"; $insert = $GLOBALS['_MooClass']['MooMySQL']->query($sql); $ps = '添加音频成功...'; } else { $ps = '文件保存失败...'; } } else { $ps = 'MP3大小不能超过6KB...'; } } else { $ps = '请上传MP3格式...'; } salert($ps, 'index.php?action=diamond_music&h=list'); //echo "<script>window.history.go(-1);</script>"; } require adminTemplate('diamond_music_add'); }
function site_lovequestion_add() { global $love_type; $ispost = MooGetGPC('ispost', 'integer', 'P'); if ($ispost) { $qid = MooGetGPC('lovetype', 'integer', 'P'); $ty_pe = MooGetGPC('ty_pe', 'integer', 'P'); $title = MooGetGPC('title', 'string', 'P'); $ask1 = MooGetGPC('askvalue1', 'integer', 'P'); $ask2 = MooGetGPC('askvalue2', 'integer', 'P'); $ask3 = MooGetGPC('askvalue3', 'integer', 'P'); $ask4 = MooGetGPC('askvalue4', 'integer', 'P'); $ask5 = MooGetGPC('askvalue5', 'integer', 'P'); $sql = "INSERT INTO {$GLOBALS['dbTablePre']}love_question(qid,title,ty_pe,ask1,ask2,ask3,ask4,ask5) VALUES({$qid},'{$title}',{$ty_pe},{$ask1},{$ask2},{$ask3},{$ask4},{$ask5})"; $GLOBALS['_MooClass']['MooMySQL']->query($sql); //note 插入日志 serverlog(3, $GLOBALS['dbTablePre'] . 'love_question', '添加爱情测试题目', $GLOBALS['adminid']); salert("添加成功", "index.php?action=site_lovequestion&h=add"); } $sql = "SELECT * FROM {$GLOBALS['dbTablePre']}love_test "; $lovetype_list = $GLOBALS['_MooClass']['MooMySQL']->getAll($sql); require adminTemplate('site_lovequestion_add'); }
function check_memberinfo_detail() { $id = MooGetGPC('id', 'integer', 'G'); $sql = "SELECT * FROM {$GLOBALS['dbTablePre']}admin_editmembersinfo_sql WHERE id='{$id}'"; $res = $GLOBALS['_MooClass']['MooMySQL']->getOne($sql, true); $uid = $res['uid']; //审核通过 if ($_GET['status'] == 1) { $sql = base64_decode($res['exec_members_sql']); $GLOBALS['_MooClass']['MooMySQL']->query($sql); //var_dump($sql); $sql = base64_decode($res['exec_memberfield_sql']); $GLOBALS['_MooClass']['MooMySQL']->query($sql); //var_dump($sql); $sql = "UPDATE {$GLOBALS['dbTablePre']}admin_editmembersinfo_sql SET status=1 WHERE id='{$id}'"; $GLOBALS['_MooClass']['MooMySQL']->query($sql); //note 更新用户数据 //fastsearch_update($uid,1); //fastsearch_update($uid,2); salert('操作成功'); exit; } //审核不通过 if ($_GET['status'] == 2) { $sql = "UPDATE {$GLOBALS['dbTablePre']}admin_editmembersinfo_sql SET status=2 WHERE id='{$id}'"; $GLOBALS['_MooClass']['MooMySQL']->query($sql); salert('操作成功,您已拒绝此次对会员资料的修改'); exit; } $userinfo = $GLOBALS['_MooClass']['MooMySQL']->getOne("SELECT * FROM {$GLOBALS['dbTablePre']}members WHERE uid='{$uid}'", true); $userfield = $GLOBALS['_MooClass']['MooMySQL']->getOne("SELECT * FROM {$GLOBALS['dbTablePre']}memberfield WHERE uid='{$uid}'", true); //修改过的 $userinfo_new = $GLOBALS['_MooClass']['MooMySQL']->getOne("SELECT * FROM {$GLOBALS['dbTablePre']}members_edithistory WHERE uid='{$uid}'", true); $userfield_new = $GLOBALS['_MooClass']['MooMySQL']->getOne("SELECT * FROM {$GLOBALS['dbTablePre']}memberfield_edithistory WHERE uid='{$uid}'", true); require adminTemplate("check_memberinfo_detail"); }
function admin_index() { global $type_list, $chang_user; $str = ''; foreach ($type_list as $key => $type) { $sub_str = ''; foreach ($type['subname'] as $key2 => $subname) { $i = $key2 + 1; $sub_str .= "{'menuid':'{$i}','menuname':'{$subname['title']}','icon':'icon-nav','url':'{$subname['url']}'},"; } $sub_str = substr($sub_str, 0, -1); $j = 'a_' . $key; $str .= "{'menuid':'{$j}','icon':'icon-sys','menuname':'{$type['typename']}','menus':[" . $sub_str . "]},"; } $str = substr($str, 0, -1); //print_r($str);exit; $groupid = $GLOBALS['groupid']; if (in_array($groupid, $GLOBALS['admin_service_pre'])) { $pass = "******"; } else { $pass = "******"; } require_once adminTemplate('admin_index'); }
function bind_list() { $bindArr = array(0 => '未联系', 1 => '<span style="color:#0FF">已绑定</span>', 2 => '<span style="color:#F00">绑定过期</span>'); $page = max(1, MooGetGPC('page', 'integer', 'G')); $pagesize = 16; $start = ($page - 1) * $pagesize; $choose = ''; $uid = ''; if (isset($_GET['choose'])) { $choose = $_GET['choose']; } if (isset($_GET['uid'])) { $uid = (int) $_GET['uid']; } //所管理的客服id列表 $myservice_idlist = get_myservice_idlist(); $sql_where = ''; if (empty($myservice_idlist)) { $sql_where = " WHERE ms.sid = {$GLOBALS['adminid']} "; } elseif ($myservice_idlist == 'all') { //all为客服主管能查看所有的 } else { $sql_where = " WHERE ms.sid IN({$myservice_idlist})"; } if ($uid) { $str = empty($sql_where) ? ' WHERE' : ' AND'; $sql_where .= $str . " mb." . $choose . "='{$uid}'"; } $sql = "SELECT COUNT(1) c FROM {$GLOBALS['dbTablePre']}members_bind mb \n\t\tLEFT JOIN {$GLOBALS['dbTablePre']}members_search ms ON mb.a_uid = ms.uid \n\t\t{$sql_where} "; $total = $GLOBALS['_MooClass']['MooMySQL']->getOne($sql); $sql = "SELECT mb.* \n\t\t\t\tFROM {$GLOBALS['dbTablePre']}members_bind mb \n\t\t\t\tLEFT JOIN {$GLOBALS['dbTablePre']}members_search ms ON mb.a_uid = ms.uid \n\t\t\t\t{$sql_where} \n\t\t\t\tORDER BY bind,id desc \n\t\t\t\tLIMIT {$start},{$pagesize}"; $bindrs = $GLOBALS['_MooClass']['MooMySQL']->getAll($sql); $currenturl = 'index.php?action=active_bind&h=list'; $pages = multipage($total['c'], $pagesize, $page, $currenturl); require adminTemplate('active_bind_list'); }
/** * 会员交接表统计 * */ function get_joinlist() { $db = $GLOBALS['_MooClass']['MooMySQL']; $adminid = $GLOBALS['adminid']; $dbpre = $GLOBALS['dbTablePre']; $page_per = 12; $gid = MooGetGPC('manageid', 'integer', 'G'); $sid = MooGetGPC('kefuid', 'integer', 'G'); $mode = MooGetGPC('mode', 'integer', 'G'); $period = MooGetGPC('period', 'integer', 'G'); $startdate = MooGetGPC('startdate', 'string', 'G'); $enddate = MooGetGPC('enddate', 'string', 'G'); $choose = MooGetGPC('choose', 'string', 'G'); $keyword = trim(MooGetGPC('keyword', 'string', 'G')); $modes = array(1 => '全权', 2 => '全权1+1', 3 => '炫服务', 4 => '信息刺激', 5 => '本站牵线'); $periods = array(1 => '一个月', 2 => '三个月', 3 => '五个月', 4 => '六个月'); $condition = array(); foreach (array('mode', 'period', 'gid', 'sid') as $v) { if (${$v} >= 1) { $condition[] = $v . "=" . ${$v}; } } if (!empty($startdate)) { $condition[] = "bgtime>='" . strtotime($startdate) . "'"; } if (!empty($enddate)) { $condition[] = "bgtime<='" . strtotime($enddate) . "'"; } if (!empty($choose) && $keyword !== '') { if ($choose == 'username') { $condition[] = "{$choose} like '%{$keyword}%'"; } else { $condition[] = "{$choose}='{$keyword}'"; } } $sql_condition = implode(' and ', $condition); if (!$sql_condition) { $sql_condition = 'true'; } $a = $db->getOne("select count(id) as count from {$dbpre}admin_join where {$sql_condition}"); $total = $a['count']; $page_num = ceil($total / $page_per); $page = max(1, min(MooGetGPC('page', 'integer'), $page_num)); $offset = ($page - 1) * $page_per; $sql = "select * from {$dbpre}admin_join where {$sql_condition} limit {$offset}, {$page_per}"; $join_list = $db->getAll($sql); if (!isset($_GET['ajax'])) { $manage_list = $db->getAll("select id, manage_name, manage_list from {$dbpre}admin_manage where type=1 order by manage_name"); $server_list = $db->getAll("select uid, username from {$dbpre}admin_user"); foreach ($server_list as $v) { $server_arr[$v['uid']] = $v['username']; } $manageids = '{'; $founded = false; foreach ($manage_list as $v) { $single_manage_arr = explode(',', $v['manage_list']); $manageids .= $v['id'] . ':{'; foreach ($single_manage_arr as $v2) { $manageids .= $v2 . ':"' . $server_arr[$v2] . '",'; } $manageids = substr($manageids, 0, -1) . '},'; if (!$founded && in_array($sid, $single_manage_arr)) { $founded = true; $manageid = $v['id']; $current_group_kefu_list = $single_manage_arr; } } $manageids = substr($manageids, 0, -1) . '}'; } $currenturl = "index.php?action=financial_joinstatistics&ajax=&startdate={$startdate}&enddate={$enddate}&choose={$choose}&keyword={$keyword}&mode={$mode}&period={$period}&manageid={$gid}&kefuid={$sid}"; $pages = multipage($total, $page_per, $page, '#currenturl#'); $pages = preg_replace('/#currenturl#\\?page=(\\d*)/', 'javascript:gotoPage($1)', $pages); require_once adminTemplate('financial_joinstatistics'); exit; }
function active_activity_edit() { $id = MooGetGPC('id', 'integer', 'G'); $id = empty($id) ? MooGetGPC('id', 'integer', 'P') : $id; $data = array(); if ($_POST) { $where['id'] = $id; $data['title'] = trim(MooGetGPC('title', 'string', 'P')); if (empty($data['title'])) { MooMessageAdmin('请活动主题', 'index.php?action=active_activity&h=add'); exit; } $data['type'] = MooGetGPC('type', 'integer', 'P'); $data['price'] = MooGetGPC('price', 'integer', 'P'); $data['price_online'] = MooGetGPC('price_online', 'integer', 'P'); $data['starttime'] = MooGetGPC('starttime', 'string', 'P'); if (empty($data['starttime'])) { MooMessageAdmin('请填写活动的报名开始时间', 'index.php?action=active_activity&h=add'); exit; } $data['starttime'] = strtotime($data['starttime'] . ' 0:0:0'); $data['endtime'] = MooGetGPC('endtime', 'string', 'P'); if (empty($data['endtime'])) { MooMessageAdmin('请填写活动的报名结束时间', 'index.php?action=active_activity&h=add'); exit; } $data['endtime'] = strtotime($data['endtime'] . ' 23:59:59'); $data['opentime'] = MooGetGPC('opentime', 'array', 'P'); if (empty($data['opentime']['day'])) { $data['opentime'] = 0; } else { $data['opentime'] = strtotime($data['opentime']['day'] . ' ' . $data['opentime']['hour'] . ':' . $data['opentime']['mintue'] . ':0'); } $data['closetime'] = MooGetGPC('closetime', 'array', 'P'); if (empty($data['closetime']['day'])) { $data['closetime'] = 0; } else { $data['closetime'] = strtotime($data['closetime']['day'] . ' ' . $data['closetime']['hour'] . ':' . $data['closetime']['mintue'] . ':0'); } $data['issex'] = MooGetGPC('issex', 'string', 'P'); $data['issex'] = $data['issex'] < 1 ? 100 : ($data['issex'] > 100 ? 100 : $data['issex']); $data['province'] = MooGetGPC('province', 'integer', 'P'); $data['activity_img'] = 'module/activity/templates/default/images/activity_new/' . MooGetGPC('img', 'string', 'P'); $data['href'] = 'index.php?n=activity&h=' . MooGetGPC('href', 'string', 'P'); $data['city'] = MooGetGPC('city', 'integer', 'P'); $data['place'] = htmlspecialchars(trim(MooGetGPC('place', 'string', 'P'))); $data['profile'] = htmlspecialchars(trim(MooGetGPC('profile', 'string', 'P'))); $data['introduction'] = htmlspecialchars(trim(MooGetGPC('introduction', 'string', 'P'))); updatetable('activity', $data, $where); MooMessageAdmin('活动修改成功', 'index.php?action=active_activity&h=edit&id=' . $id); } $sql = 'SELECT `type`,`title`,`price`,`price_online`,`starttime`,`endtime`,`opentime`,`closetime`,`issex`,`province`,`city`,`place`,`profile`,`introduction` from `' . $GLOBALS['dbTablePre'] . 'activity` where `id`=' . $id; $data = $GLOBALS['_MooClass']['MooMySQL']->getOne($sql); require adminTemplate('active_activity_detail'); }
function system_adminmanage_editgroup() { if ($_POST) { $id = MooGetGPC('id', 'integer', 'P'); $arr['manage_name'] = MooGetGPC('manage_name', 'string', 'P'); $arr['manage_desc'] = MooGetGPC('manage_desc', 'string', 'P'); $arr['manage_type'] = MooGetGPC('manage_type', 'integer', 'P'); updatetable('admin_manage', $arr, array('id' => $id)); salert('修改成功'); exit; } $id = MooGetGPC('id', 'integer', 'G'); $sql = "SELECT * FROM {$GLOBALS['dbTablePre']}admin_manage WHERE id='{$id}'"; $group = $GLOBALS['_MooClass']['MooMySQL']->getOne($sql); require_once adminTemplate('adminmanage_editgroup'); }
function financial_wordbook_day() { global $adminid, $groupid; $sid = MooGetGPC('sid', 'integer'); $username = MooGetGPC('username', 'string'); //分页 $page_per = 20; $page = max(1, MooGetGPC('page', 'integer', 'G')); $limit = 20; $offset = ($page - 1) * $limit; $time = MooGetGPC('time1', 'string'); if (!$time) { $time1 = strtotime(date('Y-m-d')); $time2 = strtotime(date('Y-m-d')) + 86400; } else { $time1 = strtotime($time); $time2 = strtotime($time) + 86400; } $sql = "select distinct(uid) from {$GLOBALS['dbTablePre']}member_sellinfo where sid='{$sid}' and effect_grade != '' and dateline >= '{$time1}' and dateline <= '{$time2}'"; $count = $GLOBALS['_MooClass']['MooMySQL']->getAll($sql); $currenturl = "index.php?action=financial_wordbook&h=day&sid={$sid}&username={$username}&time1={$time}"; $total = count($count); $page_links = multipage($total, $page_per, $page, $currenturl); $count_arr = array_slice($count, $offset, 20); $count_arr_uid = ''; foreach ($count_arr as $k => $val) { if ($k > 0) { $count_arr_uid .= ','; } $count_arr_uid .= $val['uid']; } if ($count_arr_uid) { $sql_arr_uid = " and uid in ({$count_arr_uid})"; } $member_backinfo = $count_arr; $count_day = count($count_arr); //操作者mid 所属客服 sid 会员 uid $sql = "select mid,uid,sid,effect_grade,comment,dateline from {$GLOBALS['dbTablePre']}member_sellinfo where sid='{$sid}' {$sql_arr_uid} and effect_grade != '' and dateline >= '{$time1}' and dateline <= '{$time2}'"; $sellinfo_arr = $GLOBALS['_MooClass']['MooMySQL']->getAll($sql); require_once adminTemplate('financial_wordbook_day'); }
function allmember_class() { global $allow_order, $rsort, $grade; $get = MooGetGPC('clear', 'integer', 'G'); $total = 0; $page_links = ''; $sort_arr = $member_list = array(); $currenturl = "index.php?action=allmember&h=class"; $currenturl1 = "index.php?action=allmember&h=class&clear=1"; //$condition = array(); //$condition['uid']=$condition['username']=$condition['nickname']=$condition['telphone']=$condition['sid'] = ''; $sql_where = 'where 1'; //获得参数 /* $effect_grade=MooGetGPC('effect_grade','integer','G'); $isControl=MooGetGPC('isControl','string','G'); $isForcast=MooGetGPC('isForcast','string','G'); $keyword=MooGetGPC('keyword','string','G'); $endTime=MooGetGPC('end','string','G'); $startTime=MooGetGPC('start','string','G'); */ //获取查询条件及语句 $where = get_search_condition(''); //if(!empty($keyword)) $where = $where." AND m.sid = $keyword"; $query_builder = get_query_builder($where, $allow_order, '', '', 'regdate', 'desc', $rsort); $where = $sql_where . $query_builder['where']; $sql_sort = $query_builder['sort']; $sort_arr = $query_builder['sort_arr']; $rsort_arr = $query_builder['rsort_arr']; $kefu_list = get_kefulist(); //分类会员 if ($get == 1) { $page_per = 20; $page = get_page(); $limit = 20; $total = get_allmember_count($where); $page_total = max(1, ceil($total / $limit)); $page = min($page, $page_total); $offset = ($page - 1) * $limit; //$offset = 0;//enky add $member_list = get_member_list($where, $sql_sort, "limit {$offset},{$page_per}"); //来源 if ($member_list) { foreach ($member_list as $key => $user) { if (preg_match_all("/(wf=\\w+)&?|(st=\\w+)&?/i", $user['source'], $matches)) { $member_list[$key]['source'] = $matches[1][0] . "<br />" . $matches[2][1]; } } } // echo $url = "http://".$_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI']; $currenturl = "index.php?action=allmember&h=class"; //$currenturl1 = "index.php?action=allmember&h=class&clear=1"; $currenturl1 = "index.php?action=allmember&h=class&clear=1&effect_grade={$effect_grade}&keyword={$keyword}&end={$endTime}&start={$startTime}"; $page_links = multipage($total, $page_per, $page, $currenturl1); $age_arr = array(); for ($i = 18; $i < 100; $i++) { $age_arr[] = $i; } //获取本次查询条件 $condition = get_condition($where); } $title = '分类会员列表'; require_once adminTemplate('allmember_general'); }
function financial_classStatistics() { global $_MooClass, $dbTablePre, $grade; $condition = array(); $id = ""; $total = ""; $page_per = 0; $page = 0; //判断当前登录客服 所在的组 $sql = "SELECT id,manage_list FROM {$dbTablePre}admin_manage WHERE type=1"; $ret = $GLOBALS['_MooClass']['MooMySQL']->getAll($sql, 0, 0, 0, true); $user_list = ''; //echo $GLOBALS['adminid']; foreach ($ret as $v) { $user_list_arr = array(); $user_list = $v['manage_list']; $user_list_arr = explode(',', $user_list); if (in_array($GLOBALS['adminid'], $user_list_arr)) { $id = $v['id']; break; } } unset($ret); unset($user_list_arr); // print_r($user_list_arr);exit('dddd'); //按所属组检索 $groupid = MooGetGPC('groupid', 'string', 'G'); if (empty($groupid)) { $groupid = $id; } //既不属于当前组,也没选择组 if (empty($groupid)) { $sql = "SELECT id FROM {$dbTablePre}admin_manage WHERE type=1 order by id limit 1"; $ret = $GLOBALS['_MooClass']['MooMySQL']->getOne($sql, true); $groupid = $ret['id']; } /* $myservice_idlist = get_myservice_idlist(); echo $myservice_idlist;exit; */ //返回所选组的客服ID列表 $sql = "SELECT id,manage_list FROM {$dbTablePre}admin_manage WHERE id={$groupid}"; $ret = $GLOBALS['_MooClass']['MooMySQL']->getOne($sql, true); $user_list = $ret['manage_list']; $user_list_arr = explode(',', $user_list); require 'data/kefulist_cache.php'; $userArr = array(); foreach ($user_list_arr as $v) { foreach ($kefu_arr as $k_ => $v_) { if ($v == $k_) { $userArr[$v] = $v_; } } } //$condition[] = " am.id='{$groupid}'";//web_admin_manage表 //开始时间(最后一次分配时间) /* $startTime=MooGetGPC('alloctimeStart','string','G'); $alloctimeStart = strtotime($startTime); if(!empty($alloctimeStart)){ $condition[] = " ma.allto_time>='{$alloctimeStart}'"; //web_member_admininfo表 } */ //结束时间(最后一次分配时间) $alloctimeStart = $alloctimeEnd = ''; $curdate = ''; $time = date('Y-m-d'); $endTime = MooGetGPC('alloctimeEnd', 'string', 'G'); $alloctimeStart = strtotime($endTime); //当日0时0分 if (empty($endTime)) { $alloctimeEnd = strtotime($time . " +1 day"); //今天最后截止 $relativeAlloctimeEnd = strtotime(date('Y-m-d')); //相对今天的昨天 $alloctimeStart = strtotime(date('Y-m-d')); } else { $alloctimeEnd = strtotime($endTime . "+1 day"); $relativeAlloctimeEnd = strtotime($endTime); } //今天,昨天,前天 $curdate = MooGetGPC('day', 'string', 'G'); switch ($curdate) { case "today": //今天 $alloctimeEnd = strtotime("+1 day"); $endTime = date("Y-m-d"); $relativeAlloctimeEnd = strtotime(date('Y-m-d')); //相对今天的昨天 break; case "yesterday": $alloctimeEnd = strtotime(date('Y-m-d')); $relativeAlloctimeEnd = strtotime("-1 day"); $endTime = date("Y-m-d", $relativeAlloctimeEnd); break; case "beforeyesterday": //前天 $alloctimeEnd = strtotime("-1 day"); $relativeAlloctimeEnd = strtotime("-2 day"); //相对前天的昨天 $endTime = date("Y-m-d", $relativeAlloctimeEnd); break; /* case 'bigbeforeyesterday': //大前天 $alloctimeEnd=strtotime("-2 day"); $endTime=date("Y-m-d",$alloctimeEnd); break; */ } if (!empty($alloctimeEnd)) { $condition[] = " ma.allto_time<'{$alloctimeEnd}'"; //web_member_admininfo表 } // echo $startTime.'and'.$alloctimeStart.'and'.$alloctimeEnd; $isDo = MooGetGPC('isDo', 'integer', 'G'); if (!empty($isDo)) { $condition[] = " reason='{$isDo}'"; } $effectGradeArr = array(); if (!empty($condition)) { $condition_sql = implode(' and ', $condition); $where = " and {$condition_sql}"; } else { $where = ""; } // echo $where;exit; $sum = $sum1 = $sum0 = $sum2 = $sum3 = $sum4 = $sum5 = $sum6 = $sum7 = $sum8 = $sum9 = $sum10 = 0; $res = array(); foreach ($userArr as $sid => $username) { //当前组下所有客服 $sql = "select effect_grade,count(m.uid) as cGrade from {$dbTablePre}member_admininfo ma left join {$dbTablePre}members_search m on ma.uid=m.uid where m.sid={$sid} {$where} group by ma.effect_grade"; $res = $_MooClass['MooMySQL']->getAll($sql, 0, 0, 0, true); $sumGrade = 0; //客服名下会员总数 $effectGrade = array(); //重新开始 if (empty($res)) { continue; } // print_r($res);exit; foreach ($res as $value) { if ($value['effect_grade'] >= 1) { //$effect_grade=$value['effect_grade']-1; $effect_grade = $value['effect_grade']; $cGrade = $value['cGrade']; $sumGrade = $sumGrade + $cGrade; $effectGrade[] = array("effect_grade" => $effect_grade, "cGrade" => $cGrade); } } $KFC = array(); //重新开始一次循环初始化 $McDonald = array(); //重新开始一次循环初始化 //这里的键值是从0开始的 foreach ($effectGrade as $value) { $KFC[] = $value['effect_grade']; } // print_r($effectGrade);exit; $usa = implode(',', $KFC); //GRADE数组键值是 从1开始的 ,改变为0,1,... ,10 $McDonald = array_keys($grade); /* foreach($McDonald as $value){ $tmp[]=$value - 1; } $china=implode(',',$tmp); */ //转换 /* $McDonald=explode(',',$china); $KFC=explode(',',$usa); */ //找出没有的类 $restKeys = array(); foreach ($McDonald as $you) { if (!in_array($you, $KFC)) { $restKeys[] = $you; } } //print_r($restKeys);exit; //插入按照 2类,0个 或者 3类,0个 $iphone = sizeof($effectGrade); $android = sizeof($grade); if ($iphone < $android) { for ($i = 0; $i < $android - $iphone; $i++) { $effectGrade[] = array("effect_grade" => $restKeys[$i], "cGrade" => 0); } } unset($restKeys); //排序 //print_r($effectGrade);exit; foreach ($effectGrade as $t_k => $t_v) { $hongkong[$t_k] = $t_v['effect_grade']; //$beijing[$t_k]=$t_v['cGrade']; } array_multisort($hongkong, SORT_ASC, $effectGrade); foreach ($effectGrade as $value) { if ($value['effect_grade'] == 1) { $sum0 += $value['cGrade']; } if ($value['effect_grade'] == 2) { $sum1 += $value['cGrade']; } if ($value['effect_grade'] == 3) { $sum2 += $value['cGrade']; } if ($value['effect_grade'] == 4) { $sum3 += $value['cGrade']; } if ($value['effect_grade'] == 5) { $sum4 += $value['cGrade']; } if ($value['effect_grade'] == 6) { $sum5 += $value['cGrade']; } if ($value['effect_grade'] == 7) { $sum6 += $value['cGrade']; } if ($value['effect_grade'] == 8) { $sum7 += $value['cGrade']; } if ($value['effect_grade'] == 9) { $sum8 += $value['cGrade']; } if ($value['effect_grade'] == 10) { $sum9 += $value['cGrade']; } if ($value['effect_grade'] == 11) { $sum10 += $value['cGrade']; } } //是否盘库(组长当日是否给客服有评语) $effectgrade_id = ''; $curtime = strtotime(date('Y-m-d')); $nexttime = strtotime("+1 day"); $sql = "select id from {$dbTablePre}member_effectgrade where sid='{$sid}' and dateline>={$alloctimeStart} and dateline<{$alloctimeEnd}"; $remarkWritten = $_MooClass['MooMySQL']->getOne($sql, true); if (!empty($remarkWritten)) { $effectgrade_id = $remarkWritten['id']; } //今天的3类会员数量 $res3 = array(); $sql = "select count(m.uid) as tGrade from {$dbTablePre}member_admininfo ma left join {$dbTablePre}members_search m on ma.uid=m.uid where m.sid={$sid} and ma.effect_grade=4 and ma.allto_time>='{$relativeAlloctimeEnd}' and ma.allto_time<'{$alloctimeEnd}'"; $res3 = $_MooClass['MooMySQL']->getOne($sql, 0, 0, 0, true); if (!empty($res3)) { $effectGrade3 = $res3['tGrade']; } //输出总的变量 $effectGradeArr[] = array("effectgrade_id" => $effectgrade_id, "sid" => $sid, "username" => $username, "effectGrade" => $effectGrade, "sumGrade" => $sumGrade, 'effectGrade3' => $effectGrade3); // print_r($effectGradeArr);echo "<br>"."<br>"; } $sum = $sum0 + $sum1 + $sum2 + $sum3 + $sum4 + $sum5 + $sum6 + $sum7 + $sum8 + $sum9 + $sum10; //当前客服组的所有会员数 if ($sum > 0) { $p0 = round($sum0 / $sum, 3) * 100; $p1 = round($sum1 / $sum, 3) * 100; $p2 = round($sum2 / $sum, 3) * 100; $p3 = round($sum3 / $sum, 3) * 100; $p4 = round($sum4 / $sum, 3) * 100; $p5 = round($sum5 / $sum, 3) * 100; $p6 = round($sum6 / $sum, 3) * 100; $p7 = round($sum7 / $sum, 3) * 100; $p8 = round($sum8 / $sum, 3) * 100; $p9 = round($sum9 / $sum, 3) * 100; $p10 = round($sum10 / $sum, 3) * 100; } //组 if (in_array($GLOBALS['groupid'], $GLOBALS['admin_service_arr'])) { //主管 $sql = "select id,manage_name from {$dbTablePre}admin_manage where type=1"; $group = $_MooClass['MooMySQL']->getAll($sql, 0, 0, 0, true); } elseif (in_array($GLOBALS['groupid'], $GLOBALS['admin_service_team'])) { //队长 $sql = "select id,manage_list,leader_uid from {$dbTablePre}admin_manage where type=2"; $group = $_MooClass['MooMySQL']->getAll($sql, 0, 0, 0, true); /* $manage_list=''; $commat = ''; foreach($group as $value){ $manage_list.=$commat .$value['manage_list']; $commat = ','; } */ foreach ($group as $value) { $leader_uid = $value['leader_uid']; $leader_uid = explode(',', $leader_uid); // print_r($leader_uid);exit; // echo $GLOBALS['adminid'];exit; if (in_array($GLOBALS['adminid'], $leader_uid)) { $manage_list = $value['manage_list']; $manage_arr = explode(',', $manage_list); break; } } $group = array(); if (!empty($manage_arr)) { foreach ($manage_arr as $id) { $sql = "select id,manage_name from {$dbTablePre}admin_manage where id={$id}"; $res = $_MooClass['MooMySQL']->getOne($sql); $group[] = array("id" => $res['id'], "manage_name" => $res['manage_name']); } } } unset($res); // print_r($group); /* $currenturl = 'http://'.$_SERVER['SERVER_NAME'].':'.$_SERVER["SERVER_PORT"].$_SERVER["REQUEST_URI"]; $currenturl=preg_replace("/www./",'',$currenturl); $currenturl=preg_replace("/&day=\w+/",'',$currenturl); $currenturl=preg_replace("/&alloctimeEnd=\w+/",'',$currenturl); */ $currenturl = "index.php?action=financial&h=classStatistics"; // echo $currenturl; $pages = multipage($total, $page_per, $page, $currenturl); //加载模板 require adminTemplate('financial_classStatistics'); }
} else { $uid = $_REQUEST['uid']; $sql = "select t1.*,t2.vote_title,t3.sub_time,t3.vote_result,t3.vid from vote_member as t1 left join vote_sub as t3 on t1.uid=t3.uid left join vote as t2 on t3.vid = t2.vid where t1.uid = '{$uid}'"; $result = $db->getAll($sql); foreach ($result as $k => $v) { if ($k == '0') { $arr[] = $v; } $arr['vote'][$v[vid]][] = $v['vote_title']; $str = str_replace(':1', "", $v['vote_result']); $arr['vote'][$v[vid]][] = $str; } $arr[0]['birthdatey'] = substr($arr[0]['birthdate'], 0, 4); $arr[0]['birthdatem'] = substr($arr[0]['birthdate'], 4, 2) > 10 ? substr($arr[0]['birthdate'], 4, 2) : substr($arr[0]['birthdate'], 5, 1); $arr[0]['birthdated'] = substr($arr[0]['birthdate'], 6, 2) > 10 ? substr($arr[0]['birthdate'], 6, 2) : substr($arr[0]['birthdate'], 7, 1); require_once adminTemplate('vote_member_edit'); } } else { if ($act == 'update') { if (empty($_REQUEST['uid'])) { header("location:vote_member.php?act=list"); } else { $obtain = $_REQUEST; if ($obtain['month'] == '0') { $birthdatem = '00'; } else { if ($obtain['month'] < '10') { $birthdatem = '0' . $obtain['month']; } else { $birthdatem = $obtain['month']; }
function active_uplink_list() { $condition = array(); $type = MooGetGPC('type', 'string', "G"); //if(isset($_GET['xx']) && !empty($_GET['xx'])) { $choose = MooGetGPC('choose', 'string', "G"); $keyword = MooGetGPC('keyword', 'string', "G"); $startdate = MooGetGPC('startdate', 'string', "G"); $enddate = MooGetGPC('enddate', 'string', "G"); $starttime = strtotime($startdate); $endtime = strtotime($enddate); if (!empty($starttime)) { $condition[] = "reptime>" . $starttime; } if (!empty($endtime)) { $condition[] = "reptime<" . $endtime; } if (!empty($choose)) { if (!empty($startdate) && !empty($enddate)) { if (!empty($keyword)) { $condition[] = $choose . "= " . $keyword; } } } //} //note分页处理 $page = max(1, MooGetGPC('page', 'integer')); $limit = 15; $offset = ($page - 1) * $limit; //得到所属客服下的会员 $myservice_idlist = get_myservice_idlist(); $myservice_idlist = empty($myservice_idlist) ? 'all' : $myservice_idlist; //计算总记录数 //note 所管理的用户列表 $adminid = $GLOBALS['adminid']; if (empty($myservice_idlist)) { $condition[] = "sid={$adminid}"; } elseif ($myservice_idlist == 'all') { //all为客服主管能查看所有的 } else { $condition[] = " sid in ({$myservice_idlist})"; } $where = implode(" and ", $condition); if (!empty($where)) { $where = " where " . $where; } if (!empty($where)) { $sql = "SELECT COUNT(*) num FROM {$GLOBALS['dbTablePre']}uplinkcontent " . $where; $sql_detail = "SELECT * FROM {$GLOBALS['dbTablePre']}uplinkcontent " . $where . " order by reptime desc LIMIT {$offset},{$limit}"; } else { $sql = "SELECT COUNT(*) num FROM {$GLOBALS['dbTablePre']}uplinkcontent {$where}"; $sql_detail = "SELECT * FROM {$GLOBALS['dbTablePre']}uplinkcontent {$where} order by reptime desc LIMIT {$offset},{$limit}"; } $total = $GLOBALS['_MooClass']['MooMySQL']->getOne($sql); $user_arr = $GLOBALS['_MooClass']['MooMySQL']->getAll($sql_detail); $currenturl = "index.php?action=active_uplink&h=list&choose={$choose}&keyword={$keyword}&startdate={$startdate}&enddate={$enddate}"; $currenturl = $currenturl . "&type={$type}"; $pages = multipage($total['num'], $limit, $page, $currenturl); //note 跳转到某一页 $page_num = ceil($total['num'] / $limit); //note 插入日志 serverlog(1, $GLOBALS['dbTablePre'] . 'servies', "{$GLOBALS['username']}查看会员上行列表", $GLOBALS['adminid']); //note 载入模块 require adminTemplate('active_uplink_list'); }
function ajax_show() { $page = max(1, MooGetGPC('page', 'integer', 'G')); $limit = 2; $offset = ($page - 1) * $limit; $uid = MooGetGPC('uid', 'integer', 'G'); $sid = MooGetGPC('sid', 'integer', 'G'); $date = MooGetGPC('date', 'string', 'G'); if (empty($date)) { $sql = "SELECT DISTINCT(FROM_UNIXTIME(s_time,'%Y-%m-%d')) AS date FROM {$GLOBALS['dbTablePre']}service_chat WHERE (s_uid = {$uid} AND s_fromid = {$sid}) OR (s_uid = {$sid} AND s_fromid = {$uid}) ORDER BY s_time DESC"; $date_arr = $GLOBALS['_MooClass']['MooMySQL']->getAll($sql, 0, 0, 0, true); $date = $date_arr[$page - 1]['date']; } if (empty($date)) { exit("会员{$sid}与会员{$uid}暂无聊天记录!"); } $st = strtotime($date); $et = $st + 86400; $sql = "SELECT c.*,s.nickname FROM {$GLOBALS['dbTablePre']}service_chat c\n\t\t\tLEFT JOIN {$GLOBALS['dbTablePre']}members_search s\n\t\t\tON c.s_fromid = s.uid\n\t\t\tWHERE ((c.s_uid = {$uid} AND c.s_fromid = {$sid}) OR (c.s_uid = {$sid} AND c.s_fromid = {$uid})) AND c.s_time BETWEEN {$st} AND {$et} ORDER BY c.s_time ASC"; $mes = $GLOBALS['_MooClass']['MooMySQL']->getAll($sql, 0, 0, 0, true); $currenturl = "chat_ajax.php?n=show&uid={$uid}&sid={$sid}"; $pages = multipage(count($date_arr), $limit, $page, $currenturl); require_once adminTemplate('chat_history_list'); }
function system_adminlog_search() { $condition = array(); //客服sid搜索 if ($_GET['sid']) { $sid = MooGetGPC('sid', 'integer', 'G'); $condition[] = " a.sid='{$sid}'"; } if ($_GET['sid2']) { $sid = MooGetGPC('sid2', 'integer', 'G'); $condition[] = " a.sid='{$sid}'"; } //会员id搜索 if ($_GET['uid']) { $uid = MooGetGPC('uid', 'integer', 'G'); $condition[] = " a.uid='{$uid}'"; } if ($_GET['date1']) { $date1 = strtotime(MooGetGPC('date1', 'string', 'G')); $condition[] = " a.time>='{$date1}'"; } if ($_GET['date2']) { $date2 = strtotime(MooGetGPC('date2', 'string', 'G')); $condition[] = " a.time<='{$date2}'"; } $sql_where = ''; if (!empty($condition)) { $sql_where = 'AND ' . implode('AND', $condition); } $page = max(1, MooGetGPC('page', 'integer')); $limit = 15; $offset = ($page - 1) * $limit; $page_per = 15; //note 得出总数 $sql = "SELECT count(1) as count FROM {$GLOBALS['dbTablePre']}server_log a JOIN {$GLOBALS['dbTablePre']}admin_user as b \n \t\tWHERE a.sid=b.uid {$sql_where}"; $query = $GLOBALS['_MooClass']['MooMySQL']->getOne($sql); $total = $query['count']; $sql = "SELECT a.*,b.username FROM {$GLOBALS['dbTablePre']}server_log as a \n \t\tJOIN {$GLOBALS['dbTablePre']}admin_user as b \n \t\tWHERE a.sid=b.uid {$sql_where} ORDER BY a.slid DESC LIMIT {$offset},{$limit}"; $adminlogin_list = $GLOBALS['_MooClass']['MooMySQL']->getAll($sql); $currenturl = 'http://' . $_SERVER['SERVER_NAME'] . ':' . $_SERVER["SERVER_PORT"] . $_SERVER["REQUEST_URI"]; $currenturl = preg_replace("/www./", "", $currenturl); $currenturl = preg_replace("/(&page=\\d+)/", "", $currenturl); $page_links = multipage($total, $page_per, $page, $currenturl); // $page_links=str_replace('7651','7652',$page_links); $sql = "SELECT uid,username FROM {$GLOBALS['dbTablePre']}admin_user"; $user_list = $GLOBALS['_MooClass']['MooMySQL']->getAll($sql); require_once adminTemplate('adminlog_list'); }
function active_leer_list() { //note 分页处理 $page = max(1, MooGetGPC('page', 'integer')); $limit = 5; $offset = ($page - 1) * $limit; $type = MooGetGPC('type', 'string'); //note 显示全部 if (isset($_GET['type']) && $_GET['type'] == 'all') { //note 显示已处理过的 } else { if (isset($_GET['type']) && $_GET['type'] == 'dealed') { $condition[] = " dealstate = '1'"; //note 显示未处理过的 } else { $condition[] = " dealstate = '0'"; } } //note 所管理的客服id列表 $myservice_idlist = get_myservice_idlist(); if (empty($myservice_idlist)) { $condition[] = " m.sid IN({$GLOBALS['adminid']})"; } elseif ($myservice_idlist == 'all') { } else { $condition[] = " m.sid IN({$myservice_idlist})"; } //note 处理搜索会员聊天 if (isset($_GET['action']) && $_GET['action'] == 'active_leer') { $choose = MooGetGPC('choose', 'string'); $keyword = MooGetGPC('keyword', 'string'); if (!empty($choose) && !empty($keyword)) { $condition[] .= " {$choose} = '{$keyword}'"; } } $sql_where = ''; if (!empty($condition)) { $sql_where = 'WHERE ' . implode(' AND ', $condition); } //note 查询语句 $sql = "SELECT COUNT(*) num FROM {$GLOBALS['dbTablePre']}service_leer l LEFT JOIN {$GLOBALS['dbTablePre']}members_search m ON l.senduid=m.uid {$sql_where}"; $total = $GLOBALS['_MooClass']['MooMySQL']->getOne($sql); $sql = "SELECT l.*,m.nickname as send_nickname, m.gender as send_gender FROM {$GLOBALS['dbTablePre']}service_leer l LEFT JOIN {$GLOBALS['dbTablePre']}members_search m ON l.senduid=m.uid {$sql_where} ORDER BY l.lid DESC LIMIT {$offset},{$limit}"; $user_arr = $GLOBALS['_MooClass']['MooMySQL']->getAll($sql); // foreach($user_arr as $k => $v) { // //note 查询出发送用户的昵称,性别 // $sql = "SELECT nickname,gender FROM {$GLOBALS['dbTablePre']}members_search WHERE uid = '{$v[senduid]}'"; // $send_user = $GLOBALS['_MooClass']['MooMySQL']->getOne($sql); // $user_arr[$k]['send_nickname'] = $send_user['nickname']; // $user_arr[$k]['send_gender'] = $send_user['gender']; // // //note 查询出接受用户的昵称,性别 // $sql = "SELECT nickname,gender FROM {$GLOBALS['dbTablePre']}members_search WHERE uid = '{$v[receiveuid]}'"; // $receive_user = $GLOBALS['_MooClass']['MooMySQL']->getOne($sql); // $user_arr[$k]['receive_nickname'] = $receive_user['nickname']; // $user_arr[$k]['receive_gender'] = $receive_user['gender']; // // } //start /* $receiveuids = array(); foreach ($user_arr as $k=>$v) { if (!in_array($v['receiveuid'],$receiveuids)){ $receiveuids[] = $v['receiveuid']; } } if (!empty($receiveuids)) { sort($receiveuids); $sql = "SELECT nickname,gender FROM {$GLOBALS['dbTablePre']}members_search WHERE uid IN(".implode(',',$receiveuids).")"; $receive_user = $GLOBALS['_MooClass']['MooMySQL']->getAll($sql); foreach ($user_arr as $k=>$v) { if (($keys = array_search($v['receiveuid'], $receiveuids)) !== false){ isset($receive_user[$keys]['nickname']) && $user_arr[$k]['receive_nickname'] = $receive_user[$keys]['nickname']; isset($receive_user[$keys]['gender']) && $user_arr[$k]['receive_gender'] = $receive_user[$keys]['gender']; } } } */ //end //note 获得当前的url 去除多余的参数 $currenturl = 'http://' . $_SERVER['SERVER_NAME'] . ':' . $_SERVER["SERVER_PORT"] . $_SERVER["REQUEST_URI"]; $currenturl = preg_replace("/(&page=\\d+)/", "", $currenturl); $currenturl = preg_replace("/(&type=undealed)/", "", $currenturl); $currenturl = preg_replace("/(&type=dealed)/", "", $currenturl); $currenturl = preg_replace("/(&type=all)/", "", $currenturl); $currenturl2 = $currenturl; $currenturl = $currenturl . "&type={$type}"; $pages = multipage($total['num'], $limit, $page, $currenturl); //note 跳转到某一页 $page_num = ceil($total['num'] / $limit); //note 插入日志 serverlog(1, $GLOBALS['dbTablePre'] . 'service_leer', "{$GLOBALS['username']}查看秋波列表", $GLOBALS['adminid']); require adminTemplate('active_leer_list'); }
function active_websms_list() { $type = MooGetGPC('type', 'string'); $sql_where = ""; //note 显示全部 if (isset($_GET['type']) && $_GET['type'] == 'all') { $sql_where = ""; //note 显示已处理过的 } else { if (isset($_GET['type']) && $_GET['type'] == 'dealed') { $sql_where .= " AND s.dealstate = '1'"; //note 显示未处理过的 } else { $sql_where .= " AND s.dealstate = '0'"; } } //note 系统发给会员的信息不显示 $sql_where .= " AND s.s_fromid != '0'"; //note 处理搜索会员聊天 if (isset($_GET['action']) && $_GET['action'] == 'active_websms') { $choose = MooGetGPC('choose', 'string'); $keyword = MooGetGPC('keyword', 'string'); //$where = ''; if (!empty($choose) && !empty($keyword)) { if ($choose == 's_content' || $choose == 's_title') { $sql_where .= " AND {$choose} like '%{$keyword}%'"; } else { $sql_where .= " AND {$choose} = '{$keyword}'"; } } } $page = max(1, MooGetGPC('page', 'integer')); $limit = 5; $offset = ($page - 1) * $limit; //note 所管理的客服id列表 $myservice_idlist = get_myservice_idlist(); if (empty($myservice_idlist)) { $sql_where = " AND m.sid IN({$GLOBALS['adminid']})"; } elseif ($myservice_idlist == 'all') { //all为客服主管能查看所有的 } else { $sql_where = " AND m.sid IN({$myservice_idlist})"; } $sql = "SELECT count(m.uid) as c FROM {$GLOBALS['dbTablePre']}services s \n\tLEFT JOIN {$GLOBALS['dbTablePre']}members_search m ON s.s_fromid = m.uid \n\tWHERE s.s_cid!='3' {$sql_where}"; $total_count = $GLOBALS['_MooClass']['MooMySQL']->getOne($sql, true); /*$sql = "SELECT m.uid FROM {$GLOBALS['dbTablePre']}services s LEFT JOIN {$GLOBALS['dbTablePre']}members m ON s.s_fromid = m.uid WHERE s.s_cid!='50' {$sql_where}"; $total_count=$GLOBALS['_MooClass']['MooMySQL']->getOne($sql);*/ // echo $sql.'<br />'; //$total = count($total_count['uid']); $total = $total_count['c']; $sql = "SELECT s.*,m.nickname FROM {$GLOBALS['dbTablePre']}services s \n\t\t\tLEFT JOIN {$GLOBALS['dbTablePre']}members_search m ON s.s_fromid = m.uid \n\t\t\tWHERE s.s_cid!='3' {$sql_where} ORDER BY s.s_id DESC LIMIT {$offset},{$limit}"; $user_arr = $GLOBALS['_MooClass']['MooMySQL']->getAll($sql, 0, 0, 0, true); // echo $sql.'<br />'; //note 获得当前的url 去除多余的参数 $currenturl = 'http://' . $_SERVER['SERVER_NAME'] . ':' . $_SERVER["SERVER_PORT"] . $_SERVER["REQUEST_URI"]; $currenturl = preg_replace("/www./", "", $currenturl); $currenturl = preg_replace("/(&page=\\d+)/", "", $currenturl); $currenturl = preg_replace("/(&type=undealed)/", "", $currenturl); $currenturl = preg_replace("/(&type=dealed)/", "", $currenturl); $currenturl = preg_replace("/(&type=all)/", "", $currenturl); $currenturl2 = $currenturl; $currenturl = $currenturl . "&type={$type}"; $pages = multipage($total, $limit, $page, $currenturl); //note 跳转到某一页 $page_num = ceil($total / $limit); //note 插入日志 serverlog(1, $GLOBALS['dbTablePre'] . 'servies', "{$GLOBALS['username']}查看站内短信列表", $GLOBALS['adminid']); require adminTemplate('active_websms_list'); }
function financial_urgencyclient_list() { global $_MooClass, $timestamp; global $adminid, $groupid; global $admin_service_arr; //高级管理员groupid //下面global值分别是售后组长、售后副组长、售后客服的groupid; global $admin_aftersales_service, $admin_aftersales_service_fu, $admin_aftersales_service2; $time = 259200; //总共是三天的时间 $time2 = strtotime(date('Y-m-d')) - $time; $now_time = strtotime(date('Y-m-d H:i:s')); $show = MooGetGPC('show', 'integer', 'G'); //新功能之后,为了保持数据统一,高级或钻石会员升级起始时间:2010-11-05 $start_time = strtotime('2010-11-05'); if ($show == 1 || $show == '') { $sql_where = $time2 . ' < a.bgtime'; } elseif ($show == 2) { $sql_where = $time2 . ' > a.bgtime and a.endtime >' . $time2 . ' and a.bgtime >' . $start_time; } //搜索用户的信息 $sql_payment_new = array(); $uid = trim(MooGetGPC('uid', 'integer')); if ($uid) { $sql_payment_new[] = 'a.uid=' . $uid; } $sid = trim(MooGetGPC('sid', 'integer')); if ($sid) { $sql_payment_new[] = 'a.sid=' . $sid; } $sql_payment_where = implode(' and ', $sql_payment_new); if (!empty($sql_payment_where)) { $sql_payment_where = "and " . $sql_payment_where; } else { //获得售后客服总人数且判断她们的权限 if (in_array($groupid, $admin_service_arr) || in_array($groupid, $admin_aftersales_service) || in_array($groupid, $admin_aftersales_service_fu)) { $sql = "select uid,groupid from {$GLOBALS['dbTablePre']}admin_user where groupid={$admin_aftersales_service2[0]}"; $group = $GLOBALS['_MooClass']['MooMySQL']->getAll($sql); foreach ($group as $n => $val) { // if($n>0){$group_val.=',';} // $group_val.=$val['uid']; $group_val[] = $val['uid']; } $group_val = implode(',', $group_val); $sql_payment_where = " and a.sid in ({$group_val})"; } elseif (in_array($groupid, $admin_aftersales_service2)) { if ($groupid == $admin_aftersales_service2[0]) { $sql_payment_where = ' and a.sid=' . $adminid; } else { exit; } } } $sql = "select count(*) as count from {$GLOBALS['dbTablePre']}members_search a left join {$GLOBALS['dbTablePre']}member_admininfo b on a.uid=b.uid where b.finished=0 and a.s_cid in (20,30) and a.usertype in (1,2) and {$sql_where} {$sql_payment_where}"; $count = $_MooClass['MooMySQL']->getOne($sql); //分页 $page_per = 20; $page = max(1, MooGetGPC('page', 'integer', 'G')); $limit = 20; $total = $count['count']; $offset = ($page - 1) * $limit; $myurl = explode('|', getUrl()); //搜索时候 if (!empty($sql_payment_where)) { $myurl[1] = "index.php?action=financial_urgencyclient&h=list&show={$show}&sid={$sid}&uid={$uid}"; } $page_links = multipage($total, $page_per, $page, $myurl[1]); //获取分页内容 recommend 推荐 chat 聊天 email 邮件 rose 鲜花 mandate 委托 leer 秋波 $sql = "select a.uid,a.nickname,a.gender,a.birthyear,a.bgtime,l.last_login_time,a.sid,a.s_cid,b.allto_time,b.recommend,b.chat,b.email,b.rose,b.mandate,b.leer from {$GLOBALS['dbTablePre']}members_search a left join {$GLOBALS['dbTablePre']}member_admininfo b on a.uid=b.uid left join {$GLOBALS['dbTablePre']}members_login l on a.uid=l.uid where b.finished=0 and a.s_cid in(20,30) and a.usertype in (1,2) and {$sql_where} {$sql_payment_where} limit {$offset},20"; //echo $sql; $payment_new = $_MooClass['MooMySQL']->getAll($sql); require_once adminTemplate('financial_urgencyclient_list'); }