Exemplo n.º 1
0
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');
}
Exemplo n.º 2
0
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');
}
Exemplo n.º 3
0
function transfer_del()
{
    $id = MooGetGPC('id', 'integer', 'G');
    $sql = "DELETE FROM {$GLOBALS['dbTablePre']}members_transfer WHERE `id`=" . $id;
    $GLOBALS['_MooClass']['MooMySQL']->query($sql);
    salert("删除成功", "index.php?action=other_members_transfer&h=list");
}
Exemplo n.º 4
0
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');
}
Exemplo n.º 5
0
function getone()
{
    global $_MooClass, $dbTablePre, $userid, $memcached;
    $sendid = MooGetGPC('sendid', 'integer', 'G');
    //$sendid = '21691205';
    $user = MooMembersData($sendid);
    if ($user['uid'] != $sendid || $sendid == '') {
        $error = '查无此人';
        echo return_data($error, false);
        exit;
    }
    if (MooGetphoto($user['uid'], 'com')) {
        $mainimg = MooGetphoto($userid, 'com');
        $user['mainimg'] = $mainimg;
    }
    $user['password'] = '';
    $user['regip'] = '';
    $user['qq'] = '';
    $user['msn'] = '';
    $user['telphone'] = '';
    $user['username'] = '';
    //print_r($user);
    echo return_data($user, true);
    exit;
}
Exemplo n.º 6
0
function getlatestvisitor()
{
    global $_MooClass, $dbTablePre, $userid, $timestamp, $user_arr;
    $pagesize = 4;
    //note 获取删除提交的变量
    $delvisitor = MooGetGPC('delvisitor', 'string');
    $delvisitorid = MooGetGPC('delvisitorid', 'array');
    //note 删除提交的数据
    if ($delvisitor && count($delvisitorid)) {
        for ($i = 0; $i < count($delvisitorid); $i++) {
            $result = $_MooClass['MooMySQL']->getOne("SELECT `who_del` FROM `" . $dbTablePre . "service_visitor` WHERE `vid`=" . $delvisitorid[$i], true);
            if ($result['who_del'] != 0) {
                $_MooClass['MooMySQL']->query("DELETE FROM {$dbTablePre}service_visitor WHERE vid = '{$delvisitorid[$i]}'");
            } else {
                $_MooClass['MooMySQL']->query("UPDATE `" . $dbTablePre . "service_visitor` SET `who_del`=2 WHERE `vid`=" . $delvisitorid[$i]);
            }
        }
        MooMessage("删除成功", 'index.php?n=service&h=mindme', '05');
    }
    //note 如果提交的数据不存在,或者是提交的时候没有选中
    if ($delvisitor && !count($delvisitorid)) {
        MooMessage('请选择要删除选项', 'index.php?n=service&h=mindme', '01');
        exit;
    }
    //note 获得当前url
    $currenturl = 'http://' . $_SERVER['SERVER_NAME'] . ':' . $_SERVER["SERVER_PORT"] . $_SERVER["REQUEST_URI"];
    $currenturl2 = preg_replace("/(&page=\\d+)/", "", $currenturl);
    //note 获得第几页
    $page = empty($_GET['page']) ? '1' : $_GET['page'];
    //note limit查询开始位置
    $start = ($page - 1) * $pagesize;
    //note 多少个人访问统计总数
    $ret_c = $_MooClass['MooMySQL']->getOne("SELECT count(*) as c FROM {$dbTablePre}service_visitor WHERE uid >0 and visitorid = '{$userid}' AND who_del !=2");
    $total = $ret_c['c'];
    if ($total > 200) {
        $total = 200;
    }
    //更改最近留意我的人最我显示200个
    $tomeArr = $_MooClass['MooMySQL']->getOne("SELECT count(*) FROM {$dbTablePre}service_visitor WHERE uid = '{$userid}' AND who_del !=1");
    $tome = $tomeArr['count(*)'];
    //note 查询出谁访问过我相关信息
    if ($total) {
        $results = $_MooClass['MooMySQL']->getAll("SELECT * FROM {$dbTablePre}service_visitor WHERE  uid >0 and visitorid = '{$userid}' AND who_del !=2 order by visitortime desc LIMIT {$start},{$pagesize}");
        $visitors = array();
        foreach ($results as $k => $v) {
            $send_user1 = array();
            $send_user2 = array();
            $vistor = array();
            $send_user1 = leer_send_user1($v['uid']);
            $send_user2 = leer_send_user2($v['uid']);
            $vistor['l'] = $v;
            $vistor['l']['visitortime'] = $vistor['l']['visitortime'] ? $vistor['l']['visitortime'] : time();
            $vistor['s'] = $send_user1;
            $vistor['t'] = $send_user2;
            $visitors[$k] = $vistor;
        }
    }
    require MooTemplate('public/service_visitor_latestvisitor', 'module');
}
Exemplo n.º 7
0
function whoismyfriend()
{
    global $_MooClass, $dbTablePre, $userid, $pagesize, $user_arr, $memcached;
    $userid = $memcached->get('uid');
    //验证登录
    $and_uuid = $_GET['uuid'];
    $checkuuid = check_uuid($and_uuid);
    if (!$checkuuid) {
        $error = "uuid_error";
        echo return_data($error, false);
        exit;
    }
    $pagesize = 12;
    //note 获取删除提交的变量
    $delfriend = MooGetGPC('delfriend', 'string');
    $delfriendid = MooGetGPC('delfriendid', 'array');
    //note 删除提交的数据
    if ($delfriend && count($delfriendid)) {
        foreach ($delfriendid as $v) {
            $_MooClass['MooMySQL']->query("DELETE FROM {$dbTablePre}service_friend WHERE fid = '{$v}'");
        }
        $return = "删除意中人成功";
        echo return_data($return);
        exit;
    }
    //note 如果提交的数据不存在,或者是提交的时候没有选中
    if ($delfriend && !count($delfriendid)) {
        $error = "请选择要删除的意中人";
        echo return_data($error, false);
        exit;
        exit;
    }
    //note 获得当前url
    $currenturl = 'http://' . $_SERVER['SERVER_NAME'] . ':' . $_SERVER["SERVER_PORT"] . $_SERVER["REQUEST_URI"];
    $currenturl2 = preg_replace("/(&page=\\d+)/", "", $currenturl);
    //note 获得第几页
    $page = empty($_GET['page']) ? 1 : $_GET['page'];
    //note limit查询开始位置
    $start = ($page - 1) * $pagesize;
    //note 已收到的统计总数
    $query = $_MooClass['MooMySQL']->getOne("select count(1) as num FROM {$dbTablePre}service_friend WHERE uid = '{$userid}'");
    $total = $query['num'];
    $total2Arr = $_MooClass['MooMySQL']->getOne("SELECT count(*) FROM {$dbTablePre}service_friend WHERE friendid = '{$userid}'");
    $total2 = $total2Arr['count(*)'];
    //note 查询出意中人相关信息
    if ($total) {
        $friend = $_MooClass['MooMySQL']->getAll("SELECT * FROM {$dbTablePre}service_friend WHERE uid = '{$userid}' order by sendtime desc LIMIT {$start},{$pagesize}");
    }
    $friendid = array();
    foreach ($friend as $k => $f) {
        $friendid[] = $f['friendid'];
    }
    $frienduid = implode(',', $friendid);
    $frienduser = $_MooClass['MooMySQL']->getAll("select s.uid,s.nickname,s.birthyear,s.height,s.salary,s.province,s.city,b.mainimg,s.gender from {$dbTablePre}members_search s left join {$dbTablePre}members_base b on s.uid=b.uid where s.uid=b.uid and s.uid in({$frienduid})");
    echo return_data($frienduser);
    exit;
}
Exemplo n.º 8
0
function site_lovequestion_del()
{
    $tid = MooGetGPC('tid', 'integer', 'G');
    $sql = "DELETE FROM {$GLOBALS['dbTablePre']}love_question WHERE lid = {$tid}";
    $GLOBALS['_MooClass']['MooMySQL']->query($sql);
    //note 插入日志
    serverlog(4, $GLOBALS['dbTablePre'] . 'love_question', '删除爱情测试题目', $GLOBALS['adminid']);
    salert("删除成功", 'index.php?action=site_lovequestion&h=list');
}
Exemplo n.º 9
0
function site_lovetype_del()
{
    $id = MooGetGPC('id', 'integer', 'G');
    $sql = "DELETE FROM {$GLOBALS['dbTablePre']}love_type WHERE id = {$id}";
    $GLOBALS['_MooClass']['MooMySQL']->query($sql);
    //note 插入日志
    serverlog(4, $GLOBALS['dbTablePre'] . 'love_type', '删除测试评分结果', $GLOBALS['adminid']);
    salert("删除成功", 'index.php?action=site_lovetype&h=list');
}
Exemplo n.º 10
0
function getComment($type, $id)
{
    global $dbTablePre, $user_arr;
    $page_per = 15;
    $page_now = MooGetGPC('page', 'integer', 'G');
    $page_url = preg_replace('/&page=[^&]*/', '', $_SERVER['REQUEST_URI']);
    $uid = empty($user_arr['uid']) ? 0 : $user_arr['uid'];
    $from_where = "FROM {prefix}comment WHERE type = '{$type}' AND id= '{$id}' AND ( ischeck = 1 OR uid = '{$uid}' ) ";
    return readTable($page_now, $page_per, $page_url, $from_where, $order_by = 'ORDER BY cid DESC', $fd_list = '*');
}
Exemplo n.º 11
0
function getlatestvisitor()
{
    global $_MooClass, $dbTablePre, $userid, $timestamp, $user_arr;
    $pagesize = 4;
    //note 获取删除提交的变量
    $delvisitor = MooGetGPC('delvisitor', 'string');
    $delvisitorid = MooGetGPC('delvisitorid', 'array');
    //取得会员的认证信息
    //$in_ask=$_MooClass['MooMySQL']->getOne("select count(*)as c from {$dbTablePre}certification where uid='$userid' and email!='' and telphone!='' ");
    //echo "select count(*)as c from {$dbTablePre}certification where uid='$userid' and email!='' and telphone!='' ";
    //$certificate=$in_ask[c];
    //echo $certificate;
    //note 删除提交的数据
    if ($delvisitor && count($delvisitorid)) {
        /*
        		foreach($delvisitorid as $v) {
        			$_MooClass['MooMySQL']->query("DELETE FROM {$dbTablePre}service_visitor WHERE vid = '$v'");
        		}*/
        for ($i = 0; $i < count($delvisitorid); $i++) {
            $result = $_MooClass['MooMySQL']->getOne("SELECT `who_del` FROM `" . $dbTablePre . "service_visitor` WHERE `vid`=" . $delvisitorid[$i], true);
            if ($result['who_del'] != 0) {
                $_MooClass['MooMySQL']->query("DELETE FROM {$dbTablePre}service_visitor WHERE vid = '{$delvisitorid[$i]}'");
            } else {
                $_MooClass['MooMySQL']->query("UPDATE `" . $dbTablePre . "service_visitor` SET `who_del`=2 WHERE `vid`=" . $delvisitorid[$i]);
            }
        }
        MooMessage("删除成功", 'index.php?n=service&h=mindme', '05');
    }
    //note 如果提交的数据不存在,或者是提交的时候没有选中
    if ($delvisitor && !count($delvisitorid)) {
        MooMessage('请选择要删除选项', 'index.php?n=service&h=mindme', '01');
        exit;
    }
    //note 获得当前url
    $currenturl = 'http://' . $_SERVER['SERVER_NAME'] . ':' . $_SERVER["SERVER_PORT"] . $_SERVER["REQUEST_URI"];
    $currenturl2 = preg_replace("/(&page=\\d+)/", "", $currenturl);
    //note 获得第几页
    $page = empty($_GET['page']) ? '1' : $_GET['page'];
    //note limit查询开始位置
    $start = ($page - 1) * $pagesize;
    //note 多少个人访问统计总数
    $ret_c = $_MooClass['MooMySQL']->getOne("SELECT count(*) as c FROM {$dbTablePre}service_visitor WHERE visitorid = '{$userid}' AND who_del !=2");
    $total = $ret_c['c'];
    if ($total > 200) {
        $total = 200;
    }
    //更改最近留意我的人最我显示200个
    $tomeArr = $_MooClass['MooMySQL']->getOne("SELECT count(*) FROM {$dbTablePre}service_visitor WHERE uid = '{$userid}' AND who_del !=1");
    $tome = $tomeArr['count(*)'];
    //note 查询出谁访问过我相关信息
    if ($total) {
        $visitor = $_MooClass['MooMySQL']->getAll("SELECT * FROM {$dbTablePre}service_visitor WHERE visitorid = '{$userid}' AND who_del !=2 order by visitortime desc LIMIT {$start},{$pagesize}");
    }
    require MooTemplate('public/service_visitor_latestvisitor', 'module');
}
Exemplo n.º 12
0
/**
 * 删除白名单
 */
function other_del_white()
{
    $id = MooGetGPC('id', 'integer', 'P');
    if (empty($id)) {
        exit(json_encode(array('flag' => 0, 'msg' => '数据不完整')));
    }
    if ($GLOBALS['_MooClass']['MooMySQL']->query('DELETE FROM ' . $GLOBALS['dbTablePre'] . 'white_list WHERE id=' . $id)) {
        exit(json_encode(array('flag' => 1, 'msg' => '白名单删除成功')));
    } else {
        exit(json_encode(array('flag' => 0, 'msg' => '删除失败')));
    }
}
Exemplo n.º 13
0
function login_login()
{
    global $_MooClass, $dbTablePre, $memcached;
    /*
    $seccode1 = strtolower(MooGetGPC('vertify_code','string','P'));
    $seccode2 = MooGetGPC('seccode','string','C');
    $session_seccode = $memcached->get($seccode2);
    
    if($seccode1 != $session_seccode){
    	MooMessageAdmin("验证码填写不正确,请确认。", "index.php?action=login",'','',3);
    }
    */
    $username = MooGetGPC('username', 'string', 'P');
    $password = MooGetGPC('password', 'string', 'P');
    $password = md5($password);
    //判断用户名和密码是否为空
    if ($username == '' || $password == '') {
        MooMessageAdmin('用户名或密码不能为空', 'index.php?n=login', 1);
    }
    $userinfo = $_MooClass['MooMySQL']->getOne("SELECT * FROM {$dbTablePre}admin_user WHERE `username`='{$username}' LIMIT 1 ", true);
    if ($userinfo['uid'] && $userinfo['password'] == $password) {
        MooSetCookie('admin', MooAuthCode("{$userinfo['uid']}\t{$userinfo['password']}", 'ENCODE'), 86400);
        //note 写入session表需要的字段值
        $online_ip = GetIP();
        $lastactive = $GLOBALS['timestamp'];
        //note 提取快到期的高级用户并加入备注中
        $nowtime = time();
        $endtime = $nowtime + 8 * 24 * 60 * 60;
        $_MooClass['MooMySQL']->query("DELETE FROM {$dbTablePre}custom_remark WHERE `keyword`='会员到期' AND `cid`='{$userinfo['uid']}'");
        $remark = $_MooClass['MooMySQL']->getAll("SELECT `uid`,`endtime` FROM {$dbTablePre}members_search WHERE `sid`={$userinfo['uid']} AND `s_cid`=30 AND `endtime`<{$endtime}", 0, 0, 0, true);
        for ($i = 0; $i < count($remark); $i++) {
            $content = "尊敬的客服,您的红娘号为" . $remark[$i]['uid'] . "的会员将于" . date('Y-m-d', $remark[$i]['endtime']) . "到期,请尽快与该会员联系";
            $_MooClass['MooMySQL']->query("INSERT INTO {$dbTablePre}custom_remark SET `cid`={$userinfo['uid']},`keyword`='会员到期',`content`='{$content}',`awoketime`='{$remark[$i]['endtime']}'");
        }
        //更新最后登录相关记录
        $sql = "UPDATE {$dbTablePre}admin_user SET lastlogin='******',lastip='{$online_ip}' WHERE uid='{$userinfo['uid']}'";
        $GLOBALS['_MooClass']['MooMySQL']->query($sql);
        $sid_list = '';
        //得到我所管理的客服id列表
        $sid_list = get_mymanage_serviceid_list($userinfo['uid'], $userinfo['groupid']);
        $time = time();
        $sql = "REPLACE INTO {$GLOBALS['dbTablePre']}admin_usersession SET uid='{$userinfo['uid']}',groupid='{$userinfo['groupid']}',dateline='{$time}',sid_list='{$sid_list}'";
        $GLOBALS['_MooClass']['MooMySQL']->query($sql);
        //添加操作日志
        serverlog(3, $dbTablePre . "admin_usersession", "{$userinfo['uid']}成功登陆后台", $userinfo['uid']);
        MooMessageAdmin('登陆成功', 'index.php?n=main', 1);
    } else {
        MooMessageAdmin('用户名或密码错误', 'index.php?n=login', 1);
    }
}
Exemplo n.º 14
0
/**
*来源获取(网站来源访问和推荐用户ID)
*@返回COOKIE值在注册的时候写入
*PHPYOU
*/
function MooGetFromwhere(){
    global $_MooCookie;
	$puid=$_MooCookie['puid'] ?$_MooCookie['puid'] :MooGetGPC('puid','integer','G');
	if($puid){
		MooSetCookie('puid', $puid, 24*3600);
	}
	$website=$_MooCookie['website']?$_MooCookie['website']:MooGetGPC('website','string','G');
	if($website){
		MooSetCookie('website', $puid, 24*3600);
	}
	if( isset($_GET['wf']) && isset($_GET['st']) ){
		MooSetCookie('where_from', "http://www.7651.com/virtual/?".$_SERVER['QUERY_STRING'], 24*3600);
		return;
	}
	if( preg_match("/\/virtual\//",$_MooCookie['where_from']) ) return;
	$rf_url = $_SERVER['HTTP_REFERER'];
	// 判断是否有外来页
	if (empty($rf_url)) {
		//error_log("rf error", 0);
		return false;
	}
	
	$rf_arr = parse_url($rf_url);
	$rf_hostname = $rf_arr["host"];
	$rf_path = $rf_ar["path"];
	
	//print_r($rf_arr);
	// 判断外来是否是本站
	if ($rf_hostname == $_SERVER["HTTP_HOST"] && strstr($rf_url, "/pop/") === false && strstr($rf_url, "/reg/") === false) {
		//error_log("rf error1", 0);
		$where_from = $_MooCookie['where_from'];
		$where_from_arr = parse_url($where_from);
		if ($where_from_arr["host"] == $_SERVER["HTTP_HOST"]) {
			MooSetCookie('where_from', "", -24*3600);
		}
		
		return false;
	}

	$where_from = $_MooCookie['where_from'];
	// 判断外来与cookie中记录是否一致
	if ($where_from == $rf_url) {
		return false;
	}

	MooSetCookie('where_from', $_SERVER['HTTP_REFERER'], 24*3600);
	return true;
}
Exemplo n.º 15
0
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');
}
Exemplo n.º 16
0
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');
}
Exemplo n.º 17
0
function searchuid()
{
    $uid = MooGetGPC('uid', 'integer', 'G');
    $sql = "SELECT s.uid,s.nickname,s.birthyear,s.marriage,s.s_cid,b.mainimg FROM {$GLOBALS['dbTablePre']}members_search as s left join {$GLOBALS['dbTablePre']}members_base as b on s.uid=b.uid  WHERE s.uid='{$uid}'";
    $res = $GLOBALS['_MooClass']['MooMySQL']->getOne($sql);
    if ($res) {
        $img = MooGetphotoAdmin($res['uid'], 'small');
        if ($img) {
            array_push($res, $img);
        } else {
            array_push($res, '无');
        }
        echo json_encode(array(0 => $res));
    } else {
        echo json_encode(array(0 => 'no'));
    }
}
Exemplo n.º 18
0
function active_chat_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);
    //note 插入日志
    serverlog(1, $GLOBALS['dbTablePre'] . 'service_chat', "{$GLOBALS['username']}查看聊天记录列表", $GLOBALS['adminid']);
    //note 调用模板
    require adminTemplate('active_chat_list');
}
Exemplo n.º 19
0
function whoaddme()
{
    global $_MooClass, $dbTablePre, $userid, $pagesize, $user_arr;
    //note 获取删除提交的变量
    $delfriend = MooGetGPC('delfriend', 'string', 'P');
    $delfriendid = MooGetGPC('delfriendid', 'array', 'P');
    //note 删除提交的数据
    if ($delfriend) {
        $ids = implode(',', $delfriendid);
        //foreach($delfriendid as $v) {
        $_MooClass['MooMySQL']->query("DELETE FROM {$dbTablePre}service_friend WHERE fid  in  ({$ids})");
        //}
        MooMessage("删除意中人成功", 'index.php?n=service&h=liker', '05');
    }
    $pagesize = 4;
    //note 获得当前url
    $currenturl = 'http://' . $_SERVER['SERVER_NAME'] . ':' . $_SERVER["SERVER_PORT"] . $_SERVER["REQUEST_URI"];
    $currenturl2 = preg_replace("/(&page=\\d+)/", "", $currenturl);
    //note 获得第几页
    $page = empty($_GET['page']) ? 1 : $_GET['page'];
    //note limit查询开始位置
    $start = ($page - 1) * $pagesize;
    //note 查出谁加我为意中人的总数
    $ret_count = $_MooClass['MooMySQL']->getOne("SELECT count(*) as c FROM {$dbTablePre}service_friend WHERE friendid = '{$userid}'");
    $total = $ret_count['c'];
    $total2Arr = $_MooClass['MooMySQL']->getOne("SELECT count(*) FROM {$dbTablePre}service_friend WHERE uid = '{$userid}'");
    $total2 = $total2Arr['count(*)'];
    //note
    if ($total) {
        $results = $_MooClass['MooMySQL']->getAll("SELECT * FROM {$dbTablePre}service_friend WHERE friendid = '{$userid}' order by sendtime desc LIMIT {$start},{$pagesize}");
        $friends = array();
        foreach ($results as $k => $v) {
            $send_user1 = array();
            $send_user2 = array();
            $friend = array();
            $send_user1 = leer_send_user1($v['uid']);
            $send_user2 = leer_send_user2($v['uid']);
            $friend['l'] = $v;
            $friend['s'] = $send_user1;
            $friend['t'] = $send_user2;
            $friends[$k] = $friend;
        }
    }
    require MooTemplate('public/service_friend_whoaddmylist', 'module');
}
Exemplo n.º 20
0
/**
@param (忘记密码)通过地址栏用户名和新密码登陆
@param return null
*/
function find_pwd()
{
    global $_MooClass, $dbTablePre, $userid, $_MooCookie;
    //	if($userid){
    //		return;
    //	}
    $uid = MooGetGPC('uid', 'string', G);
    $pwd = MooGetGPC('upwd', 'string', G);
    /*	echo md5($uid).'<br>';
    	echo md5($pwd);
    	print_r($_COOKIE);
    	exit;
    */
    if ($_MooCookie['findpwd'] == md5($pwd) && md5($uid) == $_MooCookie['finduser']) {
        $newpwd = md5(base64_decode($pwd));
        //note 修改密码
        //$_MooClass['MooMySQL']->query("update {$dbTablePre}members set password = '******' where uid = '{$uid}'");
        //if(MOOPHP_ALLOW_FASTDB){
        //			MooFastdbUpdate('members','uid',$uid);
        //		}
        MooSetCookie('auth', MooAuthCode("{$uid}\t{$newpwd}", 'ENCODE'), 86400);
        //note 写入session表需要的字段值
        $online_ip = GetIP();
        $lastactive = $GLOBALS['timestamp'];
        //$uid = $user['uid'];
        //note 更新用户的最近登录ip和最近登录时间
        $updatesqlarr = array('lastip' => $online_ip, 'lastvisit' => $lastactive, 'password' => $newpwd);
        $wheresqlarr = array('uid' => $uid);
        updatetable("members_search", $updatesqlarr, $wheresqlarr);
        if (MOOPHP_ALLOW_FASTDB) {
            $val = array();
            $val['lastip'] = $online_ip;
            $val['lastvisit'] = $lastactive;
            $val['password'] = $newpwd;
            MooFastdbUpdate('members_search', 'uid', $uid, $val);
            //!!
        }
        //note 先删除表里面已存在对应用户的session
        //$_MooClass['MooMySQL']->query("DELETE FROM `{$dbTablePre}membersession` WHERE `uid` ='$uid'");
        //$_MooClass['MooMySQL']->query("REPLACE INTO `{$dbTablePre}membersession` SET `username`= '$user[username]',`password`='$user[password]',`ip` = '$online_ip',`lastactive` = '$lastactive',`uid` = '$uid'");
        return 1;
    }
    return 0;
}
Exemplo n.º 21
0
function active_email()
{
    global $_MooClass;
    $uid = $u['uid'] = MooGetGPC('uid', 'string');
    $verifycode = MooGetGPC('verifycode', 'string');
    $username = $u['username'] = MooGetGPC('p', 'string');
    if ($verifycode == strtoupper(md5('hongniangwang' . $u['uid'] . $u['username']))) {
        $online_ip = GetIP();
        $t = time();
        $pass = md5('123456');
        $r = $_MooClass['MooMySQL']->getOne("select * from web_activelog where uid={$uid}  limit 1", true);
        if ($r['username'] == $username) {
            MooMessage("您已经激活过了", "index.php", "05");
        } else {
            //$_MooClass['MooMySQL']->query("update web_members_search,web_members_login set password='******',usertype=1,regdate='$t',last_login_time = '$t',login_meb = login_meb+1,lastip='$online_ip',lastvisit='$t'  where uid='$uid'");
            $_MooClass['MooMySQL']->query("update web_members_search as s,web_members_login as l set s.password='******',s.usertype=1,s.regdate='{$t}',l.last_login_time = '{$t}',l.lastip='{$online_ip}',l.lastvisit='{$t}'  where s.uid='{$uid}' and l.uid='{$uid}'");
            searchApi('members_man members_women')->updateAttr(array('usertype', 'regdate'), array($uid => array(1, $t)));
            $_MooClass['MooMySQL']->query("insert into web_activelog(uid,username,activetime) values('{$uid}','{$username}','{$t}')");
        }
        MooSetCookie('auth', MooAuthCode("{$uid}\t{$pass}", 'ENCODE'), 86400);
        MooSetCookie('username', $u['username'], time() + 3600);
        if (MOOPHP_ALLOW_FASTDB) {
            $user11 = MooFastdbGet('members_search', 'uid', $uid);
            $meb = $user11['login_meb'];
            $val_s = $val_l = array();
            $val_s['password'] = $pass;
            $val_s['usertype'] = 1;
            $val_s['regdate'] = $t;
            $val_l['last_login_time'] = $t;
            $val_l['login_meb'] = $meb + 1;
            $val_l['lMooFastdbUpdateastip'] = $online_ip;
            $val_l['lastvisit'] = $t;
            MooFastdbUpdate('members_search', 'uid', $uid, $val_s);
            //!!
            MooFastdbUpdate('members_login', 'uid', $uid, $val_l);
        }
        //$_MooClass['MooMySQL']->query("INSERT INTO `web_membersession` SET `username`= '$u[username]',`password`='$pass',`ip` = '$online_ip',`lastactive` = '$t',`uid` = '$uid'");
        MooMessage("验证激活成功", "index.php", "05");
    } else {
        MooMessage("参数有误!请注册", "index.php", "02");
    }
}
Exemplo n.º 22
0
function get_class_children()
{
    $parent = MooGetGPC('parent', 'integer', 'G');
    $select = MooGetGPC('select', 'integer', 'G');
    $sql = "SELECT * FROM {$GLOBALS['dbTablePre']}test_class WHERE `parent`='{$parent}' ";
    $temp = $GLOBALS['_MooClass']['MooMySQL']->getAll($sql);
    if (empty($temp)) {
        echo 'no';
        exit;
    }
    $str = "<option value=''>请选择</option>";
    foreach ($temp as $v) {
        $sel = '';
        if ($v['tc_id'] == $select) {
            $sel = ' selected="selected"';
        }
        $str .= "<option value='{$v['tc_id']}'{$sel}>{$v['test_name']}</option>";
    }
    echo $str;
}
Exemplo n.º 23
0
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');
}
Exemplo n.º 24
0
function index_index()
{
    global $_MooClass, $dbTablePre, $userid, $memcached;
    $uid = MooGetGPC('uid', 'integer');
    $puid = MooGetGPC('puid', 'integer');
    if (!$uid) {
        if (!$userid) {
            MooMessage('没有找到此会员', 'register.html');
        } else {
            MooMessage('没有找到此会员', 'index.php?n=search');
        }
    }
    if (MOOPHP_ALLOW_FASTDB) {
        $user = MooFastdbGet('members', 'uid', $uid);
        $user = array_merge($user, MooFastdbGet('memberfield', 'uid', $uid));
        $c = MooFastdbGet('choice', 'uid', $uid);
    } else {
        $user = $_MooClass['MooMySQL']->getOne("SELECT * FROM {$dbTablePre}members where uid='{$uid}'");
        $user2 = $_MooClass['MooMySQL']->getOne("SELECT * FROM {$dbTablePre}memberfield where uid='{$uid}'");
        $user = array_merge($user, $user2);
        unset($user2);
        $c = $_MooClass['MooMySQL']->getOne("SELECT * FROM {$dbTablePre}choice as mf WHERE uid='{$uid}'");
    }
    //$tuijian=$_MooClass['MooMySQL']->getAll("select * from {$dbTablePre}members where gender='$user[gender]' and is_vote='1' order by uid limit 7");
    $en_year = $user['birthyear'];
    $st_year = $en_year - 2;
    $en_year += 2;
    $sql_new = "SELECT uid,nickname,gender,birthyear,mainimg,images_ischeck FROM {$dbTablePre}members where birthyear between {$st_year} and {$en_year} and gender='{$user['gender']}' and images_ischeck=1 and is_lock=1 order by regdate desc limit 6";
    $tuijian = $_MooClass['MooMySQL']->getAll($sql_new);
    if (!$user) {
        if (!$userid) {
            MooMessage('没有您查看的会员', 'register.html');
        } else {
            MooMessage('没有您查看的会员', 'index.php?n=search');
        }
    } else {
        MooSetCookie('puid', $puid, time() + 3600, '');
        include MooTemplate('public/recommend_index', 'module');
    }
}
Exemplo n.º 25
0
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');
}
Exemplo n.º 26
0
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");
}
Exemplo n.º 27
0
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');
}
Exemplo n.º 28
0
        exit;
    } else {
        $sql = "select mid from web_activity_img where `href` = '{$href}' or `address` = '{$address}' or (`group` = '{$group}' and `sort` = '{$sort}')";
        if ($db->getOne($sql)) {
            MooMessageAdmin('信息有错误', 'activity_img.php?act=add', 2);
            exit;
        } else {
            $sql = "insert into web_activity_img (`group`,`address`,`href`,`sort`) values ('{$group}','{$address}','{$href}','{$sort}')";
            $db->query($sql);
            MooMessageAdmin('添加成功', 'activity_img.php', 2);
            exit;
        }
    }
}
$h = MooGetGPC('h', 'string', 'R') == '' ? 'list' : MooGetGPC('h', 'string', 'R');
$act = MooGetGPC('act', 'string', 'R') == '' ? 'list' : MooGetGPC('act', 'string', 'R');
switch ($act) {
    case 'sub':
        activite_sub();
        break;
    case 'delect':
        activite_delect();
        break;
    case 'edit':
        activite_edit();
        break;
    case 'add':
        activite_add();
        break;
    default:
        activite_list();
Exemplo n.º 29
0
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');
}
Exemplo n.º 30
0
Arquivo: ajax.php Projeto: noikiy/zays
function reg_modifytel()
{
    global $userid, $dbTablePre, $_MooClass;
    $tel_val = MooGetGPC('tel_val', 'string', 'G');
    $sql = "update {$dbTablePre}members_search set telphone='{$tel_val}' where uid='{$userid}'";
    if ($_MooClass['MooMySQL']->query($sql)) {
        $tel['telphone'] = $tel_val;
        if (MooFastdbUpdate('members_search', 'uid', $userid, $tel)) {
            echo 'ok';
        }
    }
}