Esempio n. 1
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');
}
Esempio n. 2
0
function activite_sub()
{
    $db = $GLOBALS['db'];
    $href = 'http://www.7651.com/index.php?n=activity&h=' . $_REQUEST['href'];
    $address = 'module/activity/templates/default/images/activity_new/' . $_REQUEST['address'];
    $group = $_REQUEST['group'];
    $sort = $_REQUEST['sort'];
    if ($_REQUEST['mid']) {
        $mid = $_REQUEST['mid'];
        $sql = "update web_activity_img SET `group` = '{$group}',`address` = '{$address}',`href` = '{$href}',`sort` = '{$sort}' where mid = '{$mid}'";
        $db->query($sql);
        MooMessageAdmin('编辑成功', 'activity_img.php', 2);
        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;
        }
    }
}
Esempio n. 3
0
function system_adminlog_del()
{
    $logid_list = MooGetGPC('checkboxes', 'string');
    $day = MooGetGPC('day', 'integer');
    $time = time() - $day * 24 * 60 * 60;
    if (empty($logid_list) && empty($day)) {
        MooMessageAdmin('参数错误', 'index.php?action=system_adminlog&h=list', 1);
    }
    if (!empty($logid_list)) {
        $logid_string = implode(',', $logid_list);
        $sql = "DELETE FROM {$GLOBALS['dbTablePre']}server_log WHERE slid IN ({$logid_string})";
        $result = $GLOBALS['_MooClass']['MooMySQL']->query($sql);
        $note = "ID:({$logid_string})";
    } else {
        $sql = "DELETE FROM {$GLOBALS['dbTablePre']}server_log WHERE time<{$time}";
        $result = $GLOBALS['_MooClass']['MooMySQL']->query($sql);
        $note = "时间早于" . date('Y-m-d H:i:s', $time);
    }
    //note 插入日志
    serverlog(4, $GLOBALS['dbTablePre'] . 'server_log', "删除日志{$note}", $GLOBALS['adminid']);
    if ($result) {
        MooMessageAdmin('删除日志成功', 'index.php?action=system_adminlog&h=list', 1);
    } else {
        MooMessageAdmin('删除日志失败', 'index.php?action=system_adminlog&h=list', 1);
    }
}
Esempio n. 4
0
function site_skin_check()
{
    global $dbTablePre, $_MooClass;
    $uid = MooGetGPC('uid', 'string');
    $sql = "select * from {$dbTablePre}members_skin where uid = '{$uid}'";
    $uid_skin = $_MooClass['MooMySQL']->getOne($sql);
    if ($_POST) {
        $image = MooGetGPC('image', 'string', 'P');
        $skiname = MooGetGPC('skiname', 'string', 'P');
        $skin_style = MooGetGPC('skin_style', 'string', 'P');
        $imgs = $_FILES['imgs'];
        $maxfilesize = 1024 * 1024;
        $time = time();
        $type = array('jpg', 'jpeg', 'gif', 'png', 'bmp');
        if (!empty($imgs['size'])) {
            foreach ($type as $v) {
                if (eregi($v, $imgs['type'])) {
                    $flag = 1;
                }
            }
            if ($flag != 1) {
                $notice = "照片必须为BMP,JPG,PNG或GIF格式";
                MooMessageAdmin($notice, 'index.php?action=site_story&h=check&uid={$uid}', 0);
                exit;
            }
            if ($imgs['size'] >= $maxfilesize) {
                $notice = "上传图片大小不得超过1M";
                MooMessageAdmin($notice, 'index.php?action=site_skin&h=check&uid={$uid}', 0);
                exit;
            }
            //删除之前上传的图片
            unlink('../' . $image);
            //note 上传到指定目录,并且获得上传后的文件描述
            $new_path = 'data/upload/images_skin/';
            $file_url = $new_path . $imgs['name'];
            if (file_exists('../' . $file_url)) {
                unlink('../' . $file_url);
            }
            if (!move_uploaded_file(str_replace('\\\\', '\\', $imgs['tmp_name']), '../' . $file_url)) {
                echo '<script>没有上传成功!;window.history.go(-1);</script>';
                exit;
            }
            $sql = "update {$dbTablePre}members_skin set skiname='{$skiname}',skin_style='{$skin_style}',image='{$file_url}',date='{$time}' where uid='{$uid}'";
            if ($_MooClass['MooMySQL']->query($sql)) {
                //note 插入日志
                serverlog(1, $GLOBALS['dbTablePre'] . 'members_skin', '修改皮肤成功', $GLOBALS['adminid']);
                salert("修改皮肤成功", "index.php?action=site_skin&h=check&uid={$uid}");
            }
        } else {
            $sql = "update {$dbTablePre}members_skin set skiname='{$skiname}',skin_style='{$skin_style}',image='{$image}',date='{$time}' where uid='{$uid}'";
            if ($_MooClass['MooMySQL']->query($sql)) {
                serverlog(1, $GLOBALS['dbTablePre'] . 'members_skin', '修改皮肤成功', $GLOBALS['adminid']);
                salert("修改皮肤成功", "index.php?action=site_skin&h=check&uid={$uid}");
            }
        }
    }
    require adminTemplate('site_skin_check');
}
Esempio n. 5
0
    $url2 = "apply_time1={$apply_time1}&apply_time2={$apply_time2}&sid={$apply_sid}&uid={$uid}";
    $currenturl = "index.php?action=vipuser&h=pay_query&" . $url2;
    $page_links = multipage($total, $page_per, $page, $currenturl);
    require adminTemplate('vipuser_pay_query');
}
/***********************************************控制层(C)*****************************************/
$h = MooGetGPC('h', 'string', 'G') == '' ? 'pay' : MooGetGPC('h', 'string', 'G');
//note 动作列表
$hlist = array('pay', 'nopay', 'downline', 'upgrade_apply', 'pay_other', 'apply_list', 'high', 'diamond', 'city_star', 'vip_summary', 'viped', 'hurryhigh', 'hurrydiamond', 'getvip_group', 'pay_query');
//note 判断页面是否存在
if (!in_array($h, $hlist)) {
    MooMessageAdmin('您要打开的页面不存在', 'index.php?action=vipuser');
}
//note 判断是否有权限
if (!checkGroup('vipuser', $h)) {
    MooMessageAdmin('您没有此操作的权限', 'index.php?action=vipuser');
}
switch ($h) {
    case 'pay':
        //note 已支付列表
        vipuser_pay();
        break;
    case 'nopay':
        //note 未支付列表
        vipuser_nopay();
        break;
    case 'downline':
        //note 线下支付
        vipuser_downline();
        break;
    case 'upgrade_apply':
Esempio n. 6
0
function site_story_edit()
{
    global $story_sweet_process, $_MooClass, $dbTablePre, $memcached;
    $ispost = MooGetGPC('ispost', 'integer', 'P');
    $imgpost = MooGetGPC('imgpost', 'integer', 'P');
    //$MooImage = MooAutoLoad('MooImage');
    if ($imgpost == '1') {
        $story_picname = MooGetGPC('imgUrl', 'string', 'P');
        $sid = MooGetGPC('sid', 'integer', 'P');
        $mid = MooGetGPC('mid', 'integer', 'P');
        //重新生成小图 覆盖原来的首页照
        $src = IMG_ROOT . $story_picname;
        $sidmd5 = $sid * 3;
        $size = getimagesize($src, $info);
        $width = $size['0'];
        $height = $size['1'];
        $sizearray = array(0 => array('width' => 280, 'height' => 168), 1 => array('width' => 252, 'height' => 151), 2 => array('width' => 150, 'height' => 90));
        $namearray = array(0 => 'big', 1 => 'medium', 2 => 'small');
        $newimages = changesize($src, '../data/upload/story', 0, 0, $width, $height, $sid, $sizearray, $namearray);
        $sql = "UPDATE {$GLOBALS['dbTablePre']}story SET is_index='{$mid}' WHERE sid='{$sid}'";
        $res = $GLOBALS['_MooClass']['MooMySQL']->query($sql);
        if ($res) {
            echo 1;
        }
        exit;
    }
    if ($ispost == '1') {
        $sid = trim(MooGetGPC('sid', 'integer', 'P'));
        $title = htmlspecialchars(trim(MooGetGPC('title', 'string', 'P')));
        $content = htmlspecialchars(trim(MooGetGPC('content', 'string', 'P')));
        $confirmtime = htmlspecialchars(MooGetGPC('confirmtime', 'string', 'P'));
        $story_date = '';
        if ($confirmtime) {
            $story_date1 = htmlspecialchars(MooGetGPC('confirmtime', 'string', 'P'));
            $story_date = strtotime($story_date1);
        } else {
            $story_date1 = trim(MooGetGPC('date', 'string', 'P'));
            $story_date = strtotime($story_date1);
        }
        $name1 = trim(MooGetGPC('name1', 'string', 'P'));
        $name1 = htmlspecialchars($name1);
        $name2 = trim(MooGetGPC('name2', 'string', 'P'));
        $name2 = htmlspecialchars($name2);
        $state = trim(MooGetGPC('state', 'integer', 'P'));
        $syscheck = trim(MooGetGPC('pass', 'integer', 'P'));
        $recommand = trim(MooGetGPC('recommand', 'integer', 'P'));
        $hot = trim(MooGetGPC('clicknum', 'integer', 'P'));
        date_default_timezone_set('Asia/Shanghai');
        $submit_date = time();
        $imgtitle = trim(MooGetGPC('imgtitle', 'string', 'P'));
        $imgtitle = htmlspecialchars($imgtitle);
        //note 上传新图片
        //note 判断上传的文件类型
        $flag = '';
        $images = array('jpg', 'jpeg', 'gif', 'png', 'bmp');
        $maxfilesize = 1024 * 1024;
        $filesize = $_FILES['img']['size'];
        if (!empty($filesize)) {
            foreach ($images as $v) {
                if (strpos($_FILES['img']['type'], $v) == true) {
                    $flag = 1;
                }
            }
            if ($flag != 1) {
                $notice = "照片必须为BMP,JPG,PNG或GIF格式";
                MooMessageAdmin($notice, 'index.php?action=site_story&h=edit&id=' . $sid, 0);
                exit;
            }
            if ($filesize > $maxfilesize) {
                $notice = "上传图片大小不得超过1M";
                MooMessageAdmin($notice, 'index.php?action=site_story&h=edit&id=' . $sid, 0);
                exit;
            }
            //note 上传到指定目录,并且获得上传后的文件描述
            global $upload;
            $upload = MooAutoLoad('MooUpload');
            $upload->config(array('targetDir' => IMG_ROOT, 'saveType' => '0'));
            $files = $upload->saveFiles('img');
            $story_picname = $files[0]['name'] . "." . $files[0]['extension'];
            $filetype = explode('.', $story_picname);
            $filetype = array_pop($filetype);
            //生成小图
            /*
            $src = IMG_ROOT.$story_picname;
            $sidmd5=$sid*3;
            $size = getimagesize($src,$info);
            $width = $size['0'];
            $height = $size['1'];
            $sizearray=array(0=>array('width'=>280,'height'=>168),1=>array('width'=>252,'height'=>151),2=>array('width'=>150,'height'=>90));
            $namearray=array(0=>'big',1=>'medium',2=>'small');
            $newimages=changesize($src,'../data/upload/story',0,0,$width,$height,$sid,$sizearray,$namearray);
            */
            $res_in_pic = '';
            if ($story_picname) {
                //note 插入story_pic表
                $sql_in_spic = "INSERT INTO {$GLOBALS['dbTablePre']}story_pic SET sid='{$sid}',img='{$story_picname}',title='{$imgtitle}',submit_date='{$submit_date}',syscheck='{$syscheck}'";
                $res_in_pic = $GLOBALS['_MooClass']['MooMySQL']->query($sql_in_spic);
            }
        }
        $sql = "UPDATE {$GLOBALS['dbTablePre']}story SET title='{$title}',content='{$content}',story_date='{$story_date}',name1='{$name1}',name2='{$name2}',state='{$state}',syscheck='{$syscheck}',recommand='{$recommand}',hot='{$hot}' WHERE sid='{$sid}' ";
        $sql_up_pic = "UPDATE {$GLOBALS['dbTablePre']}story_pic SET syscheck='{$syscheck}' WHERE sid='{$sid}'";
        $res = $GLOBALS['_MooClass']['MooMySQL']->query($sql);
        $res_up_pic = $GLOBALS['_MooClass']['MooMySQL']->query($sql_up_pic);
        //note 更新缓存
        $param = "type=query/name=story/sql=select s.sid,s.uid,s.title,s.content,s.name1,s.name2,s.story_date,sp.img from `{$dbTablePre}story` as s left join  `{$dbTablePre}story_pic` as sp on s.is_index=sp.mid where sp.syscheck=1 and s.syscheck=1 and s.recommand= '1' order by s.story_date desc,sp.img desc limit 6/cachetime=86400";
        $cachekey = md5($param);
        // 		$file = MOOPHP_DATA_DIR.'/block/story_'.$cachekey.'.data';
        if ($memcached->get('story_' . $cachekey)) {
            $memcached->delete('story_' . $cachekey);
        }
        $_MooClass['MooCache']->getBlock($param);
        $story = $GLOBALS['_MooBlock']['story'];
        //note 插入日志
        serverlog(1, $GLOBALS['dbTablePre'] . 'story', '编辑成功故事', $GLOBALS['adminid']);
        salert("编辑成功", "index.php?action=site_story&h=edit&id=" . $sid);
        exit;
    }
    //note 编辑图片页面
    $sid = MooGetGPC('id', 'integer', 'G');
    $sid = intval($sid);
    $sql = "SELECT * FROM {$GLOBALS['dbTablePre']}story WHERE `sid` = '{$sid}'";
    $sql_pic = "SELECT * FROM {$GLOBALS['dbTablePre']}story_pic WHERE `sid` = '{$sid}'";
    $editStory = $GLOBALS['_MooClass']['MooMySQL']->getOne($sql);
    $editPic = $GLOBALS['_MooClass']['MooMySQL']->getAll($sql_pic);
    require adminTemplate('site_story_edit');
}
Esempio n. 7
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');
}
Esempio n. 8
0
                 }
             }
         }
         require_once adminTemplate('vote_member_one');
     }
 } else {
     if ($act == 'delect') {
         if (empty($_REQUEST['uid'])) {
             header("location:vote_member.php?act=list");
         } else {
             $uid = $_REQUEST['uid'];
             $sql = "DELETE FROM vote_member WHERE uid = {$uid}";
             $db->query($sql);
             $sql = "DELETE FROM vote_sub WHERE uid = {$uid}";
             $db->query($sql);
             MooMessageAdmin('删除成功', 'vote_member.php?act=list', 1);
         }
     } else {
         if ($act == 'edit') {
             if (empty($_REQUEST['uid'])) {
                 header("location:vote_member.php?act=list");
             } 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']);
Esempio n. 9
0
function kefu_all()
{
    global $_MooClass;
    $channel = 1;
    $sid = $GLOBALS['adminid'];
    $page_per = 15;
    $reguser = array();
    if (!empty($_REQUEST['submit'])) {
        $page = 1;
    } else {
        $page = max(1, MooGetGPC('page', 'integer'));
    }
    $limit = 15;
    $offset = ($page - 1) * $limit;
    $group = $GLOBALS['groupid'];
    $sid = $GLOBALS['adminid'];
    $username = $GLOBALS['username'];
    if ($group == '78' || $group == '70' || $group == '67') {
        MooMessageAdmin('权限不足', 'index.php?action=activity&h=activity_member', 1);
        exit;
    } else {
        $uid = $_REQUEST['uid'];
        $channel = $_REQUEST['channel'];
        $purpose = $_REQUEST['purpose'];
        if ($purpose == '0' && $channel == '0') {
            $sql = "SELECT COUNT(id) AS COUNT FROM web_ahtv_reguser where  sid ='" . $uid . "'";
        } else {
            if ($purpose != '0' && $channel == '0') {
                $sql = "SELECT COUNT(id) AS COUNT FROM web_ahtv_reguser where purpose='" . $purpose . "' and sid ='" . $uid . "'";
            } else {
                if ($purpose == '0' && $channel != '0') {
                    $sql = "SELECT COUNT(id) AS COUNT FROM web_ahtv_reguser where channel='" . $channel . "' and sid ='" . $uid . "'";
                } else {
                    $sql = "SELECT COUNT(id) AS COUNT FROM web_ahtv_reguser where channel='" . $channel . "' and purpose='" . $purpose . "' and sid ='" . $uid . "'";
                }
            }
        }
        $a = $_MooClass['MooMySQL']->getOne($sql);
        $total = $a['COUNT'];
        if ($purpose == '0' && $channel == '0') {
            $sql = "SELECT a.id,a.uid,a.edit_time,a.next_time,a.username,a.gender,a.birthday,a.province,a.city,a.mobile,a.regtime,a.isattend,a.channel,a.purpose,a.income,a.note,a.sid FROM web_ahtv_reguser as a where  a.sid ='" . $uid . "' order by a.edit_time desc LIMIT {$offset},{$limit}";
        } else {
            if ($purpose != '0' && $channel == '0') {
                $sql = "SELECT a.id,a.uid,a.edit_time,a.next_time,a.username,a.gender,a.birthday,a.province,a.city,a.mobile,a.regtime,a.isattend,a.channel,a.purpose,a.income,a.note,a.sid  FROM web_ahtv_reguser as a where  a.purpose='" . $purpose . "' and a.sid ='" . $uid . "' order by a.edit_time desc LIMIT {$offset},{$limit}";
            } else {
                if ($purpose == '0' && $channel != '0') {
                    $sql = "SELECT a.id,a.uid,a.edit_time,a.next_time,a.username,a.gender,a.birthday,a.province,a.city,a.mobile,a.regtime,a.isattend,a.channel,a.purpose,a.income,a.note,a.sid  FROM web_ahtv_reguser as a where a.channel='" . $channel . "'  and a.sid ='" . $uid . "' order by a.edit_time desc LIMIT {$offset},{$limit}";
                } else {
                    $sql = "SELECT a.id,a.uid,a.edit_time,a.next_time,a.username,a.gender,a.birthday,a.province,a.city,a.mobile,a.regtime,a.isattend,a.channel,a.purpose,a.income,a.note,a.sid  FROM web_ahtv_reguser as a where a.channel='" . $channel . "' and a.purpose='" . $purpose . "' and a.sid ='" . $uid . "' order by a.edit_time desc LIMIT {$offset},{$limit}";
                }
            }
        }
        $currenturl = "index.php?action=activity&h=kefu_all&channel={$channel}&uid={$uid}&purpose={$purpose}";
        $pages = multipage($total, $page_per, $page, $currenturl);
        $page_num = ceil($total / $limit);
        $result = $_MooClass['MooMySQL']->getAll($sql);
        $purs = $purpose;
        foreach ($result as $key => $value) {
            $id = $value['id'];
            $uid = $value['uid'];
            $username = $value['username'];
            $gender = $value['gender'];
            $birthday = explode('-', $value['birthday']);
            $birthday = $birthday[0] . '年' . $birthday[1] . '月';
            $province = $value['province'];
            $city = $value['city'];
            $mobile = $value['mobile'];
            $regtime = $value['regtime'];
            $isattend = $value['isattend'];
            $channel = $value['channel'];
            $pur = $value['purpose'];
            if ($pur == 2) {
                $purpose = '不能参加';
            } else {
                if ($pur == 3) {
                    $purpose = '要考虑';
                } else {
                    if ($pur == 4) {
                        $purpose = '有意向';
                    } else {
                        if ($pur == 5) {
                            $purpose = '确定参加';
                        } else {
                            if ($pur == 6) {
                                $purpose = '支付环节';
                            } else {
                                $purpose = '未处理';
                            }
                        }
                    }
                }
            }
            $income = $value['income'];
            $sid = $value['sid'];
            $note = $value['note'];
            $edit_time = $value['edit_time'];
            $next_time = $value['next_time'];
            $reguser[] = array('k' => $key + 1, 'id' => $id, 'uid' => $uid, 'username' => $username, 'gender' => $gender, 'birthday' => $birthday, 'province' => $province, 'city' => $city, 'mobile' => $mobile, 'regtime' => $regtime, 'isattend' => $isattend, 'channel' => $channel, 'sid' => $sid, 'note' => $note, 'income' => $income, 'purpose' => $purpose, 'edit_time' => $edit_time, 'next_time' => $next_time);
        }
        require_once adminTemplate('activity_kf_list');
    }
}
Esempio n. 10
0
    $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_chat', "{$GLOBALS['username']}查看聊天记录列表", $GLOBALS['adminid']);
    //note 调用模板
    require adminTemplate('active_chat_list');
}
/***********************************************控制层(C)*****************************************/
$h = MooGetGPC('h', 'string', 'G') == '' ? 'list' : MooGetGPC('h', 'string', 'G');
//note 动作列表
$hlist = array('list');
//note 判断页面是否存在
if (!in_array($h, $hlist)) {
    MooMessageAdmin('您要打开的页面不存在', 'index.php?n=main');
}
//note 判断是否有权限
if (!checkGroup('active_chat', $h)) {
    MooMessageAdmin('您没有此操作的权限', 'index.php?n=main');
}
switch ($h) {
    //note 委托列表
    case 'list':
        active_chat_list();
        break;
}
Esempio n. 11
0
function hntest_class_del()
{
    $tc_id = MooGetGPC('tc_id', 'integer', 'G');
    $parent = MooGetGPC('parent', 'integer', 'G');
    $table = $GLOBALS['dbTablePre'] . 'test_class';
    if ($parent == 0) {
        $sql = "DELETE FROM {$table} WHERE parent={$tc_id}";
        $GLOBALS['_MooClass']['MooMySQL']->query($sql);
    }
    $sql = "DELETE FROM {$table} WHERE tc_id={$tc_id}";
    $GLOBALS['_MooClass']['MooMySQL']->query($sql);
    MooMessageAdmin('删除成功', 'index.php?action=hntest&h=class_list', 1);
}
Esempio n. 12
0
function carrelaxbargameedit()
{
    $href = MooGetGPC("href", "string", "P");
    $introduce = MooGetGPC("introduce", "string", "P");
    $id = MooGetGPC("id", "string", "P");
    if (empty($href)) {
        $notice = "游戏的链接地址不能为空";
        MooMessageAdmin($notice, 'index.php?n=lovestation&h=carrelaxbargame');
        exit;
    }
    if (empty($introduce)) {
        $notice = "游戏介绍说明必须填写";
        MooMessageAdmin($notice, 'index.php?n=lovestation&h=carrelaxbargame');
        exit;
    }
    /*
        if($_FILES['imgfile']['error']==UPLOAD_ERR_OK){
            $minfilesize = 100;
            $maxfilesize = 1024000;
            $filesize = $_FILES['imgfile']['size'];
            if($filesize > $maxfilesize ) {
                $notice = "请上传小于1000KB的照片。";
                MooMessageAdmin($notice,'index.php?action=lovestation&h=carrelaxbargame');
                exit();
            }
            if($filesize < $minfilesize) {
                $notice = "请上传大于100b的照片。";
                MooMessageAdmin($notice,'index.php?action=lovestation&h=carrelaxbargame');
                exit();
            }
            $true_type = file_type($_FILES['imgfile']['tmp_name']);
            $extname = strtolower(substr($_FILES['imgfile']['name'],(strrpos($_FILES['imgfile']['name'],'.')+1)));
            $images = array('/jpg/', '/jpeg/', '/gif/', '/png/', '/JPG/', '/JPEG/', '/GIF/', '/PNG/');
            if(in_array('/'.$extname.'/',$images)){
                foreach($images as $v) {
                    //note http://ask.wangmeng.cn/question/76
                    if(preg_match($v,$_FILES['imgfile']['type'])
                        && ('image/'.$true_type == $_FILES['imgfile']['type']
                            || 'image/p'.$true_type == $_FILES['imgfile']['type']
                            || 'image/x-'.$true_type == $_FILES['imgfile']['type']) ) {
    
                        $file_content = file_get_contents($_FILES['imgfile']['tmp_name']);
                        $low_file_content = strtolower($file_content);
                        $pos = strpos($low_file_content, '<?php');
                        if($pos){
                            $notice = "照片中含有不安全信息请重新上传";
                            MooMessageAdmin($notice,'index.php?n=lovestation&h=carrelaxbargame');
                            exit();
                        }else{
                            $flag = 1;
                        }
                    }
                }
            }
            if($flag != 1) {
                $notice = "请上传JPEG,JPG,PNG或GIF格式";
                MooMessageAdmin($notice,'index.php?action=lovestation&h=carrelaxbargame');
                exit();
            }
    */
    if ($_FILES['imgfile']['error'] == UPLOAD_ERR_OK) {
        $filename = "module/lovestation/templates/default/images/carrelaxbargame/" . $_FILES['imgfile']['name'];
        $data['imgfile'] = $filename;
        //上传图片处理结束
    }
    $data['href'] = $href;
    $data['introduce'] = $introduce;
    $data['dateline'] = time();
    $whearr['id'] = $id;
    updatetable("cargames", $data, $whearr);
    MooMessageAdmin("更新成功", 'index.php?action=lovestation&h=carrelaxbargame');
    exit;
}
Esempio n. 13
0
function text_show_dele()
{
    global $_MooClass;
    $id = $_REQUEST['id'];
    $sql = "DELETE FROM {$GLOBALS['dbTablePre']}text_show WHERE id = {$id}";
    $_MooClass['MooMySQL']->query($sql);
    MooMessageAdmin('删除成功', 'index.php?action=other&h=text_show', 1);
}
Esempio n. 14
0
        $value['bgtime'] = date('Y-m-d', $value['bgtime']);
        $value['endtime'] = date('Y-m-d', $value['endtime']);
        $value['k'] = $key + 1;
        $comment[] = $value;
    }
    $pages = multipage($total, $page_per, $page, $currenturl);
    $page_num = ceil($total / $limit);
    require_once adminTemplate('site_recommend_diamond_district');
}
/***********************************************控制层(C)*****************************************/
$h = MooGetGPC('h', 'string') == '' ? 'list' : MooGetGPC('h', 'string');
//note 动作列表
$hlist = array('list', 'recommendget', 'district');
//note 判断页面是否存在
if (!in_array($h, $hlist)) {
    MooMessageAdmin('您要打开的页面不存在', 'index.php?action=system_admingroup&h=list');
}
switch ($h) {
    //note 钻石会员推荐列表
    case 'list':
        site_recommend_diamond_list();
        break;
        //note 提交钻石会员推荐列表
    //note 提交钻石会员推荐列表
    case 'recommendget':
        site_recommendget();
        break;
        //NOTE 钻石会员首页推荐(地区)
    //NOTE 钻石会员首页推荐(地区)
    case 'district':
        site_recommend_diamond_district();
Esempio n. 15
0
function logout_change_identify()
{
    MooSetCookie('change_identity', '', -86400 * 365);
    $GLOBALS['change_adminid'] = 0;
    MooMessageAdmin('成功返回', 'index.php', 1);
}
Esempio n. 16
0
                    $option = $_REQUEST[$option] ? $_REQUEST[$option] : 0;
                    $content .= $i . ':' . $option . ';';
                }
            } else {
                $content .= 'text:' . $_REQUEST['text'] . ';';
            }
            $sql = "select vid from vote_content where vid = '{$h}'";
            $option1 = $_REQUEST['option1'] ? $_REQUEST['option1'] : 0;
            $option2 = $_REQUEST['option2'] ? $_REQUEST['option2'] : 0;
            $option3 = $_REQUEST['option3'] ? $_REQUEST['option3'] : 0;
            $option4 = $_REQUEST['option4'] ? $_REQUEST['option4'] : 0;
            $option5 = $_REQUEST['option5'] ? $_REQUEST['option5'] : 0;
            $option6 = $_REQUEST['option6'] ? $_REQUEST['option6'] : 0;
            $option7 = $_REQUEST['option7'] ? $_REQUEST['option7'] : 0;
            $option8 = $_REQUEST['option8'] ? $_REQUEST['option8'] : 0;
            $option9 = $_REQUEST['option9'] ? $_REQUEST['option9'] : 0;
            $option10 = $_REQUEST['option10'] ? $_REQUEST['option10'] : 0;
            //$text = $_REQUEST['text']?$_REQUEST['text']:0;
            if (!$db->getOne($sql)) {
                //$sql = "insert into vote_content(vid,option_1,option_2,option_3,option_4,option_5,option_6,option_7,option_8,option_9,option_10,text) values ('$h','$option1','$option2','$option3','$option4','$option5','$option6','$option7','$option8','$option9','$option10','$text')";
                $sql = "insert into vote_content(vid,content) values ('{$h}','{$content}')";
                $db->query($sql);
                $sql = "insert into vote_result(vid,option1,option2,option3,option4,option5,option6,option7,option8,option9,option10,text,num_people) values ('{$h}','0','0','0','0','0','0','0','0','0','0','0','0')";
                $db->query($sql);
                MooMessageAdmin('提交成功', 'vote.php', 1);
            } else {
                MooMessageAdmin('该题目已有内容', 'vote.php', 1);
            }
        }
    }
}
Esempio n. 17
0
/**
 *
 * 大队红娘奖励设置
 */
function system_adminteam_change()
{
    $referer = $_SERVER['HTTP_REFERER'];
    $group = MooGetGPC('group', 'array', 'P');
    if (empty($group)) {
        MooMessageAdmin('请确认信息的完整性', $referer, 1);
    }
    $interval = MooGetGPC('interval', 'array', 'P');
    $allot = MooGetGPC('allot', 'array', 'P');
    $amount = MooGetGPC('amount', 'array', 'P');
    $money = MooGetGPC('money', 'array', 'P');
    $sql = 'SELECT `id`,`leader_uid`,`manage_list` FROM`' . $GLOBALS['dbTablePre'] . 'admin_manage` WHERE `id` in (' . implode(',', $group) . ')';
    $manage_list_data = $GLOBALS['_MooClass']['MooMySQL']->getAll($sql);
    $data = $updata = $manages = $leader_uid = array();
    foreach ($manage_list_data as $manage) {
        if (!empty($manage['manage_list'])) {
            $manage_list = array();
            $manage_list = explode(',', $manage['manage_list']);
            foreach ($manage_list as $v) {
                if (!empty($v)) {
                    $manages[$v] = $manage['id'];
                }
            }
        }
        if (!empty($manage['leader_uid'])) {
            $leader_uid = explode(',', $manage['leader_uid']);
            foreach ($manage_list as $v) {
                if (!empty($v)) {
                    $updata[] = '(\'' . $v . '\',\'' . $interval[$manage['id']] . '\',\'' . $allot[$manage['id']] . '\',\'' . $amount[$manage['id']] . '\',\'' . $money[$manage['id']] . '\')';
                    $manages[$v] = $manage['id'];
                }
            }
        }
        $data[] = '(\'' . $manage['id'] . '\',\'' . $interval[$manage['id']] . '\',\'' . $allot[$manage['id']] . '\',\'' . $amount[$manage['id']] . '\',\'' . $money[$manage['id']] . '\')';
    }
    if (!empty($manages)) {
        $sql = 'SELECT `id`,`manage_list` FROM`' . $GLOBALS['dbTablePre'] . 'admin_manage` WHERE `id` in (' . implode(',', array_keys($manages)) . ')';
        $manage_list_data = $GLOBALS['_MooClass']['MooMySQL']->getAll($sql);
        foreach ($manage_list_data as $val) {
            $groupid = $manages[$val['id']];
            if (!empty($val['manage_list'])) {
                $leader_uid = explode(',', $val['manage_list']);
                foreach ($leader_uid as $uid) {
                    if (!empty($uid)) {
                        $updata[] = '(\'' . $uid . '\',\'' . $interval[$groupid] . '\',\'' . $allot[$groupid] . '\',\'' . $amount[$groupid] . '\',\'' . $money[$groupid] . '\')';
                    }
                }
            }
            $data[] = '(\'' . $val['id'] . '\',\'' . $interval[$groupid] . '\',\'' . $allot[$groupid] . '\',\'' . $amount[$groupid] . '\',\'' . $money[$groupid] . '\')';
        }
    }
    $user_sql = $manage_sql = '';
    if (!empty($updata)) {
        $user_sql = 'insert into `' . $GLOBALS['dbTablePre'] . 'admin_user` (`uid`,`interval`,`allot`,`amount`,`money`) values  ' . implode(',', $updata) . ' on duplicate key update `interval`=values(`interval`),`allot`=values(`allot`),`amount`=values(`amount`),`money`=values(`money`)';
    }
    if (!empty($data)) {
        $manage_sql = 'insert into `' . $GLOBALS['dbTablePre'] . 'admin_manage` (`id`,`interval`,`allot`,`amount`,`money`) values  ' . implode(',', $data) . ' on duplicate key update `interval`=values(`interval`),`allot`=values(`allot`),`amount`=values(`amount`),`money`=values(`money`)';
    }
    $user_result = empty($user_sql) ? TRUE : $GLOBALS['_MooClass']['MooMySQL']->query($user_sql);
    $manage_result = empty($manage_sql) ? TRUE : $GLOBALS['_MooClass']['MooMySQL']->query($manage_sql);
    if ($user_result && $manage_result) {
        MooMessageAdmin('队红娘币限额设置成功', $referer, 1);
    } else {
        MooMessageAdmin('队红娘币限额设置失败<br/>USER_SQL=>' . $user_sql . '<br/>MANAGE_SQL=>' . $manage_sql, $referer, 1);
    }
}
Esempio n. 18
0
    $GLOBALS['_MooClass']['MooMySQL']->query($sql);
    //note 插入日志
    serverlog(4, $GLOBALS['dbTablePre'] . 'love_type', '删除测试评分结果', $GLOBALS['adminid']);
    salert("删除成功", 'index.php?action=site_lovetype&h=list');
}
/***********************************************控制层(C)*****************************************/
$h = MooGetGPC('h', 'string', 'G') == '' ? 'list' : MooGetGPC('h', 'string', 'G');
//note 动作列表
$hlist = array('list', 'add', 'del');
//note 判断页面是否存在
if (!in_array($h, $hlist)) {
    MooMessageAdmin('您要打开的页面不存在', 'index.php?action=site_lovetype');
}
//note 判断是否有权限
if (!checkGroup('site_lovetype', $h)) {
    MooMessageAdmin('您没有此操作的权限', 'index.php?action=site&h=site_lovetype');
}
switch ($h) {
    //note 评分结果列表
    case 'list':
        site_lovetype_list();
        break;
        //note 添加评分结果
    //note 添加评分结果
    case 'add':
        site_lovetype_add();
        break;
        //note 删除评分结果
    //note 删除评分结果
    case 'del':
        site_lovetype_del();
Esempio n. 19
0
 if ($_COOKIE['Moo_username']) {
     $sql = "select uid,nickname from web_members where username = '******'Moo_username']}'";
     $values = $db->getOne($sql);
 }
 if ($_COOKIE['Moo_username'] && empty($_REQUEST['action'])) {
     $_REQUEST['action'] = 'list';
 } else {
     if (empty($_REQUEST['action'])) {
         $_REQUEST['action'] = 'list';
     } else {
         $_REQUEST['action'] = $_REQUEST['action'];
     }
 }
 if ($_REQUEST['action'] == 'sub') {
     if ($_REQUEST['check'] != 1) {
         MooMessageAdmin('请按正确的流程操作', 'index.php?n=service&h=qixi', 1);
     }
     if ($_REQUEST['nick_name']) {
         $sql = "select uid from vote_member where nick_name = '{$_REQUEST['nick_name']}'";
         $uid = $db->getOne($sql);
         unset($_REQUEST['nickname']);
         unset($_REQUEST['region']);
         unset($_REQUEST['sex']);
         unset($_REQUEST['birthdatey']);
         unset($_REQUEST['marriage']);
         unset($_REQUEST['phone']);
         unset($_REQUEST['cellphone']);
         unset($_REQUEST['education']);
         unset($_REQUEST['email']);
         unset($_REQUEST['birthdatem']);
         unset($_REQUEST['birthdated']);
Esempio n. 20
0
    $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');
}
/***********************************************控制层(C)*****************************************/
$h = MooGetGPC('h', 'string', 'G') == '' ? 'list' : MooGetGPC('h', 'string', 'G');
//note 动作列表
$hlist = array('list');
//note 判断页面是否存在
if (!in_array($h, $hlist)) {
    MooMessageAdmin('您要打开的页面不存在');
}
//note 判断是否有权限
if (!checkGroup('active_leer', $h)) {
    MooMessageAdmin('您没有此操作的权限');
}
switch ($h) {
    //note 秋波列表
    case 'list':
        active_leer_list();
        break;
}
Esempio n. 21
0
/**
 * 红娘币基础参数设置-权限组
 */
function system_admingroup_change()
{
    $group = MooGetGPC('group', 'array', 'P');
    $interval = MooGetGPC('interval', 'array', 'P');
    $allot = MooGetGPC('allot', 'array', 'P');
    $amount = MooGetGPC('amount', 'array', 'P');
    $money = MooGetGPC('money', 'array', 'P');
    $data = array();
    $update = array();
    foreach ($group as $value) {
        $data[] = '(\'' . $value . '\',\'' . $interval[$value] . '\',\'' . $allot[$value] . '\',\'' . $amount[$value] . '\',\'' . $money[$value] . '\')';
        $update[$value] = '`interval`=\'' . $interval[$value] . '\',`allot`=\'' . $allot[$value] . '\',`amount`=\'' . $amount[$value] . '\',`money`=\'' . $money[$value] . '\'';
    }
    if (!empty($data)) {
        $group_sql = 'insert into `' . $GLOBALS['dbTablePre'] . 'admin_group` (`groupid`,`interval`,`allot`,`amount`,`money`) values  ' . implode(',', $data) . ' on duplicate key update `interval`=values(`interval`),`allot`=values(`allot`),`amount`=values(`amount`),`money`=values(`money`)';
        if ($GLOBALS['_MooClass']['MooMySQL']->query($group_sql)) {
            foreach ($update as $k => $v) {
                $GLOBALS['_MooClass']['MooMySQL']->query('UPDATE `' . $GLOBALS['dbTablePre'] . 'admin_user` SET ' . $v . ' WHERE `groupid`=' . $k);
            }
            MooMessageAdmin('群组红娘币规则设置成功', 'index.php?action=system_admingroup&h=list', 1);
        } else {
            MooMessageAdmin('群组红娘币规则设置失败<br/>GROUP_SQL=>' . $group_sql, 'index.php?action=system_admingroup&h=list', 1);
        }
    } else {
        MooMessageAdmin('请确认信息的完整性', 'index.php?action=system_admingroup&h=list', 1);
    }
}
Esempio n. 22
0
    if(!$allow_ip_bool && (strpos($cur_ip,'192.168') === false)){
	    echo 'GET OUT -- '.$cur_ip;exit;
	}
   
	
} 
*/
/* $cur_ip = GetIP();
   //$cur_ip=$_GET['ip'];
   if(!in_array($cur_ip,$allow_ip)){
       if(strpos($cur_ip,'60.166.') === FALSE){
          echo 'GET OUT';exit;        
       }
   }*/
//切换身份
$chang_user = check_change_identity();
//note 所有的模块名
$actionlist = array('site', 'site_lovetest', 'site_lovequestion', 'site_lovetype', 'site_loveclinic', 'site_media', 'site_diamond', 'system_adminaction', 'system_adminuser', 'system_admingroup', 'system_adminlog', 'system_adminteam', 'system_adminmanage', 'admin', 'login', 'check', 'allmember', 'vipuser', 'active_SendMMSStat', 'active_email', 'active_uplink', 'active_commission', 'active_websms', 'active_leer', 'active_rose', 'check_memberinfo', 'diamond_music', 'active_liker', 'active_chat', 'active_bind', 'myuser', 'other', 'other_rightbottom', 'financial_telphonetime', 'financial_orderok', 'financial_ordertotal', 'financial_totalwage', 'other_members_transfer', 'hntest', 'site_story', 'site_skin', 'financial_tele_info', 'financial_wordbook', 'financial_urgencyclient', 'financial_assert', 'financial_ahtv', 'financial_ahtv_reguser', 'site_recommend_diamond', 'financial', 'system_adminmembers', 'active_cooperation', 'active_activity', 'active_activity_acceding', 'activity', 'activity_member', 'activity_kefu', 'text_show', 'matchmaker', 'chat', 'financial_joinstatistics', 'lovestation');
$mtime = explode(' ', microtime());
$starttime = $mtime[1] + $mtime[0];
$action = $action == '' ? 'admin' : $action;
//note 判断页面是否存在,不存在弹出提示,否则加载相应模块
if (!in_array($action, $actionlist)) {
    MooMessageAdmin('您要打开的页面不存在!', 'index.php?action=admin');
} else {
    require $action . '.php';
}
/* $mtime2 = explode(' ', microtime());
$endtime = $mtime2[1] + $mtime2[0];
echo '页面执行时间:'.($endtime-$starttime); */
//$_MooClass['MooMySQL']->close();
Esempio n. 23
0
function check_vote($arr, $uid = '0')
{
    global $db;
    if ($uid != 0) {
        $user_id = $uid['uid'];
    } else {
        $user_id = $arr[uid];
    }
    $where .= 'and' . ' (';
    foreach ($arr as $k => $v) {
        if (is_numeric($k)) {
            $where .= 'vid =' . "'{$k}'" . 'or' . ' ';
        }
    }
    $where = substr($where, 0, -3);
    $where .= ')';
    $sql = "select uid,vid from vote_sub where uid = '{$user_id}' {$where}";
    $last_vote = $db->getOne($sql);
    if ($last_vote) {
        MooMessageAdmin('请不要重复投票', 'index.php?n=service&h=qixi&user_id=' . $user_id, 1);
    } else {
    }
    $where = '';
}
Esempio n. 24
0
    }
    $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');
}
/***********************************************控制层(C)*****************************************/
$h = MooGetGPC('h', 'string', 'G') == '' ? 'list' : MooGetGPC('h', 'string', 'G');
//note 动作列表
$hlist = array('list');
//note 判断页面是否存在
if (!in_array($h, $hlist)) {
    MooMessageAdmin('您要打开的页面不存在', 'index.php?action=site_media');
}
//note 判断是否有权限
if (!checkGroup('active_uplink', $h)) {
    MooMessageAdmin('您没有此操作的权限', 'index.php?action=site&h=site_media');
}
switch ($h) {
    //note 委托列表
    case 'list':
        active_uplink_list();
        break;
}
Esempio n. 25
0
/**
 * 检查切换身份是否合法
 * 合法则改变当前登录者$GLOBALS['uid'],$GLOBALS['groupid'],生成标识cookie
 * @return array
 * @author fanglin
 */
function check_change_identity()
{
    $chang_user = array();
    if (!empty($_GET['change_uid'])) {
        $sql = "SELECT sid_list FROM {$GLOBALS['dbTablePre']}admin_usersession sid_list WHERE uid='{$GLOBALS['adminid']}'";
        $manage_sid_list = $GLOBALS['_MooClass']['MooMySQL']->getOne($sql);
        //主要是判断该uid客服是否归当前用户所管
        if ($manage_sid_list['sid_list'] == 'all') {
            //all 客服主管能以所有客服身份登录
            $sql = "SELECT uid,groupid,username FROM {$GLOBALS['dbTablePre']}admin_user WHERE uid='{$_GET['change_uid']}'";
            $chang_user = $GLOBALS['_MooClass']['MooMySQL']->getOne($sql);
            if (empty($chang_user)) {
                MooMessageAdmin('您要访问的用户不存在', 'index.php');
            }
            $sql = "SELECT groupname FROM {$GLOBALS['dbTablePre']}admin_group WHERE groupid='{$chang_user['groupid']}'";
            $change_group = $GLOBALS['_MooClass']['MooMySQL']->getOne($sql);
            $GLOBALS['groupid'] = $chang_user['groupid'];
            $GLOBALS['usercode'] = $chang_user['usercode'];
            $GLOBALS['username'] = $chang_user['username'];
            $GLOBALS['adminid'] = $_GET['change_uid'];
            $GLOBALS['groupname'] = $change_group['groupname'];
            MooSetCookie('change_identity', MooAuthCode("{$_GET['change_uid']}\t{$chang_user['groupid']}", 'ENCODE'), 86400);
        } else {
            //只能查看所管理范围内的
            $sid_arr = explode(',', $manage_sid_list['sid_list']);
            if (in_array($_GET['change_uid'], $sid_arr)) {
                $sql = "SELECT uid,groupid,username FROM {$GLOBALS['dbTablePre']}admin_user WHERE uid='{$_GET['change_uid']}'";
                $chang_user = $GLOBALS['_MooClass']['MooMySQL']->getOne($sql);
                $sql = "SELECT groupname FROM {$GLOBALS['dbTablePre']}admin_group WHERE groupid='{$chang_user['groupid']}'";
                $change_group = $GLOBALS['_MooClass']['MooMySQL']->getOne($sql);
                $GLOBALS['groupid'] = $chang_user['groupid'];
                $GLOBALS['usercode'] = $chang_user['usercode'];
                $GLOBALS['username'] = $chang_user['username'];
                $GLOBALS['adminid'] = $_GET['change_uid'];
                $GLOBALS['groupname'] = $change_group['groupname'];
                MooSetCookie('change_identity', MooAuthCode("{$_GET['change_uid']}\t{$chang_user['groupid']}", 'ENCODE'), 86400);
            }
        }
    } else {
        if (!empty($GLOBALS['_MooCookie']['change_identity'])) {
            $change_uid = get_change_identity();
            $sql = "SELECT uid,groupid,username FROM {$GLOBALS['dbTablePre']}admin_user WHERE uid='{$change_uid}'";
            $chang_user = $GLOBALS['_MooClass']['MooMySQL']->getOne($sql);
            $sql = "SELECT groupname FROM {$GLOBALS['dbTablePre']}admin_group WHERE groupid='{$chang_user['groupid']}'";
            $change_group = $GLOBALS['_MooClass']['MooMySQL']->getOne($sql);
            $GLOBALS['groupid'] = $chang_user['groupid'];
            $GLOBALS['usercode'] = $chang_user['usercode'];
            $GLOBALS['username'] = $chang_user['username'];
            $GLOBALS['adminid'] = $change_uid;
            $GLOBALS['groupname'] = $change_group['groupname'];
            $change_user['groupname'] = $change_group['groupname'];
            return $chang_user;
        }
    }
    return $chang_user;
}
Esempio n. 26
0
function system_adminmanage_change()
{
    $referer = $_SERVER['HTTP_REFERER'];
    $group = MooGetGPC('group', 'array', 'P');
    if (empty($group)) {
        MooMessageAdmin('请确认信息的完整性', $referer, 1);
    }
    $interval = MooGetGPC('interval', 'array', 'P');
    $allot = MooGetGPC('allot', 'array', 'P');
    $amount = MooGetGPC('amount', 'array', 'P');
    $money = MooGetGPC('money', 'array', 'P');
    $data = $update = $uids = array();
    foreach ($group as $value) {
        $data[] = '(\'' . $value . '\',\'' . $interval[$value] . '\',\'' . $allot[$value] . '\',\'' . $amount[$value] . '\',\'' . $money[$value] . '\')';
    }
    $sql = 'SELECT `id`,`manage_list` FROM`' . $GLOBALS['dbTablePre'] . 'admin_manage` WHERE `id` in (' . implode(',', $group) . ')';
    $manage_list_data = $GLOBALS['_MooClass']['MooMySQL']->getAll($sql);
    foreach ($manage_list_data as $v) {
        $manage_list = array();
        if (!empty($v['manage_list'])) {
            $manage_list = explode(',', $v['manage_list']);
            foreach ($manage_list as $uid) {
                if (!empty($uid)) {
                    $uids[$uid] = $v['id'];
                }
            }
        }
    }
    $userdata = $GLOBALS['_MooClass']['MooMySQL']->getAll('SELECT `uid` FROM`' . $GLOBALS['dbTablePre'] . 'admin_user` WHERE `uid` in (' . implode(',', array_keys($uids)) . ')');
    foreach ($userdata as $uid) {
        if (!empty($uid['uid'])) {
            $groupid = $uids[$uid['uid']];
            $update[] = '(\'' . $uid['uid'] . '\',\'' . $interval[$groupid] . '\',\'' . $allot[$groupid] . '\',\'' . $amount[$groupid] . '\',\'' . $money[$groupid] . '\')';
        }
    }
    $group_sql = empty($data) ? '' : 'insert into `' . $GLOBALS['dbTablePre'] . 'admin_manage` (`id`,`interval`,`allot`,`amount`,`money`) values  ' . implode(',', $data) . ' on duplicate key update `interval`=values(`interval`),`allot`=values(`allot`),`amount`=values(`amount`),`money`=values(`money`)';
    $user_sql = empty($update) ? '' : 'insert into `' . $GLOBALS['dbTablePre'] . 'admin_user` (`uid`,`interval`,`allot`,`amount`,`money`) values  ' . implode(',', $update) . ' on duplicate key update `interval`=values(`interval`),`allot`=values(`allot`),`amount`=values(`amount`),`money`=values(`money`)';
    $user_result = empty($user_sql) ? TRUE : $GLOBALS['_MooClass']['MooMySQL']->query($user_sql);
    $group_result = empty($group_sql) ? TRUE : $GLOBALS['_MooClass']['MooMySQL']->query($group_sql);
    if ($user_result && $group_result) {
        MooMessageAdmin('群组红娘币规则设置成功', $referer, 1);
    } else {
        MooMessageAdmin('群组红娘币规则设置失败<br/>GROUP_SQL=>' . $group_sql . '<br/>USER_SQL=>' . $user_sql, $referer, 1);
    }
}
Esempio n. 27
0
function financial_totalwage_remark()
{
    $id = MooGetGPC('id', 'integer', 'G');
    $type = MooGetGPC('type', 'string', 'G');
    $sql = "SELECT remark FROM {$GLOBALS['dbTablePre']}financial_orderok  WHERE id='{$id}'";
    $row = $GLOBALS['_MooClass']['MooMySQL']->getOne($sql);
    if ($_POST['ispost']) {
        $id = MooGetGPC('id', 'string', 'P');
        $remark = MooGetGPC('content', 'string', 'P');
        $sql = "UPDATE {$GLOBALS['dbTablePre']}financial_orderok SET remark = '{$remark}' WHERE id='{$id}'";
        $query = $GLOBALS['_MooClass']['MooMySQL']->query($sql);
        if ($query) {
            //note 插入日志
            if ($type == 'add') {
                serverlog(4, $GLOBALS['dbTablePre'] . 'financial_orderok', "{$GLOBALS['username']}写财务报表提成记录ID为:{$id}的备注", $GLOBALS['adminid']);
                MooMessageAdmin('备注添加成功', 'index.php?action=financial_totalwage&h=list');
            }
            if ($type == 'update') {
                serverlog(3, $GLOBALS['dbTablePre'] . 'financial_orderok', "{$GLOBALS['username']}修改财务报表提成记录ID为:{$id}的备注", $GLOBALS['adminid']);
                MooMessageAdmin('备注修改成功', 'index.php?action=financial_totalwage&h=list');
            }
        }
    }
    //note 调用模板
    require adminTemplate('financial_totalwage_add');
}
Esempio n. 28
0
/**
 * 红娘币基础参数设置-个人
 */
function system_adminuser_change()
{
    $uid = MooGetGPC('uid', 'array', 'P');
    $interval = MooGetGPC('interval', 'array', 'P');
    $allot = MooGetGPC('allot', 'array', 'P');
    $amount = MooGetGPC('amount', 'array', 'P');
    $money = MooGetGPC('money', 'array', 'P');
    $data = array();
    foreach ($uid as $value) {
        $data[] = '(\'' . $value . '\',\'' . $interval[$value] . '\',\'' . $allot[$value] . '\',\'' . $amount[$value] . '\',\'' . $money[$value] . '\')';
    }
    if (!empty($data)) {
        // 批量更新避免锁表
        $sql = 'insert into `' . $GLOBALS['dbTablePre'] . 'admin_user` (`uid`,`interval`,`allot`,`amount`,`money`) values  ' . implode(',', $data) . ' on duplicate key update `interval`=values(`interval`),`allot`=values(`allot`),`amount`=values(`amount`),`money`=values(`money`)';
        if ($GLOBALS['_MooClass']['MooMySQL']->query($sql)) {
            MooMessageAdmin('设置成功', $_SERVER['HTTP_REFERER']);
        } else {
            MooMessageAdmin('更新失败SQL=>' . $sql, $_SERVER['HTTP_REFERER']);
        }
    } else {
        MooMessageAdmin('数据传递失败', $_SERVER['HTTP_REFERER']);
    }
}
Esempio n. 29
0
File: vote.php Progetto: noikiy/zays
function dele($vid)
{
    global $db;
    $sql = "DELETE FROM vote WHERE vid = {$vid}";
    $db->query($sql);
    $sql = "DELETE FROM vote_result WHERE vid = {$vid}";
    $db->query($sql);
    $sql = "DELETE FROM vote_content WHERE vid = {$vid}";
    $db->query($sql);
    $sql = "DELETE FROM vote_sub WHERE vid = {$vid}";
    $db->query($sql);
    MooMessageAdmin('删除成功', 'vote.php', 1);
}