function sendto_m() { global $_MooClass, $dbTablePre, $uid, $user_arr; if (isset($_POST['actio']) && $_POST['actio'] == '1') { $mailadd = safeFilter(MooGetGPC('mailadd', 'string', 'P')); $content = safeFilter(MooGetGPC('content', 'string', 'P')); $title = safeFilter(MooGetGPC('title', 'string', 'P')); $sendid = MooGetGPC('sendid', 'string', 'P'); if ($mailadd && $content && $title) { $mailarr = explode(',', $mailadd); $date = ''; if (!$sendid) { $date = date('YmdHis') . rand(1111, 9999); $reg = "/^([a-z0-9\\+_\\-\\.]+)*@([a-z0-9\\-]+\\.)+[a-z]{2,6}\$/"; $vals = array(); foreach ($mailarr as $val) { $val = trim($val); if (preg_match($reg, $val)) { $vals[] = " ('','" . $val . "','" . $date . "')"; } } $vals = join(',', $vals); if (!empty($vals)) { $sql = "insert into {$dbTablePre}email values"; $sql .= $vals; $_MooClass['MooMySQL']->query($sql); } } $content .= "您找到心中的TA了吗?如果没有,常来真爱一生网看看(http://www.zhenaiyisheng.cc/index.php?puid={$user_arr['uid']}),付出您的真心与真情,真爱一生必定为您牵线连理,让您轻松、快捷地找到知己好友 ,祝愿天下有情人终成眷属!\n\t您恋爱了吗?您结婚了吗?如果没有,就来真爱一生网看看( http://www.zhenaiyisheng.cc/index.php?puid={$user_arr['uid']})吧!"; MooSendMail($mailadd, $title, $content, $is_template = true, $sendid); MooMessage("感谢您对真爱一生网的支持", 'index.php?n=invite&h=mail&sendid=' . $date); } else { MooMessage("信息不完整!", 'index.php?n=invite&h=mail'); } } else { $sendid = trim(MooGetGPC('sendid', 'string', 'G')); $t = $mail_str = ''; if (preg_match("/\\d{18}/", $sendid)) { $sql = "select `email` from {$dbTablePre}email where sendid='{$sendid}' limit 10"; $st = $_MooClass['MooMySQL']->getAll($sql); if ($st) { foreach ($st as $val) { $mail_str .= $t . $val['email']; $t = ','; } } } require MooTemplate('public/invite_mail', 'module'); } }
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'); }
function getData($param) { include_once 'module/myaccount/config.php'; // $wsdlURL = "http://gboss.id5.cn/services/QueryValidatorServices?wsdl"; /*$partner = "hongzhiniang123"; $partnerPW = "hongzhiniang123_4*ds6UOF"; $Key = "12345678"; $iv = "12345678";*/ $DES = new DES($Key, $iv); //$wsdlURL = "http://gboss.id5.cn/services/QueryValidatorServices?wsdl"; // echo $wsdlURL.'and'.$partner.'and'.$partnerPW;exit; try { //var_dump(file_get_contents($wsdlURL));exit; if (!@file_get_contents($wsdlURL)) { throw new SoapFault('Server', 'No WSDL found at ' . $wsdlURL); } $soap = new SoapClient($wsdlURL); //$soap->xml_encoding = 'UTF-8'; //$client = new SoapClient($ws, array('proxy_host' => "113.140.8.202", //'proxy_port' => 9682)); /*} catch ( Exception $e ) { return "Linkerror";*/ } catch (SoapFault $fault) { //return "Fault! code:".",".$fault->faultcode.", string: ".",".$fault->faultstring;exit; MooMessage("验证失败,请您重新验证@!", "index.php?n=myaccount&h=smsindex", '01'); } //var_dump ( $soap->__getTypes () ); //todo 加密数据 $partner = $DES->encrypt($partner); $partnerPW = $DES->encrypt($partnerPW); $type = $DES->encrypt($this->type); //先将中文转码 $param = mb_convert_encoding($param, "GBK", "UTF-8"); $param = $DES->encrypt($param); $params = array("userName_" => $partner, "password_" => $partnerPW, "type_" => $type, "param_" => $param); //请求查询 $data = $soap->querySingle($params); // todo 解密数据 $resultXML = $DES->decrypt($data->querySingleReturn); $resultXML = mb_convert_encoding($resultXML, "UTF-8", "GBK"); return $resultXML; }
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'); } }
function findPwd($method) { global $_MooClass, $dbTablePre, $_MooCookie, $userid; //note 只给用户3次机会 if ($method) { $_MooCookie['backpwdnum'] = $_MooCookie['backpwdnum'] ? $_MooCookie['backpwdnum'] : ''; MooSetCookie('backpwdnum', $_MooCookie['backpwdnum'] + 1, 85400); if ($_MooCookie['backpwdnum'] >= 3) { MooMessage('您今天操作次数过多,请明天再试', 'index.php', '02'); } } switch ($method) { case 1: $ToAddress = trim(MooGetGPC('email', 'string', 'P')); //查找用户表,enky修改表名 $userMsg = $_MooClass['MooMySQL']->getOne("select uid,username,password from {$dbTablePre}members_search where username='******'", true); if ($userMsg) { //有此用户 //是否邮箱认证 //$ifmail = $_MooClass['MooMySQL']->$_MooClass['MooMySQL']->getOne("select telphone from {$dbTablePre}certification where uid='{$userMsg['uid']}'"); //没认证 //if(!$ifmail['telphone']){ $email = $userMsg['username']; $password = $userMsg['password']; $ToAddressMd5 = md5($ToAddress . '+' . $password); //email和密码的md5 $QueryString = base64_encode($ToAddress . '|' . $ToAddressMd5 . '|' . time()); //url后的查询字符串 //$sql = "insert into ". $dbTablePre ."reset_password set username = '******'"; $sql = "insert into " . $dbTablePre . "reset_password set username = '******'"; $_MooClass['MooMySQL']->query($sql); //记录数据库 $ToSubject = '真爱一生网提示:修改您的密码'; //note 发送邮件 if ($userMsg['nickname']) { $ToBody = $userMsg['nickname'] . ':您好!<br>'; } else { $ToBody = 'ID为' . $userMsg['uid'] . '会员:您好!<br>'; } $ToBody .= " 因您在真爱一生网使用了找回密码功能,如果您忘记密码,请点击以下链接到真爱一生网,修改您的密码。"; $ToBody .= '<br> 提示:请在24小时内登陆真爱一生网,并在登陆后将密码修改为您容易记住的密码,如果您没有操作,无需理会此邮件。'; $ToBody .= "点击此链接修改密码:<a href='http://" . MOOPHP_HOST . "/index.php?n=myaccount&h=resetpwd&p=" . $QueryString . "'>http://" . MOOPHP_HOST . "/index.php?n=myaccount&h=resetpwd&p=" . $QueryString . "</a>"; if (sendMailByNow($ToAddress, $ToSubject, $ToBody)) { MooMessage('修改密码地址已发送至邮箱,请尽快登录邮箱操作。', 'index.php'); } else { MooMessage('数据操作失败,请重新找回密码', 'index.php?n=login&h=backpassword', '01'); } //} } else { MooMessage('无此邮箱的会员', 'index.php?n=login&h=backpassword', '01'); } break; case 2: //$umail = MooGetGPC('umail','string','P'); $phone = MooGetGPC('phone', 'string', 'P'); //判断手机号码是否符合规范 if (!preg_match('/^((1[35][\\d]{9})|(18[4689][\\d]{8}))$/', $phone)) { MooMessage('您的手机号码不正确', 'index.php?n=login&h=backpassword', '01'); } else { //查找用户表 $userMsg = $_MooClass['MooMySQL']->getOne("select m.telphone,m.uid,m.nickname from {$dbTablePre}members_search as m left join {$dbTablePre}certification as c on m.uid=c.uid where m.telphone='{$phone}' and m.is_lock = 1 limit 1", true); if (!$userMsg) { MooMessage('无使用此手机号码或绑定不正确', 'index.php?n=login&h=backpassword', '01'); } elseif ($userMsg['telphone'] == $phone) { //改为新密码 $newpwd = changePWD($userMsg['uid']); //发手机消息 if ($newpwd) { $content = "您的新密码是:" . $newpwd . ",请妥善保管好您的帐号和密码!"; //$re = siooSendMsg($phone,$content);//希希奥信息发送手机短信接口 if (SendMsg($phone, $content, 1)) { $time = time(); $_MooClass['MooMySQL']->query("INSERT INTO {$dbTablePre}smslog_sys (id,sid,uid,content,sendtime,type) values('','','{$userid}','重置密码','{$time}','重置密码')"); } MooMessage('您好!新密码已发送至您的手机,转到登陆页面', 'index.php?n=login'); } else { MooMessage('找回密码失败', 'index.php?n=login&h=backpassword', '01'); } } else { MooMessage('您的手机号码未通过验证,请用邮件方式取回密码', 'index.php?n=login&h=backpassword', '01'); } } break; } }
function service_register() { global $_MooClass, $dbTablePre, $user_arr, $userid; $channel = $_GET['channel']; $username = empty($_POST['username']) ? '' : $_POST['username']; $gender = empty($_POST['gender']) ? '0' : $_POST['gender']; $birthday_post = empty($_POST['year']) ? '' : $_POST['year']; $birthday = $birthday_post . '-' . $birthday_post; $workprovince = empty($_POST['workprovince']) ? '' : $_POST['workprovince']; $workcity = empty($_POST['workcity']) ? '' : $_POST['workcity']; $mobile = isset($_POST['mobile']) ? $_POST['mobile'] : ''; $date = date('Y-m-d'); $ip = GetIP(); //echo $user_arr['s_cid'];exit; if ($user_arr['s_cid'] == '40') { //普通会员 转向升级页面 $username = $user_arr['username']; $gender = $user_arr['gender']; // $birthday=$user_arr['birthyear'].'-'.(date('m',$user_arr['birth'])+0); $birthday = $user_arr['birth']; //birth modify $workprovince = $user_arr['province']; $workcity = $user_arr['city']; $mobile = $user_arr['telphone']; if ($channel == '2') { $_MooClass['MooMySQL']->query("insert into web_ahtv(ip,uid,upgradenum,action,operationtime,channel) values('{$ip}','{$userid}',1,3,'{$date}','2')"); $user = $_MooClass['MooMySQL']->getOne("select id from web_ahtv_reguser where uid='{$userid}' and channel='2'", true); if (empty($user['id'])) { $_MooClass['MooMySQL']->query("insert into web_ahtv_reguser(uid,username,gender,birthday,province,city,mobile,regtime,channel) values('{$userid}','{$username}','{$gender}','{$birthday}','{$workprovince}','{$workcity}','{$mobile}','{$date}','2')"); } } elseif ($channel == '3') { $_MooClass['MooMySQL']->query("insert into web_ahtv(ip,uid,upgradenum,action,operationtime,channel) values('{$ip}','{$userid}',1,3,'{$date}','3')"); $user = $_MooClass['MooMySQL']->getOne("select id from web_ahtv_reguser where uid='{$userid}' and channel='3'", true); if (empty($user['id'])) { $_MooClass['MooMySQL']->query("insert into web_ahtv_reguser(uid,username,gender,birthday,province,city,mobile,regtime,channel) values('{$userid}','{$username}','{$gender}','{$birthday}','{$workprovince}','{$workcity}','{$mobile}','{$date}','3')"); } } elseif ($channel == '4') { $_MooClass['MooMySQL']->query("insert into web_ahtv(ip,uid,regnum,action,operationtime,channel) values('{$ip}','{$userid}',1,2,'{$date}','4')"); $user = $_MooClass['MooMySQL']->getOne("select id from web_ahtv_reguser where uid={$userid} and channel='4'", true); if (empty($user['id'])) { $_MooClass['MooMySQL']->query("insert into web_ahtv_reguser(uid,username,gender,birthday,province,city,mobile,regtime,channel) values('{$userid}','{$username}','{$gender}','{$birthday}','{$workprovince}','{$workcity}','{$mobile}','{$date}','4')"); } } elseif ($channel == '5') { $_MooClass['MooMySQL']->query("insert into web_ahtv(ip,uid,regnum,action,operationtime,channel) values('{$ip}','{$userid}',1,2,'{$date}','5')"); $user = $_MooClass['MooMySQL']->getOne("select id from web_ahtv_reguser where uid={$userid} and channel='5'", true); if (empty($user['id'])) { $_MooClass['MooMySQL']->query("insert into web_ahtv_reguser(uid,username,gender,birthday,province,city,mobile,regtime,channel) values('{$userid}','{$username}','{$gender}','{$birthday}','{$workprovince}','{$workcity}','{$mobile}','{$date}','5')"); } } elseif ($channel == '6') { $_MooClass['MooMySQL']->query("insert into web_ahtv(ip,uid,regnum,action,operationtime,channel) values('{$ip}','{$userid}',1,2,'{$date}','6')"); $user = $_MooClass['MooMySQL']->getOne("select id from web_ahtv_reguser where uid={$userid} and channel='6'", true); if (empty($user['id'])) { $_MooClass['MooMySQL']->query("insert into web_ahtv_reguser(uid,username,gender,birthday,province,city,mobile,regtime,channel) values('{$userid}','{$username}','{$gender}','{$birthday}','{$workprovince}','{$workcity}','{$mobile}','{$date}','6')"); } } elseif ($channel == '7') { $_MooClass['MooMySQL']->query("insert into web_ahtv(ip,uid,regnum,action,operationtime,channel) values('{$ip}','{$userid}',1,2,'{$date}','7')"); $user = $_MooClass['MooMySQL']->getOne("select id from web_ahtv_reguser where uid={$userid} and channel='7'", true); if (empty($user['id'])) { $_MooClass['MooMySQL']->query("insert into web_ahtv_reguser(uid,username,gender,birthday,province,city,mobile,regtime,channel) values('{$userid}','{$username}','{$gender}','{$birthday}','{$workprovince}','{$workcity}','{$mobile}','{$date}','7')"); } } elseif ($channel == '8') { $_MooClass['MooMySQL']->query("insert into web_ahtv(ip,uid,regnum,action,operationtime,channel) values('{$ip}','{$userid}',1,2,'{$date}','8')"); $user = $_MooClass['MooMySQL']->getOne("select id from web_ahtv_reguser where uid={$userid} and channel='8'", true); if (empty($user['id'])) { $_MooClass['MooMySQL']->query("insert into web_ahtv_reguser(uid,username,gender,birthday,province,city,mobile,regtime,channel) values('{$userid}','{$username}','{$gender}','{$birthday}','{$workprovince}','{$workcity}','{$mobile}','{$date}','8')"); } } elseif ($channel == '9') { $_MooClass['MooMySQL']->query("insert into web_ahtv(ip,uid,regnum,action,operationtime,channel) values('{$ip}','{$userid}',1,2,'{$date}','9')"); $user = $_MooClass['MooMySQL']->getOne("select id from web_ahtv_reguser where uid={$userid} and channel='9'", true); if (empty($user['id'])) { $_MooClass['MooMySQL']->query("insert into web_ahtv_reguser(uid,username,gender,birthday,province,city,mobile,regtime,channel) values('{$userid}','{$username}','{$gender}','{$birthday}','{$workprovince}','{$workcity}','{$mobile}','{$date}','9')"); } } elseif ($channel == '10') { $_MooClass['MooMySQL']->query("insert into web_ahtv(ip,uid,regnum,action,operationtime,channel) values('{$ip}','{$userid}',1,2,'{$date}','10')"); $user = $_MooClass['MooMySQL']->getOne("select id from web_ahtv_reguser where uid={$userid} and channel='10'", true); if (empty($user['id'])) { $_MooClass['MooMySQL']->query("insert into web_ahtv_reguser(uid,username,gender,birthday,province,city,mobile,regtime,channel) values('{$userid}','{$username}','{$gender}','{$birthday}','{$workprovince}','{$workcity}','{$mobile}','{$date}','10')"); } } elseif ($channel == '11') { $_MooClass['MooMySQL']->query("insert into web_ahtv(ip,uid,regnum,action,operationtime,channel) values('{$ip}','{$userid}',1,2,'{$date}','11')"); $user = $_MooClass['MooMySQL']->getOne("select id from web_ahtv_reguser where uid={$userid} and channel='11'", true); if (empty($user['id'])) { $_MooClass['MooMySQL']->query("insert into web_ahtv_reguser(uid,username,gender,birthday,province,city,mobile,regtime,channel) values('{$userid}','{$username}','{$gender}','{$birthday}','{$workprovince}','{$workcity}','{$mobile}','{$date}','11')"); } } elseif ($channel == '12') { $_MooClass['MooMySQL']->query("insert into web_ahtv(ip,uid,regnum,action,operationtime,channel) values('{$ip}','{$userid}',1,2,'{$date}','12')"); $user = $_MooClass['MooMySQL']->getOne("select id from web_ahtv_reguser where uid={$userid} and channel='12'", true); if (empty($user['id'])) { $_MooClass['MooMySQL']->query("insert into web_ahtv_reguser(uid,username,gender,birthday,province,city,mobile,regtime,channel) values('{$userid}','{$username}','{$gender}','{$birthday}','{$workprovince}','{$workcity}','{$mobile}','{$date}','12')"); } } elseif ($channel == '13') { $_MooClass['MooMySQL']->query("insert into web_ahtv(ip,uid,regnum,action,operationtime,channel) values('{$ip}','{$userid}',1,2,'{$date}','13')"); $user = $_MooClass['MooMySQL']->getOne("select id from web_ahtv_reguser where uid={$userid} and channel='13'", true); if (empty($user['id'])) { $_MooClass['MooMySQL']->query("insert into web_ahtv_reguser(uid,username,gender,birthday,province,city,mobile,regtime,channel) values('{$userid}','{$username}','{$gender}','{$birthday}','{$workprovince}','{$workcity}','{$mobile}','{$date}','13')"); } } elseif ($channel == '14') { $_MooClass['MooMySQL']->query("insert into web_ahtv(ip,uid,regnum,action,operationtime,channel) values('{$ip}','{$userid}',1,2,'{$date}','14')"); $user = $_MooClass['MooMySQL']->getOne("select id from web_ahtv_reguser where uid={$userid} and channel='14'", true); if (empty($user['id'])) { $_MooClass['MooMySQL']->query("insert into web_ahtv_reguser(uid,username,gender,birthday,province,city,mobile,regtime,channel) values('{$userid}','{$username}','{$gender}','{$birthday}','{$workprovince}','{$workcity}','{$mobile}','{$date}','14')"); } } elseif ($channel == '15') { $_MooClass['MooMySQL']->query("insert into web_ahtv(ip,uid,regnum,action,operationtime,channel) values('{$ip}','{$userid}',1,2,'{$date}','15')"); $user = $_MooClass['MooMySQL']->getOne("select id from web_ahtv_reguser where uid={$userid} and channel='15'", true); if (empty($user['id'])) { $_MooClass['MooMySQL']->query("insert into web_ahtv_reguser(uid,username,gender,birthday,province,city,mobile,regtime,channel) values('{$userid}','{$username}','{$gender}','{$birthday}','{$workprovince}','{$workcity}','{$mobile}','{$date}','15')"); } } elseif ($channel == '16') { $_MooClass['MooMySQL']->query("insert into web_ahtv(ip,uid,regnum,action,operationtime,channel) values('{$ip}','{$userid}',1,2,'{$date}','16')"); $user = $_MooClass['MooMySQL']->getOne("select id from web_ahtv_reguser where uid={$userid} and channel='16'", true); if (empty($user['id'])) { $_MooClass['MooMySQL']->query("insert into web_ahtv_reguser(uid,username,gender,birthday,province,city,mobile,regtime,channel) values('{$userid}','{$username}','{$gender}','{$birthday}','{$workprovince}','{$workcity}','{$mobile}','{$date}','16')"); } } elseif ($channel == '17') { $_MooClass['MooMySQL']->query("insert into web_ahtv(ip,uid,regnum,action,operationtime,channel) values('{$ip}','{$userid}',1,2,'{$date}','17')"); $user = $_MooClass['MooMySQL']->getOne("select id from web_ahtv_reguser where uid={$userid} and channel='17'", true); if (empty($user['id'])) { $_MooClass['MooMySQL']->query("insert into web_ahtv_reguser(uid,username,gender,birthday,province,city,mobile,regtime,channel) values('{$userid}','{$username}','{$gender}','{$birthday}','{$workprovince}','{$workcity}','{$mobile}','{$date}','17')"); } } elseif ($channel == '18') { $_MooClass['MooMySQL']->query("insert into web_ahtv(ip,uid,regnum,action,operationtime,channel) values('{$ip}','{$userid}',1,2,'{$date}','18')"); $user = $_MooClass['MooMySQL']->getOne("select id from web_ahtv_reguser where uid={$userid} and channel='18'", true); if (empty($user['id'])) { $_MooClass['MooMySQL']->query("insert into web_ahtv_reguser(uid,username,gender,birthday,province,city,mobile,regtime,channel) values('{$userid}','{$username}','{$gender}','{$birthday}','{$workprovince}','{$workcity}','{$mobile}','{$date}','18')"); } } elseif ($channel == '19') { $_MooClass['MooMySQL']->query("insert into web_ahtv(ip,uid,regnum,action,operationtime,channel) values('{$ip}','{$userid}',1,2,'{$date}','19')"); $user = $_MooClass['MooMySQL']->getOne("select id from web_ahtv_reguser where uid={$userid} and channel='19'", true); if (empty($user['id'])) { $_MooClass['MooMySQL']->query("insert into web_ahtv_reguser(uid,username,gender,birthday,province,city,mobile,regtime,channel) values('{$userid}','{$username}','{$gender}','{$birthday}','{$workprovince}','{$workcity}','{$mobile}','{$date}','19')"); } } elseif ($channel == '20') { $_MooClass['MooMySQL']->query("insert into web_ahtv(ip,uid,regnum,action,operationtime,channel) values('{$ip}','{$userid}',1,2,'{$date}','20')"); $user = $_MooClass['MooMySQL']->getOne("select id from web_ahtv_reguser where uid={$userid} and channel='20'", true); if (empty($user['id'])) { $_MooClass['MooMySQL']->query("insert into web_ahtv_reguser(uid,username,gender,birthday,province,city,mobile,regtime,channel) values('{$userid}','{$username}','{$gender}','{$birthday}','{$workprovince}','{$workcity}','{$mobile}','{$date}','20')"); } } elseif ($channel == '21') { $_MooClass['MooMySQL']->query("insert into web_ahtv(ip,uid,regnum,action,operationtime,channel) values('{$ip}','{$userid}',1,2,'{$date}','21')"); $user = $_MooClass['MooMySQL']->getOne("select id from web_ahtv_reguser where uid={$userid} and channel='21'", true); if (empty($user['id'])) { $_MooClass['MooMySQL']->query("insert into web_ahtv_reguser(uid,username,gender,birthday,province,city,mobile,regtime,channel) values('{$userid}','{$username}','{$gender}','{$birthday}','{$workprovince}','{$workcity}','{$mobile}','{$date}','21')"); } } elseif ($channel == '22') { $_MooClass['MooMySQL']->query("insert into web_ahtv(ip,uid,regnum,action,operationtime,channel) values('{$ip}','{$userid}',1,2,'{$date}','22')"); $user = $_MooClass['MooMySQL']->getOne("select id from web_ahtv_reguser where uid={$userid} and channel='22'", true); if (empty($user['id'])) { $_MooClass['MooMySQL']->query("insert into web_ahtv_reguser(uid,username,gender,birthday,province,city,mobile,regtime,channel) values('{$userid}','{$username}','{$gender}','{$birthday}','{$workprovince}','{$workcity}','{$mobile}','{$date}','22')"); } } elseif ($channel == '23') { $_MooClass['MooMySQL']->query("insert into web_ahtv(ip,uid,regnum,action,operationtime,channel) values('{$ip}','{$userid}',1,2,'{$date}','23')"); $user = $_MooClass['MooMySQL']->getOne("select id from web_ahtv_reguser where uid={$userid} and channel='23'", true); if (empty($user['id'])) { $_MooClass['MooMySQL']->query("insert into web_ahtv_reguser(uid,username,gender,birthday,province,city,mobile,regtime,channel) values('{$userid}','{$username}','{$gender}','{$birthday}','{$workprovince}','{$workcity}','{$mobile}','{$date}','23')"); } } elseif ($channel == '24') { $_MooClass['MooMySQL']->query("insert into web_ahtv(ip,uid,regnum,action,operationtime,channel) values('{$ip}','{$userid}',1,2,'{$date}','24')"); $user = $_MooClass['MooMySQL']->getOne("select id from web_ahtv_reguser where uid={$userid} and channel='24'", true); if (empty($user['id'])) { $_MooClass['MooMySQL']->query("insert into web_ahtv_reguser(uid,username,gender,birthday,province,city,mobile,regtime,channel) values('{$userid}','{$username}','{$gender}','{$birthday}','{$workprovince}','{$workcity}','{$mobile}','{$date}','24')"); } } elseif ($channel == '25') { $_MooClass['MooMySQL']->query("insert into web_ahtv(ip,uid,regnum,action,operationtime,channel) values('{$ip}','{$userid}',1,2,'{$date}','25')"); $user = $_MooClass['MooMySQL']->getOne("select id from web_ahtv_reguser where uid={$userid} and channel='25'", true); if (empty($user['id'])) { $_MooClass['MooMySQL']->query("insert into web_ahtv_reguser(uid,username,gender,birthday,province,city,mobile,regtime,channel) values('{$userid}','{$username}','{$gender}','{$birthday}','{$workprovince}','{$workcity}','{$mobile}','{$date}','25')"); } } elseif ($channel == '26') { $_MooClass['MooMySQL']->query("insert into web_ahtv(ip,uid,regnum,action,operationtime,channel) values('{$ip}','{$userid}',1,2,'{$date}','26')"); $user = $_MooClass['MooMySQL']->getOne("select id from web_ahtv_reguser where uid={$userid} and channel='26'", true); if (empty($user['id'])) { $_MooClass['MooMySQL']->query("insert into web_ahtv_reguser(uid,username,gender,birthday,province,city,mobile,regtime,channel) values('{$userid}','{$username}','{$gender}','{$birthday}','{$workprovince}','{$workcity}','{$mobile}','{$date}','26')"); } } elseif ($channel == '27') { $_MooClass['MooMySQL']->query("insert into web_ahtv(ip,uid,regnum,action,operationtime,channel) values('{$ip}','{$userid}',1,2,'{$date}','27')"); $user = $_MooClass['MooMySQL']->getOne("select id from web_ahtv_reguser where uid={$userid} and channel='27'", true); if (empty($user['id'])) { $_MooClass['MooMySQL']->query("insert into web_ahtv_reguser(uid,username,gender,birthday,province,city,mobile,regtime,channel) values('{$userid}','{$username}','{$gender}','{$birthday}','{$workprovince}','{$workcity}','{$mobile}','{$date}','27')"); } } elseif ($channel == '28') { $_MooClass['MooMySQL']->query("insert into web_ahtv(ip,uid,regnum,action,operationtime,channel) values('{$ip}','{$userid}',1,2,'{$date}','28')"); $user = $_MooClass['MooMySQL']->getOne("select id from web_ahtv_reguser where uid={$userid} and channel='28'", true); if (empty($user['id'])) { $_MooClass['MooMySQL']->query("insert into web_ahtv_reguser(uid,username,gender,birthday,province,city,mobile,regtime,channel) values('{$userid}','{$username}','{$gender}','{$birthday}','{$workprovince}','{$workcity}','{$mobile}','{$date}','28')"); } } elseif ($channel == '29') { $_MooClass['MooMySQL']->query("insert into web_ahtv(ip,uid,regnum,action,operationtime,channel) values('{$ip}','{$userid}',1,2,'{$date}','29')"); $user = $_MooClass['MooMySQL']->getOne("select id from web_ahtv_reguser where uid={$userid} and channel='29'", true); if (empty($user['id'])) { $_MooClass['MooMySQL']->query("insert into web_ahtv_reguser(uid,username,gender,birthday,province,city,mobile,regtime,channel) values('{$userid}','{$username}','{$gender}','{$birthday}','{$workprovince}','{$workcity}','{$mobile}','{$date}','29')"); } } elseif ($channel == '30') { $_MooClass['MooMySQL']->query("insert into web_ahtv(ip,uid,regnum,action,operationtime,channel) values('{$ip}','{$userid}',1,2,'{$date}',{$channel})"); $user = $_MooClass['MooMySQL']->getOne("select id from web_ahtv_reguser where uid={$userid} and channel={$channel}", true); if (empty($user['id'])) { $_MooClass['MooMySQL']->query("insert into web_ahtv_reguser(uid,username,gender,birthday,province,city,mobile,regtime,channel) values('{$userid}','{$username}','{$gender}','{$birthday}','{$workprovince}','{$workcity}','{$mobile}','{$date}',{$channel})"); } } elseif ($channel == '31') { $_MooClass['MooMySQL']->query("insert into web_ahtv(ip,uid,regnum,action,operationtime,channel) values('{$ip}','{$userid}',1,2,'{$date}',{$channel})"); $user = $_MooClass['MooMySQL']->getOne("select id from web_ahtv_reguser where uid={$userid} and channel={$channel}", true); if (empty($user['id'])) { $_MooClass['MooMySQL']->query("insert into web_ahtv_reguser(uid,username,gender,birthday,province,city,mobile,regtime,channel) values('{$userid}','{$username}','{$gender}','{$birthday}','{$workprovince}','{$workcity}','{$mobile}','{$date}',{$channel})"); } } elseif ($channel == '32') { $_MooClass['MooMySQL']->query("insert into web_ahtv(ip,uid,regnum,action,operationtime,channel) values('{$ip}','{$userid}',1,2,'{$date}',{$channel})"); $user = $_MooClass['MooMySQL']->getOne("select id from web_ahtv_reguser where uid={$userid} and channel={$channel}", true); if (empty($user['id'])) { $_MooClass['MooMySQL']->query("insert into web_ahtv_reguser(uid,username,gender,birthday,province,city,mobile,regtime,channel) values('{$userid}','{$username}','{$gender}','{$birthday}','{$workprovince}','{$workcity}','{$mobile}','{$date}',{$channel})"); } } else { $_MooClass['MooMySQL']->query("insert into web_ahtv(ip,uid,upgradenum,action,operationtime,channel) values('{$ip}','{$userid}',1,3,'{$date}','1')"); $user = $_MooClass['MooMySQL']->getOne("select id from web_ahtv_reguser where uid='{$userid}' and channel='1'", true); if (empty($user['id'])) { $_MooClass['MooMySQL']->query("insert into web_ahtv_reguser(uid,username,gender,birthday,province,city,mobile,regtime,channel) values('{$userid}','{$username}','{$gender}','{$birthday}','{$workprovince}','{$workcity}','{$mobile}','{$date}','1')"); } } if ($channel == 4) { $url = 'index.php?n=payment&h=channel_qixi'; } else { if ($channel == 5) { $url = 'index.php?n=payment&h=channel_xuanyan'; } else { if ($channel == 6) { $url = 'index.php?n=payment&h=channel_eyes'; } else { if ($channel == 8) { $url = 'index.php?n=payment&h=channel_perfume'; } else { if ($channel == 12) { $url = 'index.php?n=payment&h=channel_azlt'; } else { if ($channel == 13) { $url = 'index.php?n=payment&h=channel_jiaren'; } else { if ($channel == 19) { $url = 'index.php?n=payment&h=channel_hand'; } else { if ($channel == 25) { $url = 'index.php?n=payment&h=channel_fakeface'; } else { if ($channel == 21) { $url = 'index.php?n=payment&h=channel_yz'; } else { if ($channel == 22) { $url = 'index.php?n=payment&h=channel_spring'; } else { if ($channel == 23) { $url = 'index.php?n=payment&h=channel_ruby'; } else { if ($channel == 24) { $url = 'index.php?n=payment&h=channel_sliver'; } else { if ($channel == 26) { $url = 'index.php?n=payment&h=channel_midsummer'; } else { if ($channel == 27) { // 免费 $url = 'index.php?n=activity&h=butterfly'; } else { if ($channel == 28) { // 免费 $url = 'index.php?n=activity&h=jhreg'; } else { if ($channel == 29) { // 免费 $url = 'index.php?n=activity&h=encounter'; } else { if ($channel == 30) { // 免费 $url = 'index.php?n=activity&h=hztv'; } else { if ($channel == 31) { // 免费 $url = 'index.php?n=payment&h=channel_dusk'; } else { if ($channel == 32) { // if ($user_arr['gender'] == 1) { $url = 'index.php?n=activity&h=rlsl'; } else { $url = 'index.php?n=payment&h=channel_rlsl'; } } else { $url = 'index.php?n=payment&h=diamond'; } } } } } } } } } } } } } } } } } } } MooMessage("您已成功报名参加活动!", $url, '03'); } elseif ($user_arr['s_cid'] == '30' || $user_arr['s_cid'] == '20' || $user_arr['s_cid'] == '10') { //钻石高级会员转向 联系真爱一生 提示 $username = $user_arr['username']; $gender = $user_arr['gender']; $barr = explode('-', $user_arr['birth']); //birth modify $birthmonth = $barr[1]; $birthmonth = empty($birthmonth) ? '' : $birthmonth; $birthday = $user_arr['birthyear'] . '-' . $birthmonth; $workprovince = $user_arr['province']; $workcity = $user_arr['city']; $mobile = $user_arr['telphone']; if ($channel == '2') { $_MooClass['MooMySQL']->query("insert into web_ahtv(ip,uid,regnum,action,operationtime,channel) values('{$ip}','{$userid}',1,2,'{$date}','2')"); $user = $_MooClass['MooMySQL']->getOne("select id from web_ahtv_reguser where uid={$userid} and channel='2'", true); if (empty($user['id'])) { $_MooClass['MooMySQL']->query("insert into web_ahtv_reguser(uid,username,gender,birthday,province,city,mobile,regtime,channel) values('{$userid}','{$username}','{$gender}','{$birthday}','{$workprovince}','{$workcity}','{$mobile}','{$date}','2')"); } } elseif ($channel == '3') { $_MooClass['MooMySQL']->query("insert into web_ahtv(ip,uid,regnum,action,operationtime,channel) values('{$ip}','{$userid}',1,2,'{$date}','3')"); $user = $_MooClass['MooMySQL']->getOne("select id from web_ahtv_reguser where uid={$userid} and channel='3'", true); if (empty($user['id'])) { $_MooClass['MooMySQL']->query("insert into web_ahtv_reguser(uid,username,gender,birthday,province,city,mobile,regtime,channel) values('{$userid}','{$username}','{$gender}','{$birthday}','{$workprovince}','{$workcity}','{$mobile}','{$date}','3')"); } } elseif ($channel == '4') { $_MooClass['MooMySQL']->query("insert into web_ahtv(ip,uid,regnum,action,operationtime,channel) values('{$ip}','{$userid}',1,2,'{$date}','4')"); $user = $_MooClass['MooMySQL']->getOne("select id from web_ahtv_reguser where uid={$userid} and channel='4'", true); if (empty($user['id'])) { $_MooClass['MooMySQL']->query("insert into web_ahtv_reguser(uid,username,gender,birthday,province,city,mobile,regtime,channel) values('{$userid}','{$username}','{$gender}','{$birthday}','{$workprovince}','{$workcity}','{$mobile}','{$date}','4')"); } } elseif ($channel == '5') { $_MooClass['MooMySQL']->query("insert into web_ahtv(ip,uid,regnum,action,operationtime,channel) values('{$ip}','{$userid}',1,2,'{$date}','5')"); $user = $_MooClass['MooMySQL']->getOne("select id from web_ahtv_reguser where uid={$userid} and channel='5'", true); if (empty($user['id'])) { $_MooClass['MooMySQL']->query("insert into web_ahtv_reguser(uid,username,gender,birthday,province,city,mobile,regtime,channel) values('{$userid}','{$username}','{$gender}','{$birthday}','{$workprovince}','{$workcity}','{$mobile}','{$date}','5')"); } } elseif ($channel == '6') { $_MooClass['MooMySQL']->query("insert into web_ahtv(ip,uid,regnum,action,operationtime,channel) values('{$ip}','{$userid}',1,2,'{$date}','6')"); $user = $_MooClass['MooMySQL']->getOne("select id from web_ahtv_reguser where uid={$userid} and channel='6'", true); if (empty($user['id'])) { $_MooClass['MooMySQL']->query("insert into web_ahtv_reguser(uid,username,gender,birthday,province,city,mobile,regtime,channel) values('{$userid}','{$username}','{$gender}','{$birthday}','{$workprovince}','{$workcity}','{$mobile}','{$date}','6')"); } } elseif ($channel == '7') { $_MooClass['MooMySQL']->query("insert into web_ahtv(ip,uid,regnum,action,operationtime,channel) values('{$ip}','{$userid}',1,2,'{$date}','7')"); $user = $_MooClass['MooMySQL']->getOne("select id from web_ahtv_reguser where uid={$userid} and channel='7'", true); if (empty($user['id'])) { $_MooClass['MooMySQL']->query("insert into web_ahtv_reguser(uid,username,gender,birthday,province,city,mobile,regtime,channel) values('{$userid}','{$username}','{$gender}','{$birthday}','{$workprovince}','{$workcity}','{$mobile}','{$date}','7')"); } } elseif ($channel == '8') { $_MooClass['MooMySQL']->query("insert into web_ahtv(ip,uid,regnum,action,operationtime,channel) values('{$ip}','{$userid}',1,2,'{$date}','8')"); $user = $_MooClass['MooMySQL']->getOne("select id from web_ahtv_reguser where uid={$userid} and channel='8'", true); if (empty($user['id'])) { $_MooClass['MooMySQL']->query("insert into web_ahtv_reguser(uid,username,gender,birthday,province,city,mobile,regtime,channel) values('{$userid}','{$username}','{$gender}','{$birthday}','{$workprovince}','{$workcity}','{$mobile}','{$date}','8')"); } } elseif ($channel == '9') { $_MooClass['MooMySQL']->query("insert into web_ahtv(ip,uid,regnum,action,operationtime,channel) values('{$ip}','{$userid}',1,2,'{$date}','9')"); $user = $_MooClass['MooMySQL']->getOne("select id from web_ahtv_reguser where uid={$userid} and channel='9'", true); if (empty($user['id'])) { $_MooClass['MooMySQL']->query("insert into web_ahtv_reguser(uid,username,gender,birthday,province,city,mobile,regtime,channel) values('{$userid}','{$username}','{$gender}','{$birthday}','{$workprovince}','{$workcity}','{$mobile}','{$date}','9')"); } } elseif ($channel == '10') { $_MooClass['MooMySQL']->query("insert into web_ahtv(ip,uid,regnum,action,operationtime,channel) values('{$ip}','{$userid}',1,2,'{$date}','10')"); $user = $_MooClass['MooMySQL']->getOne("select id from web_ahtv_reguser where uid={$userid} and channel='10'", true); if (empty($user['id'])) { $_MooClass['MooMySQL']->query("insert into web_ahtv_reguser(uid,username,gender,birthday,province,city,mobile,regtime,channel) values('{$userid}','{$username}','{$gender}','{$birthday}','{$workprovince}','{$workcity}','{$mobile}','{$date}','10')"); } } elseif ($channel == '11') { $_MooClass['MooMySQL']->query("insert into web_ahtv(ip,uid,regnum,action,operationtime,channel) values('{$ip}','{$userid}',1,2,'{$date}','11')"); $user = $_MooClass['MooMySQL']->getOne("select id from web_ahtv_reguser where uid={$userid} and channel='11'", true); if (empty($user['id'])) { $_MooClass['MooMySQL']->query("insert into web_ahtv_reguser(uid,username,gender,birthday,province,city,mobile,regtime,channel) values('{$userid}','{$username}','{$gender}','{$birthday}','{$workprovince}','{$workcity}','{$mobile}','{$date}','11')"); } } elseif ($channel == '12') { $_MooClass['MooMySQL']->query("insert into web_ahtv(ip,uid,regnum,action,operationtime,channel) values('{$ip}','{$userid}',1,2,'{$date}','12')"); $user = $_MooClass['MooMySQL']->getOne("select id from web_ahtv_reguser where uid={$userid} and channel='12'", true); if (empty($user['id'])) { $_MooClass['MooMySQL']->query("insert into web_ahtv_reguser(uid,username,gender,birthday,province,city,mobile,regtime,channel) values('{$userid}','{$username}','{$gender}','{$birthday}','{$workprovince}','{$workcity}','{$mobile}','{$date}','12')"); } } elseif ($channel == '13') { $_MooClass['MooMySQL']->query("insert into web_ahtv(ip,uid,regnum,action,operationtime,channel) values('{$ip}','{$userid}',1,2,'{$date}','13')"); $user = $_MooClass['MooMySQL']->getOne("select id from web_ahtv_reguser where uid={$userid} and channel='13'", true); if (empty($user['id'])) { $_MooClass['MooMySQL']->query("insert into web_ahtv_reguser(uid,username,gender,birthday,province,city,mobile,regtime,channel) values('{$userid}','{$username}','{$gender}','{$birthday}','{$workprovince}','{$workcity}','{$mobile}','{$date}','13')"); } } elseif ($channel == '14') { $_MooClass['MooMySQL']->query("insert into web_ahtv(ip,uid,regnum,action,operationtime,channel) values('{$ip}','{$userid}',1,2,'{$date}','14')"); $user = $_MooClass['MooMySQL']->getOne("select id from web_ahtv_reguser where uid={$userid} and channel='14'", true); if (empty($user['id'])) { $_MooClass['MooMySQL']->query("insert into web_ahtv_reguser(uid,username,gender,birthday,province,city,mobile,regtime,channel) values('{$userid}','{$username}','{$gender}','{$birthday}','{$workprovince}','{$workcity}','{$mobile}','{$date}','14')"); } } elseif ($channel == '15') { $_MooClass['MooMySQL']->query("insert into web_ahtv(ip,uid,regnum,action,operationtime,channel) values('{$ip}','{$userid}',1,2,'{$date}','15')"); $user = $_MooClass['MooMySQL']->getOne("select id from web_ahtv_reguser where uid={$userid} and channel='15'", true); if (empty($user['id'])) { $_MooClass['MooMySQL']->query("insert into web_ahtv_reguser(uid,username,gender,birthday,province,city,mobile,regtime,channel) values('{$userid}','{$username}','{$gender}','{$birthday}','{$workprovince}','{$workcity}','{$mobile}','{$date}','15')"); } } elseif ($channel == '16') { $_MooClass['MooMySQL']->query("insert into web_ahtv(ip,uid,regnum,action,operationtime,channel) values('{$ip}','{$userid}',1,2,'{$date}','16')"); $user = $_MooClass['MooMySQL']->getOne("select id from web_ahtv_reguser where uid={$userid} and channel='16'", true); if (empty($user['id'])) { $_MooClass['MooMySQL']->query("insert into web_ahtv_reguser(uid,username,gender,birthday,province,city,mobile,regtime,channel) values('{$userid}','{$username}','{$gender}','{$birthday}','{$workprovince}','{$workcity}','{$mobile}','{$date}','16')"); } } elseif ($channel == '17') { $_MooClass['MooMySQL']->query("insert into web_ahtv(ip,uid,regnum,action,operationtime,channel) values('{$ip}','{$userid}',1,2,'{$date}','17')"); $user = $_MooClass['MooMySQL']->getOne("select id from web_ahtv_reguser where uid={$userid} and channel='17'", true); if (empty($user['id'])) { $_MooClass['MooMySQL']->query("insert into web_ahtv_reguser(uid,username,gender,birthday,province,city,mobile,regtime,channel) values('{$userid}','{$username}','{$gender}','{$birthday}','{$workprovince}','{$workcity}','{$mobile}','{$date}','17')"); } } elseif ($channel == '18') { $_MooClass['MooMySQL']->query("insert into web_ahtv(ip,uid,regnum,action,operationtime,channel) values('{$ip}','{$userid}',1,2,'{$date}','18')"); $user = $_MooClass['MooMySQL']->getOne("select id from web_ahtv_reguser where uid={$userid} and channel='18'", true); if (empty($user['id'])) { $_MooClass['MooMySQL']->query("insert into web_ahtv_reguser(uid,username,gender,birthday,province,city,mobile,regtime,channel) values('{$userid}','{$username}','{$gender}','{$birthday}','{$workprovince}','{$workcity}','{$mobile}','{$date}','18')"); } } elseif ($channel == '19') { $_MooClass['MooMySQL']->query("insert into web_ahtv(ip,uid,regnum,action,operationtime,channel) values('{$ip}','{$userid}',1,2,'{$date}','19')"); $user = $_MooClass['MooMySQL']->getOne("select id from web_ahtv_reguser where uid={$userid} and channel='19'", true); if (empty($user['id'])) { $_MooClass['MooMySQL']->query("insert into web_ahtv_reguser(uid,username,gender,birthday,province,city,mobile,regtime,channel) values('{$userid}','{$username}','{$gender}','{$birthday}','{$workprovince}','{$workcity}','{$mobile}','{$date}','19')"); } } elseif ($channel == '20') { $_MooClass['MooMySQL']->query("insert into web_ahtv(ip,uid,regnum,action,operationtime,channel) values('{$ip}','{$userid}',1,2,'{$date}','20')"); $user = $_MooClass['MooMySQL']->getOne("select id from web_ahtv_reguser where uid={$userid} and channel='20'", true); if (empty($user['id'])) { $_MooClass['MooMySQL']->query("insert into web_ahtv_reguser(uid,username,gender,birthday,province,city,mobile,regtime,channel) values('{$userid}','{$username}','{$gender}','{$birthday}','{$workprovince}','{$workcity}','{$mobile}','{$date}','20')"); } } elseif ($channel == '21') { $_MooClass['MooMySQL']->query("insert into web_ahtv(ip,uid,regnum,action,operationtime,channel) values('{$ip}','{$userid}',1,2,'{$date}','21')"); $user = $_MooClass['MooMySQL']->getOne("select id from web_ahtv_reguser where uid={$userid} and channel='21'", true); if (empty($user['id'])) { $_MooClass['MooMySQL']->query("insert into web_ahtv_reguser(uid,username,gender,birthday,province,city,mobile,regtime,channel) values('{$userid}','{$username}','{$gender}','{$birthday}','{$workprovince}','{$workcity}','{$mobile}','{$date}','21')"); } } elseif ($channel == '22') { $_MooClass['MooMySQL']->query("insert into web_ahtv(ip,uid,regnum,action,operationtime,channel) values('{$ip}','{$userid}',1,2,'{$date}','22')"); $user = $_MooClass['MooMySQL']->getOne("select id from web_ahtv_reguser where uid={$userid} and channel='22'", true); if (empty($user['id'])) { $_MooClass['MooMySQL']->query("insert into web_ahtv_reguser(uid,username,gender,birthday,province,city,mobile,regtime,channel) values('{$userid}','{$username}','{$gender}','{$birthday}','{$workprovince}','{$workcity}','{$mobile}','{$date}','22')"); } } elseif ($channel == '23') { $_MooClass['MooMySQL']->query("insert into web_ahtv(ip,uid,regnum,action,operationtime,channel) values('{$ip}','{$userid}',1,2,'{$date}','23')"); $user = $_MooClass['MooMySQL']->getOne("select id from web_ahtv_reguser where uid={$userid} and channel='23'", true); if (empty($user['id'])) { $_MooClass['MooMySQL']->query("insert into web_ahtv_reguser(uid,username,gender,birthday,province,city,mobile,regtime,channel) values('{$userid}','{$username}','{$gender}','{$birthday}','{$workprovince}','{$workcity}','{$mobile}','{$date}','23')"); } } elseif ($channel == '24') { $_MooClass['MooMySQL']->query("insert into web_ahtv(ip,uid,regnum,action,operationtime,channel) values('{$ip}','{$userid}',1,2,'{$date}','24')"); $user = $_MooClass['MooMySQL']->getOne("select id from web_ahtv_reguser where uid={$userid} and channel='24'", true); if (empty($user['id'])) { $_MooClass['MooMySQL']->query("insert into web_ahtv_reguser(uid,username,gender,birthday,province,city,mobile,regtime,channel) values('{$userid}','{$username}','{$gender}','{$birthday}','{$workprovince}','{$workcity}','{$mobile}','{$date}','24')"); } } elseif ($channel == '25') { $_MooClass['MooMySQL']->query("insert into web_ahtv(ip,uid,regnum,action,operationtime,channel) values('{$ip}','{$userid}',1,2,'{$date}','25')"); $user = $_MooClass['MooMySQL']->getOne("select id from web_ahtv_reguser where uid={$userid} and channel='25'", true); if (empty($user['id'])) { $_MooClass['MooMySQL']->query("insert into web_ahtv_reguser(uid,username,gender,birthday,province,city,mobile,regtime,channel) values('{$userid}','{$username}','{$gender}','{$birthday}','{$workprovince}','{$workcity}','{$mobile}','{$date}','25')"); } } elseif ($channel == '26') { $_MooClass['MooMySQL']->query("insert into web_ahtv(ip,uid,regnum,action,operationtime,channel) values('{$ip}','{$userid}',1,2,'{$date}','26')"); $user = $_MooClass['MooMySQL']->getOne("select id from web_ahtv_reguser where uid={$userid} and channel='26'", true); if (empty($user['id'])) { $_MooClass['MooMySQL']->query("insert into web_ahtv_reguser(uid,username,gender,birthday,province,city,mobile,regtime,channel) values('{$userid}','{$username}','{$gender}','{$birthday}','{$workprovince}','{$workcity}','{$mobile}','{$date}','26')"); } } elseif ($channel == '27') { $_MooClass['MooMySQL']->query("insert into web_ahtv(ip,uid,regnum,action,operationtime,channel) values('{$ip}','{$userid}',1,2,'{$date}','27')"); $user = $_MooClass['MooMySQL']->getOne("select id from web_ahtv_reguser where uid={$userid} and channel='27'", true); if (empty($user['id'])) { $_MooClass['MooMySQL']->query("insert into web_ahtv_reguser(uid,username,gender,birthday,province,city,mobile,regtime,channel) values('{$userid}','{$username}','{$gender}','{$birthday}','{$workprovince}','{$workcity}','{$mobile}','{$date}','27')"); } } elseif ($channel == '28') { $_MooClass['MooMySQL']->query("insert into web_ahtv(ip,uid,regnum,action,operationtime,channel) values('{$ip}','{$userid}',1,2,'{$date}','28')"); $user = $_MooClass['MooMySQL']->getOne("select id from web_ahtv_reguser where uid={$userid} and channel='28'", true); if (empty($user['id'])) { $_MooClass['MooMySQL']->query("insert into web_ahtv_reguser(uid,username,gender,birthday,province,city,mobile,regtime,channel) values('{$userid}','{$username}','{$gender}','{$birthday}','{$workprovince}','{$workcity}','{$mobile}','{$date}','28')"); } } elseif ($channel == '29') { $_MooClass['MooMySQL']->query("insert into web_ahtv(ip,uid,regnum,action,operationtime,channel) values('{$ip}','{$userid}',1,2,'{$date}','29')"); $user = $_MooClass['MooMySQL']->getOne("select id from web_ahtv_reguser where uid={$userid} and channel='29'", true); if (empty($user['id'])) { $_MooClass['MooMySQL']->query("insert into web_ahtv_reguser(uid,username,gender,birthday,province,city,mobile,regtime,channel) values('{$userid}','{$username}','{$gender}','{$birthday}','{$workprovince}','{$workcity}','{$mobile}','{$date}','29')"); } } elseif ($channel == '30') { $_MooClass['MooMySQL']->query("insert into web_ahtv(ip,uid,regnum,action,operationtime,channel) values('{$ip}','{$userid}',1,2,'{$date}',{$channel})"); $user = $_MooClass['MooMySQL']->getOne("select id from web_ahtv_reguser where uid={$userid} and channel={$channel}", true); if (empty($user['id'])) { $_MooClass['MooMySQL']->query("insert into web_ahtv_reguser(uid,username,gender,birthday,province,city,mobile,regtime,channel) values('{$userid}','{$username}','{$gender}','{$birthday}','{$workprovince}','{$workcity}','{$mobile}','{$date}',{$channel})"); } } elseif ($channel == '31') { $_MooClass['MooMySQL']->query("insert into web_ahtv(ip,uid,regnum,action,operationtime,channel) values('{$ip}','{$userid}',1,2,'{$date}',{$channel})"); $user = $_MooClass['MooMySQL']->getOne("select id from web_ahtv_reguser where uid={$userid} and channel={$channel}", true); if (empty($user['id'])) { $_MooClass['MooMySQL']->query("insert into web_ahtv_reguser(uid,username,gender,birthday,province,city,mobile,regtime,channel) values('{$userid}','{$username}','{$gender}','{$birthday}','{$workprovince}','{$workcity}','{$mobile}','{$date}',{$channel})"); } } elseif ($channel == '32') { $_MooClass['MooMySQL']->query("insert into web_ahtv(ip,uid,regnum,action,operationtime,channel) values('{$ip}','{$userid}',1,2,'{$date}',{$channel})"); $user = $_MooClass['MooMySQL']->getOne("select id from web_ahtv_reguser where uid={$userid} and channel={$channel}", true); if (empty($user['id'])) { $_MooClass['MooMySQL']->query("insert into web_ahtv_reguser(uid,username,gender,birthday,province,city,mobile,regtime,channel) values('{$userid}','{$username}','{$gender}','{$birthday}','{$workprovince}','{$workcity}','{$mobile}','{$date}',{$channel})"); } } else { $_MooClass['MooMySQL']->query("insert into web_ahtv(ip,uid,regnum,action,operationtime,channel) values('{$ip}','{$userid}',1,2,'{$date}','1')"); $user = $_MooClass['MooMySQL']->getOne("select id from web_ahtv_reguser where uid={$userid} and channel='1'", true); if (empty($user['id'])) { $_MooClass['MooMySQL']->query("insert into web_ahtv_reguser(uid,username,gender,birthday,province,city,mobile,regtime,channel) values('{$userid}','{$username}','{$gender}','{$birthday}','{$workprovince}','{$workcity}','{$mobile}','{$date}','1')"); } } if ($channel == 4) { $url = 'index.php?n=payment&h=channel_qixi'; } else { if ($channel == 5) { $url = 'index.php?n=payment&h=channel_xuanyan'; } else { if ($channel == 6) { $url = 'index.php?n=payment&h=channel_eyes'; } else { if ($channel == 8) { $url = 'index.php?n=payment&h=channel_perfume'; } else { if ($channel == 12) { $url = 'index.php?n=payment&h=channel_azlt'; } else { if ($channel == 13) { $url = 'index.php?n=payment&h=channel_jiaren'; } else { if ($channel == 15) { $url = 'index.php?n=payment&h=channel_wink'; } else { if ($channel == 16) { $url = 'index.php?n=payment&h=channel_sing'; } else { if ($channel == 17) { $url = 'index.php?n=payment&h=channel_luck'; } else { if ($channel == 18) { $url = 'index.php?n=payment&h=channel_gourd'; } else { if ($channel == 19) { $url = 'index.php?n=payment&h=channel_hand'; } else { if ($channel == 20) { $url = 'index.php?n=payment&h=channel_spa'; } else { if ($channel == 21) { $url = 'index.php?n=payment&h=channel_yz'; } else { if ($channel == 22) { $url = 'index.php?n=payment&h=channel_spring'; } else { if ($channel == 23) { $url = 'index.php?n=payment&h=channel_ruby'; } else { if ($channel == 24) { $url = 'index.php?n=payment&h=channel_sliver'; } else { if ($channel == 25) { $url = 'index.php?n=payment&h=channel_fakeface'; } else { if ($channel == 26) { $url = 'index.php?n=payment&h=channel_midsummer'; } else { if ($channel == 27) { // 免费 $url = 'index.php?n=activity&h=butterfly'; } else { if ($channel == 28) { // 免费 $url = 'index.php?n=activity&h=jhreg'; } else { if ($channel == 29) { // 免费 $url = 'index.php?n=activity&h=encounter'; } else { if ($channel == 30) { // 免费 $url = 'index.php?n=activity&h=hztv'; } else { if ($channel == 31) { $url = 'index.php?n=payment&h=channel_dusk'; } else { if ($channel == 32) { if ($user_arr['gender'] == 1) { $url = 'index.php?n=activity&h=rlsl'; } else { $url = 'index.php?n=payment&h=channel_rlsl'; } } else { $url = 'index.php?n=payment&h=diamond'; } } } } } } } } } } } } } } } } } } } } } } } } MooMessage("请拨打 4006780405 找您的专线真爱一生联系!", $url, '03'); } elseif (empty($userid)) { $ip = GetIP(); if ($channel == '2') { $_MooClass['MooMySQL']->query("insert into web_ahtv(ip,uid,regnum,action,operationtime,channel) values('{$ip}','{$userid}',1,2,'{$date}','2')"); $user = $_MooClass['MooMySQL']->getOne("select id from web_ahtv_reguser where mobile='{$mobile}' and channel='2'", true); if (empty($user['id'])) { $_MooClass['MooMySQL']->query("insert into web_ahtv_reguser(uid,username,gender,birthday,province,city,mobile,regtime,channel) values('{$userid}','{$username}','{$gender}','{$birthday}','{$workprovince}','{$workcity}','{$mobile}','{$date}','2')"); } } elseif ($channel == '3') { $_MooClass['MooMySQL']->query("insert into web_ahtv(ip,uid,regnum,action,operationtime,channel) values('{$ip}','{$userid}',1,2,'{$date}','3')"); $user = $_MooClass['MooMySQL']->getOne("select id from web_ahtv_reguser where mobile='{$mobile}' and channel='3'", true); if (empty($user['id'])) { $_MooClass['MooMySQL']->query("insert into web_ahtv_reguser(uid,username,gender,birthday,province,city,mobile,regtime,channel) values('{$userid}','{$username}','{$gender}','{$birthday}','{$workprovince}','{$workcity}','{$mobile}','{$date}','3')"); } } elseif ($channel == '7') { $_MooClass['MooMySQL']->query("insert into web_ahtv(ip,uid,regnum,action,operationtime,channel) values('{$ip}','{$userid}',1,2,'{$date}','7')"); $user = $_MooClass['MooMySQL']->getOne("select id from web_ahtv_reguser where mobile='{$mobile}' and channel='7'", true); if (empty($user['id'])) { $_MooClass['MooMySQL']->query("insert into web_ahtv_reguser(uid,username,gender,birthday,province,city,mobile,regtime,channel) values('{$userid}','{$username}','{$gender}','{$birthday}','{$workprovince}','{$workcity}','{$mobile}','{$date}','7')"); } } elseif ($channel == '10') { $_MooClass['MooMySQL']->query("insert into web_ahtv(ip,uid,regnum,action,operationtime,channel) values('{$ip}','{$userid}',1,2,'{$date}','10')"); $user = $_MooClass['MooMySQL']->getOne("select id from web_ahtv_reguser where mobile='{$mobile}' and channel='10'", true); if (empty($user['id'])) { $_MooClass['MooMySQL']->query("insert into web_ahtv_reguser(uid,username,gender,birthday,province,city,mobile,regtime,channel) values('{$userid}','{$username}','{$gender}','{$birthday}','{$workprovince}','{$workcity}','{$mobile}','{$date}','10')"); } } elseif ($channel == '11') { $_MooClass['MooMySQL']->query("insert into web_ahtv(ip,uid,regnum,action,operationtime,channel) values('{$ip}','{$userid}',1,2,'{$date}','11')"); $user = $_MooClass['MooMySQL']->getOne("select id from web_ahtv_reguser where mobile='{$mobile}' and channel='11'", true); if (empty($user['id'])) { $_MooClass['MooMySQL']->query("insert into web_ahtv_reguser(uid,username,gender,birthday,province,city,mobile,regtime,channel) values('{$userid}','{$username}','{$gender}','{$birthday}','{$workprovince}','{$workcity}','{$mobile}','{$date}','11')"); } } elseif ($channel == '4' || $channel == '5' || $channel == '6' || $channel == '8' || $channel == '12' || $channel == '13' || $channel == '14' || $channel == '15' || $channel == '16' || $channel == '17' || $channel == '18' || $channel == '25' || $channel == '20' || $channel == '21' || $channel == '22' || $channel == '24' || $channel == '26' || in_array($channel, array(27, 28, 29, 30, 31, 32))) { MooMessage("尊敬的游客您好,本次活动仅限注册用户才可以,请您先注册或者登录后才可以参见!", 'index.php?n=register', '03'); } else { $_MooClass['MooMySQL']->query("insert into web_ahtv(ip,uid,regnum,action,operationtime,channel) values('{$ip}','{$userid}',1,2,'{$date}','1')"); $user = $_MooClass['MooMySQL']->getOne("select id from web_ahtv_reguser where mobile='{$mobile}' and channel='1'", true); if (empty($user['id'])) { $_MooClass['MooMySQL']->query("insert into web_ahtv_reguser(uid,username,gender,birthday,province,city,mobile,regtime,channel) values('{$userid}','{$username}','{$gender}','{$birthday}','{$workprovince}','{$workcity}','{$mobile}','{$date}','1')"); } } MooMessage("您已成功报名参加活动,现在跳转到真爱一生网注册页面!", 'index.php?n=register', '03'); } }
function black_member() { global $_MooClass, $dbTablePre, $timestamp, $user_arr; $is_action = MooGetGPC("is_post", "string", 'G'); if ($is_action == "add") { $black_uid = MooGetGPC("black_uid", 'integer', 'P'); $uid = 0; if ($user_arr['uid'] != $black_uid) { if ($black_uid) { $uid = $_MooClass['MooMySQL']->getOne("SELECT uid FROM {$dbTablePre}members_search WHERE uid='{$black_uid}' LIMIT 1 ", true); $uid = $uid['uid']; if (empty($uid)) { $msg = '没有此会员,请确保您输入的会员ID存在。'; } } else { $msg = '请输入您要加入黑名单的会员ID'; } if ($uid) { $_MooClass['MooMySQL']->query("INSERT INTO {$dbTablePre}screen set uid='{$user_arr['uid']}',mid='{$black_uid}'"); $msg = '成功将会员(ID:' . $uid . ')加入黑名单。'; } } else { $msg = '您不能将自己加到黑名单!'; } MooMessage($msg, 'index.php?n=service&h=black'); } if ($is_action == "delblack") { $del_id_arr = MooGetGPC('id', 'string', 'P'); if (empty($del_id_arr)) { MooMessage('请选择要删除的内容', 'javascript:history.go(-1);'); } if (!empty($del_id_arr)) { $del_id_list = implode(',', $del_id_arr); $sql = "DELETE FROM {$dbTablePre}screen WHERE mid IN({$del_id_list})"; $_MooClass['MooMySQL']->query($sql); } MooMessage("删除成功", 'index.php?n=service&h=black', '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; $query = $_MooClass['MooMySQL']->getOne("SELECT count(1) as c FROM {$dbTablePre}screen where uid='{$user_arr['uid']}'"); $total = $query['c']; $sql = "SELECT * FROM {$dbTablePre}screen where uid='{$user_arr['uid']}' LIMIT {$start},{$pagesize}"; $black_uid = $_MooClass['MooMySQL']->getAll($sql); $page_list = multimail($total, $pagesize, $page, $currenturl2); require MooTemplate('public/service_black_list', 'module'); }
function material_imgedit() { global $_MooClass, $dbTablePre, $userid, $user_arr; $cache_file = './data/cache/cache_imgedit.php'; $path = './data/iparts/vs/'; $cache_iparts = get_imgedit_cache($cache_file, $path); $imageName = trim($_GET['imageName']); if (MOOPHP_ALLOW_FASTDB) { $usercer = MooFastdbGet('certification', 'uid', $userid); } else { $usercer = $_MooClass['MooMySQL']->getOne("SELECT * FROM {$dbTablePre}certification WHERE uid='{$userid}' LIMIT 1 ", true); } $sql = "select `imgurl`,`pic_date`,`pic_name` from `{$dbTablePre}pic` where `uid` = '{$userid}' AND `isimage` = '0' order by imgid desc"; $image_list = $_MooClass['MooMySQL']->getAll($sql, 0, 0, 0, true); if (!file_exists(base64_decode($imageName))) { $temp_k = rand(0, sizeof($image_list) - 1); $imageName = base64_encode($image_list[$temp_k]['imgurl']); } if (empty($imageName)) { MooMessage("您的相册里还没有上传照片,赶快去上传自己的图片吧。", 'index.php?n=material&h=show'); } $imageName .= '&rand=' . rand(111111, 999999); //echo 'index.php?n=material&h=getimg&imageName='.$imageName;exit; include MooTemplate('public/material_imgedit', 'module'); }
function lovestyle_result() { global $userid, $tc_id_arr; //preg_match("/&h=(.*)/i",$_SERVER['HTTP_REFERER'],$harr); $tcid = MooGetGPC('tcid', 'integer', 'G'); $tcid--; if ($tcid < 0) { $tcid = 0; } if ($tcid >= sizeof($tc_id_arr)) { $tcid = sizeof($tc_id_arr) - 1; } $tc_id = $tc_id_arr[$tcid]; $test_info = $result_id = array(); $table = $GLOBALS['dbTablePre'] . 'test_member'; $test_sql = "SELECT `scores_count`,`ctype`,`result_id` FROM {$GLOBALS['dbTablePre']}test_member \n\t\tWHERE `uid`='{$userid}' AND `tc_id`='{$tc_id}' "; $test_info = $GLOBALS['_MooClass']['MooMySQL']->getAll($test_sql); if (empty($test_info)) { set_info_vote($tc_id); $test_info = $GLOBALS['_MooClass']['MooMySQL']->getAll($test_sql); } if (empty($test_info)) { MooMessage("请完成测试再来查看结果。", 'index.php?n=lovestyle'); } //print_r($test_info); //note 综合评测结果 tc_id === ctype 虽然我不知道有什么好处,但是也没有坏处 ps:dsk foreach ($test_info as $ti) { $result_id[] = $ti['result_id']; if ($tc_id == $ti['ctype']) { $scores_count = $ti['scores_count']; } //测试总分 } $result_id = implode(',', $result_id); $sql = "SELECT * FROM {$GLOBALS['dbTablePre']}test_result WHERE `id` IN ({$result_id})"; $my_result = $GLOBALS['_MooClass']['MooMySQL']->getAll($sql); $results = array(); foreach ($my_result as $k => $v) { //结果如果需要段落显示可以按照 '<br />'拆分 参考后台添加测试结果 $results[$v['rtype']] = array('ctypename' => $v['ctypename'], 'result' => $v['result']); } //print_r($results); include MooTemplate('public/lovestyle_result_' . ++$tcid, 'module'); }
function register_stepfive() { global $_MooClass, $dbTablePre, $uid, $user_arr; $userinfo = MooMembersData($uid); if (MooSubmit('register_submitfive')) { $search_base5 = getMemberfield(); $members_search5 = isset($search_base5["search"]) ? $search_base5["search"] : array(); $members_base5 = isset($search_base5["base"]) ? $search_base5["base"] : array(); $where_arr = array('uid' => $uid); if (!empty($members_search5)) { updatetable('members_search', $members_search5, $where_arr); if (MOOPHP_ALLOW_FASTDB) { MooFastdbUpdate('members_search', 'uid', $uid, $members_search5); } } if (!empty($members_base5)) { updatetable('members_base', $members_base5, $where_arr); if (MOOPHP_ALLOW_FASTDB) { MooFastdbUpdate('members_base', 'uid', $uid, $members_base5); } } MooMessage("您已经完成了您的资料填写,请尽快进入我的帐户完成您的认证!", "index.php?n=service"); } include MooTemplate('public/register_stepfive', 'module'); }
//note 加载框架 require 'framwork/MooPHP.php'; //如果脚本中断,关闭数据库连接 register_shutdown_function(array($_MooClass['MooMySQL'], 'close')); //允许的方法 $names = array('login', 'index', 'register', 'lostpasswd', 'inputpwd', 'myaccount', 'viewspace', 'relatekw', 'ajax', 'seccode', 'sendmail', 'material', 'search', 'service', 'payment', 'safetyguide', 'lovestyle', 'loveing', 'story', 'about', 'return', 'invite', 'vote', 'profile', 'recommend', 'crontab', 'pop', 'clinic', 'space', 'hnintro', 'cooperation', 'video', 'events', 'chat', 'andriod', 'lovestation'); //获取推广参数 // MooGetFromwhere(); $MooUid = 0; //用户信息 MooUserInfo(); $user_arr = $user = UserInfo(); $uid = $userid = $MooUid; //模块判断 if (!in_array($name, $names)) { MooMessage('没有这个页面', 'index.php', '01'); } //伪造游客用户数据 if (empty($user_arr)) { $user_arr['uid'] = 0; $user_arr['gender'] = 0; $user_arr['birthyear'] = date("Y") - 26; //默认26岁 $user_arr['province'] = 0; $user_arr['city'] = 0; } //时间相关 if ($uid) { //更新COOKIE 成活时间 MooUpateCookie($uid); $new_email_num = header_show_total($uid);
/** * 加载模板 * @param string $path - 模板文件路径 (包含皮肤目录和文件名) 如: default/na * @param string $type - 模板类型 {module:module里模块模板;public:public下的公共模板;data:data下的用户定制模板} * @return string 返回编译后模板的系统绝对路径 */ function MooTemplate($path, $type) { switch ($type) { case 'module': $tpl_path = MOOPHP_TEMPLATE_DIR . '/' . $path . '.htm'; //aaa.htm break; case 'public': $tpl_path = 'public/' . $path . '.htm'; break; case 'data': $path = substr($GLOBALS['style_uid'], -1) . '/' . $GLOBALS['style_uid'] . '/' . $GLOBALS['style_uid'] . '_' . $path; $tpl_path = 'data/diamond/' . $path . '.htm'; if (!file_exists($tpl_path)) { MooMessage('您访问的页面不存在'); exit; } break; default: exit('$type error'); } $php_path = MOOPHP_DATA_DIR . '/templates/' . $type . '/' . $path . '.tpl.php'; if (!file_exists($php_path) || filemtime($tpl_path) > filemtime($php_path)) { //note 加载模板类文件 $T = MooAutoLoad('MooTemplate'); $T->complie($tpl_path, $php_path); } return $php_path; }
function sendnewleer() { global $_MooClass, $dbTablePre, $timestamp, $user_arr, $serverid, $memcached, $_MooCookie, $GLOBALS; //是否合法登录 $and_uuid = isset($_GET['uuid']) ? $_GET['uuid'] : ''; $uid = $_GET['uid'] = isset($_GET['uid']) ? $_GET['uid'] : ''; if ($uid) { $userid = $mem_uid = $memcached->get('uid_' . $uid); } $checkuuid = check_uuid($and_uuid, $userid); if (!$checkuuid) { $error = "uuid_error"; echo return_data($error, false); exit; } $sendtoid = MooGetGPC('sendtoid', 'integer', 'P'); $user_arr = MooMembersData($userid); $uid = $userid; $return = array(); $is_first_send = true; $query = $_MooClass['MooMySQL']->getOne("SELECT count(1) as c FROM {$dbTablePre}pic WHERE uid = '{$sendtoid}'"); $pic_total = $query['c']; //note 自己不能给自己发送秋波,直接转到秋波列表页面 if ($sendtoid == $userid) { $error = "自己不可以给自己发过送秋波"; echo return_data($error, false); exit; } $result = $_MooClass['MooMySQL']->getOne("select groupid from web_admin_user where uid='{$serverid}'"); $groupid = $result['groupid']; //系统管理员权限 $GLOBALS['system_admin'] = array(60); if (in_array($groupid, $GLOBALS['system_admin'])) { $serverid = null; } if ($serverid && $user_arr['usertype'] != 3) { //只能模拟全权会员 $error = "对不起您不能模拟操作"; echo return_data($error, false); exit; } //note 双方屏蔽不给操作 if (MooGetScreen($userid, $sendtoid)) { $error = "因特殊原因,送秋波失败"; echo return_data($error, false); exit; } //note 要做性别过滤,异性的发送秋波,直接转到秋波列表页面 $send_user1 = leer_send_user1($sendtoid); $user = leer_send_user1($userid); if ($send_user1['gender'] == $user['gender']) { $error = "同性之间不可互发秋波"; echo return_data($error, false); exit; exit; } if (isset($_POST['sendleer']) && $_POST['sendleer']) { $leer = $_MooClass['MooMySQL']->getOne("SELECT * FROM {$dbTablePre}service_leer WHERE receiveuid = '{$sendtoid}' AND senduid = '{$userid}' ", true); if ($leer['lid']) { $is_first_send = false; $lid = $leer['lid']; //note 如果已经发送过秋波,就增加发送秋波的次数 $_MooClass['MooMySQL']->query("UPDATE {$dbTablePre}service_leer SET num = num + 1,receivenum = receivenum + 1,sendtime = '{$timestamp}',receivetime = '{$timestamp}',receive_del = '0' WHERE lid = '{$lid}'"); //note 如果已经收到这个人的秋波,已经拒绝,现在改变注意,又发送秋波给这个人,拒绝状态2更改为0 $_MooClass['MooMySQL']->query("UPDATE {$dbTablePre}service_leer SET stat = '0' WHERE senduid = '{$sendtoid}' AND receiveuid = '{$uid}' AND stat = '2'"); } else { $_MooClass['MooMySQL']->query("INSERT INTO {$dbTablePre}service_leer SET sendtime = '{$timestamp}',receivetime = '{$timestamp}',receivenum = '1', num = '1', senduid = '{$uid}',receiveuid = '{$sendtoid}'"); } //将新注册的会员更新为优质会员 if (in_array($user_arr['sid'], array(0, 52, 123)) && $user_arr['is_well_user'] != 1) { update_iswell_user($user_arr['uid']); } //发送短信和邮件 include_once "./module/crontab/crontab_config.php"; $res = MooMembersData($sendtoid); $send_user_info = array_merge(MooGetData('members_choice', 'uid', $uid), MooMembersData($uid)); /*普通会员对全权会员反馈白名单*/ if ($res['usertype'] == '3' && $user_arr['usertype'] != '3' && !$serverid) { white_list($res['uid'], $user_arr['uid']); } /*客服模拟全权记录*/ if ($user_arr['usertype'] == '3' && $serverid && $res['usertype'] != 3) { $action = '秋波'; fulllog($user_arr['uid'], $serverid, $action, $res); } //头像路径 $path = thumbImgPath(2, $send_user_info['pic_date'], $send_user_info['pic_name']); if (file_exists($path)) { $img_path = $path; } else { if ($send_user_info['gender'] == 1) { $img_path = "/public/images/service_nopic_woman.gif"; } else { $img_path = "/public/images/service_nopic_man.gif"; } } $send_username = $send_user_info['nickname'] ? $send_user_info['nickname'] : $send_user_info['uid']; //发送者用户名 $send_user_grade = $send_user_info['gender'] == 1 ? "女" : "男"; //发送者性别 $province = $send_user_info['province'] ? $provice_list[$send_user_info['province']] : ''; //省 $city = $send_user_info['city'] ? $city_list[$send_user_info['city']] : ''; //市 $height = $send_user_info['height'] ? $height_list[$send_user_info['height']] : "未知"; //身高 ob_start(); $body = ob_get_clean(); if ($res['usertype'] != 3) { MooSendMail($res['username'], "真爱一生网系统温馨提示", $body, "", false, $sendtoid); } //每天向同一用户发送多次,短信记录数表只记一次 $send_leer_date = isset($leer['sendtime']) ? date("Y-m-d", $leer['sendtime']) : date("Y-m-d"); // $today_leer_count = isset($leer['lid']) ? $leer['num'] + 1 : 1; if (date("Y-m-d") > $send_leer_date) { $today_leer_count = 1; $return = "您今天已向该会员发送一次秋波"; echo return_data($return); exit; } $sendinfo = MooGetGPC('sendleerinfo', 'string', 'P'); if (!empty($sendinfo)) { $sendinfo = "对您说:" . $sendinfo; } if ($res['usertype'] != 3) { //全权会员不发送短信和彩信 if ($serverid) { //如果是客服模拟登录 $SMStype = MooGetGPC('selectSMSorCMS', 'string', 'P'); if ($SMStype == 'SMS' && $res['is_phone']) { // SendMsg($res['telphone'],"真爱一生网 用户ID:".$userid.",".$send_user_grade.",已给您发送秋波,".$sendinfo." 请及时把握您的缘分!4006780405"); Push_message_intab($sendtoid, $res['telphone'], "秋波", "真爱一生网 用户ID:" . $userid . "," . $send_user_grade . ",已给您发送秋波," . $sendinfo . " 请及时把握您的缘分!4006780405", $userid); } elseif ($SMStype == 'CMS' && $res['is_phone']) { //====发送彩信 begin ==== //发送人有照片 $sql = "SELECT uid,telphone FROM {$dbTablePre}members_search where uid='{$userid}' and images_ischeck=1 and pic_num>0"; $sendfrom_user_info = $_MooClass['MooMySQL']->getOne($sql, true); if ($sendfrom_user_info['uid']) { $sendedMMSCount = $memcached->get('hznsimulate' . $serverid); if (empty($sendedMMSCount)) { $sendedMMSCount = 0; } if ($sendedMMSCount > 10) { MooMessage('您今天累计已经发过10条彩信', 'index.php?n=service'); } send_mms_commission($res['telphone'], 'leer', $userid); $memcached->set('hznsimulate' . $serverid, ++$sendedMMSCount, 0, 28800); } //====发送彩信 end ===== } } else { //会员真实登录 if ($res['is_phone'] && $is_first_send && $res['s_cid'] != 40) { //第一次发送秋波才发短信提示 Push_message_intab($sendtoid, $res['telphone'], "秋波", "真爱一生网 用户ID:" . $userid . "," . $send_user_grade . ",已给您发送秋波," . $sendinfo . " 请及时把握您的缘分!4006780405", $userid); } } } //提醒所属客服 $sid = $user_arr['sid']; $title = '您的会员 ' . $user_arr['uid'] . ' 向 ' . $sendtoid . ' 发送了秋波'; $awoketime = $timestamp + 3600; $sql_remark = "insert into {$dbTablePre}admin_remark set sid='{$sid}',title='{$title}',content='{$title}',awoketime='{$awoketime}',dateline='{$timestamp}'"; $res = $_MooClass['MooMySQL']->query($sql_remark); $users =& $res; $return = "发送秋波成功"; echo return_data($return); exit; MooMessage('发送秋波成功', "index.php?n=service&h=leer&t=sendnewleer&sendtoid={$sendtoid}"); } else { if ($user_arr['gender'] == 0) { //boy $sql = "SELECT id,content FROM {$dbTablePre}members_sendinfo where type=2 and isShow=1"; } else { //girl $sql = "SELECT id,content FROM {$dbTablePre}members_sendinfo where type=1 and isShow=1"; } $sendinfo = $_MooClass['MooMySQL']->getAll($sql); echo return_data($sendinfo); exit; } }
/** * 登录表单处理 * 描述: */ function login_submit() { global $_MooClass, $dbTablePre, $_MooCookie; //noet 对提交的数据过滤 if ($_POST) { $username = trim($_POST['username']); $md5_password = md5($_POST['password']); $cookietime = intval(isset($_POST['cookietime']) ? $_POST['cookietime'] : ''); $remember_username = MooGetGPC('remember', 'integer', 'P'); } /*****设置回转的页面*****/ $returnurl = MooGetGPC('returnurl', 'string', "P"); //echo $returnurl; //exit; //note 要填写用户和密码 if (empty($_POST['username']) && empty($_POST['password'])) { //note 转至邮箱验证页 if ($returnurl) { $returnurl = $returnurl; MooMessage("请填写用户名和密码", "{$returnurl}", '03'); } else { MooMessage("请填写用户名和密码", "index.php?n=login", '03'); } exit; } //note 用户名不能为空 if (empty($_POST['username'])) { //note 转至邮箱验证页 if ($returnurl) { $returnurl = $returnurl; MooMessage("用户名不能为空", "{$returnurl}", '03'); } else { MooMessage("用户名不能为空", "index.php?n=login", '03'); } exit; } //note 密码不能为空 if (empty($_POST['password'])) { //note 转至邮箱验证页 if ($returnurl) { $returnurl = $returnurl; MooMessage("密码不能为空", "{$returnurl}", '03'); } else { MooMessage("密码不能为空", "index.php?n=login", '03'); } exit; } $userid = 0; $sp = searchApi('members_man members_women'); $limit = array(0, 1); //note 验证用户名,密码 enky if (is_numeric($username)) { if (strlen($username) == 11) { //判断手机号是否存在 $filter = array(); $filter[] = array('telphone', $username); if ($sp->getResultOfReset($filter, $limit)) { $ids = $sp->getIds(); if (isset($ids[0])) { $userid = $ids[0]; } } } if (!$userid) { //判断uid是否存在 $filter = array(); $filter[] = array('@id', $username); if ($sp->getResultOfReset($filter, $limit)) { $ids = $sp->getIds(); if (isset($ids[0])) { $userid = $ids[0]; } } } if (!$userid) { if ($user_one = $_MooClass['MooMySQL']->getOne("SELECT uid from `{$dbTablePre}members_base` where qq='{$username}'")) { $userid = $user_one['uid']; } } /*if(strlen($username)==11){ $sql_where = " s.telphone='{$username}'"; $user = $_MooClass['MooMySQL']->getOne("SELECT s.uid,s.username,s.password,s.birthyear,s.gender,s.province,s.city,b.automatic,s.is_lock,b.is_awoke,s.sid,l.last_login_time,l.lastip FROM `{$dbTablePre}members_search` as s left join `{$dbTablePre}members_base` as b on s.uid=b.uid left join `{$dbTablePre}members_login` as l on s.uid=l.uid WHERE $sql_where"); }else{ $sql_where = " s.uid = '{$username}'"; $user = $_MooClass['MooMySQL']->getOne("SELECT s.uid,s.username,s.password,s.birthyear,s.gender,s.province,s.city,b.automatic,s.is_lock,b.is_awoke,s.sid,l.last_login_time,l.lastip FROM `{$dbTablePre}members_search` as s left join `{$dbTablePre}members_base` as b on s.uid=b.uid left join `{$dbTablePre}members_login` as l on s.uid=l.uid WHERE $sql_where"); if(empty($user)){ $sql_where = "b.qq='{$username}'"; //$user = $_MooClass['MooMySQL']->getOne("SELECT a.uid,username,password,birthyear,gender,province,city,automatic,is_lock,is_awoke,sid,last_login_time,lastip FROM `{$dbTablePre}members` a ,`{$dbTablePre}memberfield` b WHERE a.uid=b.uid and $sql_where"); $user = $_MooClass['MooMySQL']->getOne("SELECT s.uid,s.username,s.password,s.birthyear,s.gender,s.province,s.city,b.automatic,s.is_lock,b.is_awoke,s.sid,l.last_login_time,l.lastip FROM `{$dbTablePre}members_search` as s left join `{$dbTablePre}members_base` as b on s.uid=b.uid left join `{$dbTablePre}members_login` as l on s.uid=l.uid WHERE $sql_where"); } }*/ } else { $filter = array(); $filter[] = array('username', $username); if ($sp->getResultOfReset($filter, $limit)) { $ids = $sp->getIds(); if (isset($ids[0])) { $userid = $ids[0]; } } /*$sql_where = "s.username = '******'"; //$user = $_MooClass['MooMySQL']->getOne("SELECT uid,username,password,birthyear,gender,province,city,automatic,is_lock,is_awoke,sid,last_login_time,lastip FROM `{$dbTablePre}members` WHERE $sql_where"); $user = $_MooClass['MooMySQL']->getOne("SELECT s.uid,s.username,s.password,s.birthyear,s.gender,s.province,s.city,b.automatic,s.is_lock,b.is_awoke,s.sid,l.last_login_time,l.lastip FROM `{$dbTablePre}members_search` as s left join `{$dbTablePre}members_base` as b on s.uid=b.uid left join `{$dbTablePre}members_login` as l on s.uid=l.uid WHERE $sql_where");*/ } //note 用户名找不到 if (!$userid) { $login_where = is_numeric($username) ? "uid='{$username}' or telphone='{$username}'" : "username='******'"; $user_one = $_MooClass['MooMySQL']->getOne("SELECT uid from `{$dbTablePre}members_search` where {$login_where}"); if ($user_one) { $userid = $user_one['uid']; } else { //note 转至邮箱验证页 if ($returnurl) { MooMessage("用户名不存在", "{$returnurl}", '01'); } else { MooMessage("用户名不存在", "index.php?n=login", '01'); } } } //获取 $user = array_merge(MooGetData('members_login', 'uid', $userid), MooMembersData($userid)); echo $user['is_lock']; exit; if ($user['is_lock'] != '1') { MooMessage("很抱歉您的用户名已经被锁定!<br>请联系真爱一生网客服:<b>400-678-0405</b>", "{$returnurl}", '01', 6); } //note 用户密码错误 if ($user['uid'] && $user['password'] != $md5_password) { //note 转至邮箱验证页 if ($returnurl) { $returnurl = $returnurl; MooMessage("用户密码错误", "{$returnurl}", '01'); } else { MooMessage("用户密码错误", "index.php?n=login", '01'); } exit; } //note 验证通过 if ($user['uid'] && $user['password'] == $md5_password) { if ($user['automatic'] == 1) { MooSetCookie('auth', MooAuthCode("{$user['uid']}\t{$user['password']}", 'ENCODE'), 86400 * 7); } else { MooSetCookie('auth', MooAuthCode("{$user['uid']}\t{$user['password']}", 'ENCODE'), 86400); } $time = time(); $_MooClass['MooMySQL']->query("update {$dbTablePre}members_login set last_login_time = '{$time}',login_meb = login_meb+1,lastvisit='{$time}' where uid = '{$user['uid']}'"); //更新最后登录时间 //会员最后登录时间 MooSetCookie('last_login_time', $time, 86400); //note 客服提醒 if ($user['is_awoke'] == '1') { $awoketime = time() + 120; $sql = "INSERT INTO `{$dbTablePre}admin_remark` SET sid='{$user['sid']}',title='会员上线',content='ID:{$user['uid']}会员刚刚通过pc机上线,请联系',awoketime='{$awoketime}',dateline='{$GLOBALS['timestamp']}'"; $_MooClass['MooMySQL']->query($sql); } //note 记住用户名 if ($remember_username == 1) { MooSetCookie('username', $username, time() + 3600); } else { MooSetCookie('username', $username, -1200); } // echo print_r($_MooCookie);die; MooPlugins('ipdata'); $online_ip = GetIP(); if ($online_ip != $user['lastip']) { $user_address = convertIp($online_ip); include "./module/crontab/crontab_config.php"; foreach ($provice_list as $key => $provice_arr) { if (strstr($user_address, $provice_arr) !== false) { //if(){ $province = $key; break; } } if (empty($province)) { $province = $current_user['province']; } //得到市对应的城市代号 foreach ($city_list as $city_key => $city_val) { if (strstr($user_address, $city_val) !== false) { $city = $city_key; break; } } } MooSetCookie('province', $user['province'], 86400); MooSetCookie('city', $user['city'], 86400); $lastactive = time(); $uid = $user['uid']; //note 更新用户的最近登录ip和最近登录时间 $updatesqlarr = array('lastip' => $online_ip); $wheresqlarr = array('uid' => $uid); updatetable("members_login", $updatesqlarr, $wheresqlarr); if (MOOPHP_ALLOW_FASTDB) { $val = array(); $val['lastip'] = $online_ip; //$val['client']=0; $val['last_login_time'] = $time; $val['lastvisit'] = $time; //$val['isOnline']=1; MooFastdbUpdate('members_login', 'uid', $uid, $val); //!! } //记录本次登录ip及上次的ip,及真实的最后访问时间 $sql_ip = "SELECT last_ip,finally_ip FROM {$GLOBALS['dbTablePre']}member_admininfo WHERE uid='{$uid}'"; $member_admin_info = $GLOBALS['_MooClass']['MooMySQL']->getOne($sql_ip); if (!empty($member_admin_info)) { $sql_ip = "UPDATE {$GLOBALS['dbTablePre']}member_admininfo SET last_ip='{$member_admin_info['finally_ip']}',finally_ip='{$online_ip}',real_lastvisit='{$lastactive}' WHERE uid='{$uid}'"; } else { $sql_ip = "INSERT INTO {$GLOBALS['dbTablePre']}member_admininfo SET finally_ip='{$online_ip}',uid='{$uid}',real_lastvisit='{$lastactive}'"; } $GLOBALS['_MooClass']['MooMySQL']->query($sql_ip); //note 先删除表里面已存在对应用户的session //$_MooClass['MooMySQL']->query("DELETE FROM `{$dbTablePre}membersession` WHERE `uid` = '$uid'"); //删除过期SESSION //$date=time()-1200; //$_MooClass['MooMySQL']->query("DELETE FROM `{$dbTablePre}membersession` WHERE lastactive<'$date'"); //$_MooClass['MooMySQL']->query("REPLACE INTO `{$dbTablePre}membersession` SET `username`= '$user[username]',`password`='$user[password]',`ip` = '$online_ip',`lastactive` = '$lastactive',`uid` = '$uid'"); //发送短信提醒关注的会员上线了 //fanglin暂时屏蔽 /*if($_MooCookie['iscontact'] != "yes"){ MooSend_Contact($uid,$user['gender'],"system"); } //note 伪造用户访问 $selectuser=selectuser($user['province'],$user['city'],$user['birthyear'],$user['gender']); $time=strtotime(date('Y-m-d'))-24*60*60; for($i=0;$i<count($selectuser);$i++){ $result=$_MooClass['MooMySQL']->getOne("SELECT `uid` FROM `".$dbTablePre."service_visitor` WHERE `uid`='".$selectuser[$i]['uid']."' AND `visitorid`='".$user['uid']."' AND `who_del`!=2"); if($result['uid']==''){ $_MooClass['MooMySQL']->query("INSERT INTO `".$dbTablePre."service_visitor` SET `uid`='".$selectuser[$i]['uid']."',`visitorid`='".$user['uid']."',`visitortime`='".$time."',`who_del`=1"); }else $_MooClass['MooMySQL']->query("UPDATE `".$dbTablePre."service_visitor` SET `visitortime`='".$time."' WHERE `uid`='".$selectuser[$i]['uid']."' AND `visitorid`='".$user['uid']."'"); }*/ //note 转至邮箱验证页 if ($returnurl) { $returnurl = $returnurl; header("Location:" . $returnurl); } else { header("Location:index.php?n=service"); } exit; } }
function about_clinic_add() { global $timestamp, $user_arr, $arr_clinic_type; //print_r($user_arr);exit; if ($_POST) { $date = array(); $date['type'] = MooGetGPC('clinictype', 'integer', 'P'); $date['uid'] = $user_arr['uid']; $date['title'] = safeFilter(MooGetGPC('title', 'string', 'P')); $date['question'] = safeFilter(MooGetGPC('clinic', 'string', 'P')); $date['add_time'] = $timestamp; $sql = "SELECT sort FROM {$GLOBALS['dbTablePre']}love_clinic WHERE type = {$date['type']} ORDER BY sort DESC LIMIT 0,1"; $ret = $GLOBALS['_MooClass']['MooMySQL']->getOne($sql); $date['sort'] = ++$ret['sort']; inserttable('love_clinic', $date); MooMessage("您的情感问题已经提交成功,真爱一生情感专家会在24小时内解决您的问题。\n感谢您对真爱一生网的信任与支持。", "index.php?n=about&h=clinic", '03'); } }
function getcontactdata2() { global $_MooClass, $dbTablePre, $userid, $user_arr; $uid = MooGetGPC('uid', 'integer'); //note 查询目前委托真爱一生联系对方表 $user4 = $_MooClass['MooMySQL']->getOne("SELECT * FROM `{$dbTablePre}service_contact` WHERE `other_contact_you` = '{$userid}' AND `you_contact_other` = '{$uid}' and send_del=0 and is_server=0", true); if (!$user4) { MooMessage('对不起,您查看的不属于您的委托', 'javascript:history.go(-1)', '04'); } //note 查询用户主表 $user1 = leer_send_user1($uid); //note 查询用户择偶表 //$user2 = leer_send_user2($uid); //note 查询用户附加表 $user3 = service_user3($uid); //note 择偶条件 if (MOOPHP_ALLOW_FASTDB) { $c = MooFastdbGet('members_choice', 'uid', $uid); } else { $c = $_MooClass['MooMySQL']->getOne("SELECT * FROM `{$dbTablePre}members_choice` WHERE uid = {$uid}"); } //note 实现查看下一个会员功能 $user5 = $_MooClass['MooMySQL']->getAll("SELECT you_contact_other FROM `{$dbTablePre}service_contact` WHERE `other_contact_you` = '{$userid}' and send_del=0 and is_server=0"); //note 显示相册中的普通照片 $user_pic = $_MooClass['MooMySQL']->getAll("SELECT * FROM {$dbTablePre}pic WHERE syscheck=1 and uid='{$user1['uid']}'"); //会员已认证证件 $MSG = certification($user1['uid']); $total = count($user5); foreach ($user5 as $k => $v) { if ($user5[$k]['you_contact_other'] == $uid) { $up = $k - 1 <= 0 ? '0' : $k - 1; $next = $k + 1 >= $total ? $total - 1 : $k + 1; $upid = $user5[$up]['you_contact_other']; $nextid = $user5[$next]['you_contact_other']; } } //note 查询普通图片 //$user6 = $_MooClass['MooMySQL']->getAll("SELECT * FROM {$dbTablePre}pic WHERE uid='$uid' AND syscheck = 1"); require MooTemplate('public/service_contact_getcontactdata2', 'module'); }
function story_upload() { global $_MooClass, $dbTablePre, $userid, $timestamp; global $user_arr; //note 获得那几个步骤 $story1 = MooGetGPC('story1', 'string'); $story2 = MooGetGPC('story2', 'string'); $pics = MooGetGPC('pics', 'string'); //note 提交第一步的变量赋值 if ($story1) { $name1 = safeFilter(MooGetGPC('name1', 'string')); $name2 = safeFilter(MooGetGPC('name2', 'string')); $state = MooGetGPC('state', 'integer'); $year = MooGetGPC('year', 'integer'); $month = MooGetGPC('month', 'integer'); $day = MooGetGPC('day', 'integer'); } //note 提交第二步变量赋值 if ($story2 || $pics) { $title = safeFilter(MooGetGPC('subject', 'string')); $content = safeFilter(MooGetGPC('content', 'string')); $insert_id = MooGetGPC('insertId', 'integer'); $img_title = safeFilter(MooGetGPC('imgTitle', 'string')); } //note 如果已经提交故事就显示标题和内容,爱情进程,时间 $love_story = $_MooClass['MooMySQL']->getOne("SELECT * FROM {$dbTablePre}story WHERE uid = '{$userid}'"); //note 提交故事第一步 if ($story1 && $name1 && $name2 && $state && $year && $month && $day) { //note 如果没有选择甜蜜进程就退出 $storybasic = $_COOKIE['storybasic']; $state == '-1' && exit; $story_date = mktime(0, 0, 0, $month, $day, $year); //note 已经写故事了,就更新已有的故事 //判断是否更新 $str = $name1 . $name2 . $state . $story_date; $md5str = md5($str); if ($love_story['sid']) { if ($md5str != $storybasic) { $_MooClass['MooMySQL']->query("UPDATE {$dbTablePre}story SET name1 = '{$name1}',name2 = '{$name2}',state = '{$state}',story_date = '{$story_date}',submit_date = '{$timestamp}', syscheck = '0' WHERE sid = '{$love_story['sid']}'"); } $insert_id = $love_story['sid']; } else { $_MooClass['MooMySQL']->query("INSERT INTO {$dbTablePre}story (uid,name1,name2,state,story_date,submit_date) values ('{$userid}','{$name1}','{$name2}','{$state}','{$story_date}','{$timestamp}')"); $insert_id = $_MooClass['MooMySQL']->insertId(); } //note 查询出相册 $album = $_MooClass['MooMySQL']->getAll("SELECT * FROM {$dbTablePre}story_pic WHERE uid = '{$userid}'"); require MooTemplate('public/story_upload2', 'module'); //note 更新提交故事第二步 } else { if ($story2 && $insert_id) { $storycontent = isset($_COOKIE['storycontent']) ? $_COOKIE['storycontent'] : ''; $md5content = md5($title . $content); if ($md5content != $storycontent) { $_MooClass['MooMySQL']->query("UPDATE {$dbTablePre}story SET title = '{$title}',content = '{$content}',submit_date = '{$timestamp}', syscheck = '0' WHERE sid = '{$insert_id}'"); $lsql = "UPDATE {$dbTablePre}story SET title = '{$title}',content = '{$content}', syscheck = '0' WHERE sid = '{$insert_id}'"; } //提示消息 MooMessage("您的爱情故事已上传成功,感谢您和我们分享您的幸福。", "index.php?n=story", '05'); //note 上传相册中的照片的时候 } else { if ($pics && $insert_id) { $album = $_MooClass['MooMySQL']->getAll("SELECT count(1) as count FROM {$dbTablePre}story_pic WHERE uid = '{$userid}'"); //note 如果上传照片超过30个图片,不允许上传 if ($album['count'] > '30') { MooMessage("您上传的图片已满30张!不可以在上传新的图片了", "index.php?n=story", '03'); } //note 判断上传的文件类型 $flag = ''; $images = array('jpg', 'jpeg', 'gif', 'png', 'bmp', 'JPG', 'JPEG', 'GIF', 'PNG', 'BMP'); $maxfilesize = 1024 * 1024; $filesize = $_FILES['pic']['size']; foreach ($images as $v) { if (eregi($v, $_FILES['pic']['type'])) { $file_content = file_get_contents($_FILES['pic']['tmp_name']); $low_file_content = strtolower($file_content); $pos = strpos($low_file_content, '<?php'); if ($pos) { $notice = "照片中含有不安全信息请重新上传"; MooMessage($notice, 'index.php?n=story&h=upload'); exit; } else { $flag = 1; } } } if ($flag != 1) { $notice = "照片必须为BMP,JPG,PNG或GIF格式"; MooMessage($notice, 'index.php?n=story&h=upload'); exit; } if ($filesize > $maxfilesize) { $notice = "上传图片大小不得大于1M"; MooMessage($notice, 'index.php?n=story&h=upload'); exit; } //note 上传到指定目录,并且获得上传后的文件描述 $upload = MooAutoLoad('MooUpload'); $upload->config(array('targetDir' => STORY_IMG_PATH, 'saveType' => '0')); $files = $upload->saveFiles('pic'); $story_picname = $files[0]['name'] . "." . $files[0]['extension']; $_MooClass['MooMySQL']->query("UPDATE {$dbTablePre}story SET title = '{$title}',content = '{$content}',submit_date = '{$timestamp}' WHERE sid = '{$insert_id}'"); if ($story_picname) { $_MooClass['MooMySQL']->query("INSERT INTO {$dbTablePre}story_pic (img,sid,uid,submit_date,title) values ('{$story_picname}','{$insert_id}','{$userid}','{$timestamp}','{$img_title}')"); } //note 查询出相册 $album = $_MooClass['MooMySQL']->getAll("SELECT * FROM {$dbTablePre}story_pic WHERE uid = '{$userid}'"); $love_story = $_MooClass['MooMySQL']->getOne("SELECT * FROM {$dbTablePre}story WHERE uid = '{$userid}'"); $prompt = '<script>alert("上传成功,您可以继续上传")</script>'; include MooTemplate('public/story_upload2', 'module'); } else { //note 故事日期 $story_date = $love_story['story_date']; $show_year = date("Y", $story_date); $show_month = date("n", $story_date); $show_date = date("j", $story_date); $md5str = $love_story['name1'] . $love_story['name2'] . $love_story['state'] . $love_story['story_date']; $md5basic = md5($md5str); setcookie("storybasic", $md5basic); include MooTemplate('public/story_upload1', 'module'); } } } }
foreach($allow_action_list as $k2=>$v2){ if(strpos($v2,$v1) !== false){ $type_list[$k]['typename'] = $menu_nav_arr[$v1]; //大分类 if(isset($leftMenu[$v1][$v2])){ $type_list[$k]['subname'][$k2]['title'] = $leftMenu[$v1][$v2]['title']; //子分类 $type_list[$k]['subname'][$k2]['url'] = $leftMenu[$v1][$v2]['url']; //子分类链接 } } } }*/ //print_r($type_list);exit; //后台客服缓存文件不存在时,这里再次判断创建 if (!file_exists($file_kefulist_cache)) { create_kefuuser_cachefile(); } $h = MooGetGPC('h', 'string') == '' ? 'index' : MooGetGPC('h', 'string'); //note 动作列表 $hlist = array('index'); //note 判断页面是否存在 if (!in_array($h, $hlist)) { MooMessage('您要打开的页面不存在', 'index.php?action=admin&h=index'); } switch ($h) { //note 欢迎界面 case 'index': admin_index(); break; default: admin_index(); break; }
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"); } }
function register() { global $memcached, $user_arr, $userid, $_MooClass, $dbTablePre; $cooperation = MooGetGPC('cooperation', 'integer', 'P'); $request_url = empty($cooperation) ? 'index.php?n=cooperation&h=personal' : 'index.php?n=cooperation&h=company'; $seccode = strtolower(MooGetGPC('seccode', 'string', 'P')); $seccode2 = MooGetGPC('seccode', 'string', 'C'); $session_seccode = $memcached->get($seccode2); if ($seccode != $session_seccode) { MooMessage("验证码填写不正确,请确认。", $request_url, '', '1', 1); } $data = array(); $data['activities'] = MooGetGPC('active', 'string', 'P'); $data['sid'] = MooGetGPC('sid', 'string', 'P'); $data['contact'] = MooGetGPC('contact', 'string', 'P'); $data['cooperation'] = $cooperation; $data['phone'] = MooGetGPC('phone', 'string', 'P'); $data['province'] = empty($cooperation) ? $user_arr['province'] : MooGetGPC('province', 'integer', 'P'); $data['city'] = empty($cooperation) ? $user_arr['city'] : MooGetGPC('city', 'integer', 'P'); $data['mail'] = MooGetGPC('mail', 'string', 'P'); $data['msn'] = MooGetGPC('msn', 'string', 'P'); $data['qq'] = MooGetGPC('qq', 'string', 'P'); $data['message'] = MooGetGPC('message', 'string', 'P'); if (empty($data['contact'])) { MooMessage("请填写用联系人名称", $request_url, '', '1', 1); } if (empty($data['phone']) || !preg_match('/^1[3|4|5|8][0-9]\\d{4,8}$/', $data['phone'])) { MooMessage("手机号码格式不正确", $request_url, '', '1', 1); } $province_array = array('10101201', '10102000', '10103000', '10101002', '10104000', '10105000', '10132000', '10133000', '10134000'); if (!in_array($data['province'], $province_array) && ($data['city'] == 0 || empty($data['city']))) { MooMessage("请选择所在地区", $request_url, '', '1', 1); } if (empty($data['phone']) || !preg_match('/^1[3|4|5|8][0-9]\\d{4,8}$/', $data['phone'])) { MooMessage("手机号码格式不正确", $request_url, '', '1', 1); } if (!empty($data['mail'])) { if (!preg_match('/^[a-zA-Z0-9_-]+@[a-zA-Z0-9_-]+(\\.[a-zA-Z0-9_-]+)+$/', $data['mail'])) { MooMessage("mail地址不正确", $request_url, '', '1', 1); } } if (!empty($data['msn'])) { if (!preg_match('/^[a-zA-Z0-9_-]+@[a-zA-Z0-9_-]+(\\.[a-zA-Z0-9_-]+)+$/', $data['msn'])) { MooMessage("msn账号格式不正确", $request_url, '', '1', 1); } } if (!empty($data['qq'])) { if (!preg_match('/[1-9][0-9]{4,}/', $data['qq'])) { MooMessage("QQ账号格式不正确", $request_url, '', '1', 1); } } $data['uid'] = empty($userid) ? 0 : $userid; $data['time'] = time(); if ($_MooClass['MooMySQL']->getOne('select id from ' . $dbTablePre . 'cooperation where activities = "' . $data['activities'] . '" and cooperation=' . $data['cooperation'] . ' and phone=' . $data['phone'], true)) { MooMessage("报名成功", "index.php"); } else { if (inserttable('cooperation', $data, 1)) { MooMessage("报名成功", "index.php"); } else { MooMessage("数据出错", $request_url, '', '1', 1); } } }
function payment_ifyouaretheone_reg() { global $_MooClass, $dbTablePre, $userid, $timestamp, $user_arr; if ($_POST) { $name = safeFilter(MooGetGPC('name', 'string', 'P')); $profession = safeFilter(MooGetGPC('profession', 'string', 'P')); $mobile = safeFilter(MooGetGPC('mobile', 'string', 'P')); $telphone = safeFilter(MooGetGPC('telphone', 'string', 'P')); $qq = safeFilter(MooGetGPC('qq', 'string', 'P')); $msn = safeFilter(MooGetGPC('msn', 'string', 'P')); $email = safeFilter(MooGetGPC('email', 'string', 'P')); $lovede = safeFilter(MooGetGPC('lovede', 'string', 'P')); $description = safeFilter(MooGetGPC('description', 'string', 'P')); $lovede1 = safeFilter(MooGetGPC('lovede1', 'string', 'P')); $description1 = safeFilter(MooGetGPC('description1', 'string', 'P')); $ip = GetIP(); $uid = $userid; $dateline = time(); //note 如果用户没有填写爱情宣言或者自我描述 if ($lovede == $lovede1) { $lovede = ""; } if ($description == $description1) { $description = ""; } //note 限制爱情宣言和自我描述进库的字数 $lovede = MooCutstr($lovede, "1000"); $description = MooCutstr($description, "1000"); //note 表单每一项都要填写 if (!empty($name) && !empty($profession) && !empty($mobile) && !empty($lovede) && !empty($description)) { $sql = "insert into {$dbTablePre}ifyouaretheone (uid,name,profession,mobile,telphone,qq,msn,email,lovede,description,ip,dateline) \n values('{$uid}','{$name}','{$profession}','{$mobile}','{$telphone}','{$qq}','{$msn}','{$email}','{$lovede}','{$description}','{$ip}','{$dateline}')"; $_MooClass['MooMySQL']->query($sql); MooMessage("您的注册报名成功!", "index.php", '05'); } else { MooMessage("提交失败,请填写完整!", "index.php?n=payment&h=ifyouaretheone_reg", '02'); } } include MooTemplate('public/payment_ifyouaretheone_reg', 'module'); }
/** * 客服模拟登录 没有权限修改删除 会员资料 */ function checkAuthMod($url) { global $dbTablePre, $_MooClass; $serverid = Moo_is_kefu(); $sql = "select groupid from {$dbTablePre}admin_user where uid='{$serverid}'"; $result = $_MooClass['MooMySQL']->getOne($sql); if (empty($result)) { return; } if (!in_array($result['groupid'], array(60, 61, 76, 75, 82, 84, 67, 70)) && !empty($serverid)) { MooMessage("sorry,您没有操作权限", $url); return; } }
function service_register() { global $_MooClass, $dbTablePre, $user_arr, $userid; $channel = $_GET['channel']; $username = empty($_POST['username']) ? '' : $_POST['username']; $gender = empty($_POST['gender']) ? '0' : $_POST['gender']; $birthday = $_POST['year'] . '-' . $_POST['year']; $workprovince = $_POST['workprovince']; $workcity = $_POST['workcity']; $mobile = $_POST['mobile']; $date = date('Y-m-d'); $ip = GetIP(); if ($user_arr['s_cid'] == '40') { //普通会员 转向升级页面 $username = $user_arr['username']; $gender = $user_arr['gender']; $birthday = $user_arr['birthyear'] . '-' . $user_arr['birthmonth']; $workprovince = $user_arr['province']; $workcity = $user_arr['city']; $mobile = $user_arr['telphone']; if ($channel == '2') { $_MooClass['MooMySQL']->query("insert into web_ahtv(ip,uid,upgradenum,action,operationtime,channel) values('{$ip}','{$userid}',1,3,'{$date}','2')"); $user = $_MooClass['MooMySQL']->getOne("select id from web_ahtv_reguser where uid='{$userid}' and channel='2'"); if (empty($user['id'])) { $_MooClass['MooMySQL']->query("insert into web_ahtv_reguser(uid,username,gender,birthday,province,city,mobile,regtime,channel) values('{$userid}','{$username}','{$gender}','{$birthday}','{$workprovince}','{$workcity}','{$mobile}','{$date}','2')"); } } elseif ($channel == '3') { $_MooClass['MooMySQL']->query("insert into web_ahtv(ip,uid,upgradenum,action,operationtime,channel) values('{$ip}','{$userid}',1,3,'{$date}','3')"); $user = $_MooClass['MooMySQL']->getOne("select id from web_ahtv_reguser where uid='{$userid}' and channel='3'"); if (empty($user['id'])) { $_MooClass['MooMySQL']->query("insert into web_ahtv_reguser(uid,username,gender,birthday,province,city,mobile,regtime,channel) values('{$userid}','{$username}','{$gender}','{$birthday}','{$workprovince}','{$workcity}','{$mobile}','{$date}','3')"); } } elseif ($channel == '4') { $_MooClass['MooMySQL']->query("insert into web_ahtv(ip,uid,regnum,action,operationtime,channel) values('{$ip}','{$userid}',1,2,'{$date}','4')"); $user = $_MooClass['MooMySQL']->getOne("select id from web_ahtv_reguser where uid={$userid} and channel='4'"); if (empty($user['id'])) { $_MooClass['MooMySQL']->query("insert into web_ahtv_reguser(uid,username,gender,birthday,province,city,mobile,regtime,channel) values('{$userid}','{$username}','{$gender}','{$birthday}','{$workprovince}','{$workcity}','{$mobile}','{$date}','4')"); } } elseif ($channel == '5') { $_MooClass['MooMySQL']->query("insert into web_ahtv(ip,uid,regnum,action,operationtime,channel) values('{$ip}','{$userid}',1,2,'{$date}','5')"); $user = $_MooClass['MooMySQL']->getOne("select id from web_ahtv_reguser where uid={$userid} and channel='5'"); if (empty($user['id'])) { $_MooClass['MooMySQL']->query("insert into web_ahtv_reguser(uid,username,gender,birthday,province,city,mobile,regtime,channel) values('{$userid}','{$username}','{$gender}','{$birthday}','{$workprovince}','{$workcity}','{$mobile}','{$date}','5')"); } } elseif ($channel == '6') { $_MooClass['MooMySQL']->query("insert into web_ahtv(ip,uid,regnum,action,operationtime,channel) values('{$ip}','{$userid}',1,2,'{$date}','6')"); $user = $_MooClass['MooMySQL']->getOne("select id from web_ahtv_reguser where uid={$userid} and channel='6'"); if (empty($user['id'])) { $_MooClass['MooMySQL']->query("insert into web_ahtv_reguser(uid,username,gender,birthday,province,city,mobile,regtime,channel) values('{$userid}','{$username}','{$gender}','{$birthday}','{$workprovince}','{$workcity}','{$mobile}','{$date}','6')"); } } else { $_MooClass['MooMySQL']->query("insert into web_ahtv(ip,uid,upgradenum,action,operationtime,channel) values('{$ip}','{$userid}',1,3,'{$date}','1')"); $user = $_MooClass['MooMySQL']->getOne("select id from web_ahtv_reguser where uid='{$userid}' and channel='1'"); if (empty($user['id'])) { $_MooClass['MooMySQL']->query("insert into web_ahtv_reguser(uid,username,gender,birthday,province,city,mobile,regtime,channel) values('{$userid}','{$username}','{$gender}','{$birthday}','{$workprovince}','{$workcity}','{$mobile}','{$date}','1')"); } } if ($channel == 4) { $url = 'index.php?n=payment&h=channel_qixi'; } else { if ($channel == 5) { $url = 'index.php?n=payment&h=channel_xuanyan'; } else { if ($channel == 6) { $url = 'index.php?n=payment&h=channel_eyes'; } else { $url = 'index.php?n=payment&h=diamond'; } } } MooMessage("您已成功报名参加活动!", $url, '03'); } elseif ($user_arr['s_cid'] == '30' || $user_arr['s_cid'] == '20') { //钻石高级会员转向 联系真爱一生 提示 $username = $user_arr['username']; $gender = $user_arr['gender']; $birthday = $user_arr['birthyear'] . '-' . $user_arr['birthmonth']; $workprovince = $user_arr['province']; $workcity = $user_arr['city']; $mobile = $user_arr['telphone']; if ($channel == '2') { $_MooClass['MooMySQL']->query("insert into web_ahtv(ip,uid,regnum,action,operationtime,channel) values('{$ip}','{$userid}',1,2,'{$date}','2')"); $user = $_MooClass['MooMySQL']->getOne("select id from web_ahtv_reguser where uid={$userid} and channel='2'"); if (empty($user['id'])) { $_MooClass['MooMySQL']->query("insert into web_ahtv_reguser(uid,username,gender,birthday,province,city,mobile,regtime,channel) values('{$userid}','{$username}','{$gender}','{$birthday}','{$workprovince}','{$workcity}','{$mobile}','{$date}','2')"); } } elseif ($channel == '3') { $_MooClass['MooMySQL']->query("insert into web_ahtv(ip,uid,regnum,action,operationtime,channel) values('{$ip}','{$userid}',1,2,'{$date}','3')"); $user = $_MooClass['MooMySQL']->getOne("select id from web_ahtv_reguser where uid={$userid} and channel='3'"); if (empty($user['id'])) { $_MooClass['MooMySQL']->query("insert into web_ahtv_reguser(uid,username,gender,birthday,province,city,mobile,regtime,channel) values('{$userid}','{$username}','{$gender}','{$birthday}','{$workprovince}','{$workcity}','{$mobile}','{$date}','3')"); } } elseif ($channel == '4') { $_MooClass['MooMySQL']->query("insert into web_ahtv(ip,uid,regnum,action,operationtime,channel) values('{$ip}','{$userid}',1,2,'{$date}','4')"); $user = $_MooClass['MooMySQL']->getOne("select id from web_ahtv_reguser where uid={$userid} and channel='4'"); if (empty($user['id'])) { $_MooClass['MooMySQL']->query("insert into web_ahtv_reguser(uid,username,gender,birthday,province,city,mobile,regtime,channel) values('{$userid}','{$username}','{$gender}','{$birthday}','{$workprovince}','{$workcity}','{$mobile}','{$date}','4')"); } } elseif ($channel == '5') { $_MooClass['MooMySQL']->query("insert into web_ahtv(ip,uid,regnum,action,operationtime,channel) values('{$ip}','{$userid}',1,2,'{$date}','5')"); $user = $_MooClass['MooMySQL']->getOne("select id from web_ahtv_reguser where uid={$userid} and channel='5'"); if (empty($user['id'])) { $_MooClass['MooMySQL']->query("insert into web_ahtv_reguser(uid,username,gender,birthday,province,city,mobile,regtime,channel) values('{$userid}','{$username}','{$gender}','{$birthday}','{$workprovince}','{$workcity}','{$mobile}','{$date}','5')"); } } elseif ($channel == '6') { $_MooClass['MooMySQL']->query("insert into web_ahtv(ip,uid,regnum,action,operationtime,channel) values('{$ip}','{$userid}',1,2,'{$date}','6')"); $user = $_MooClass['MooMySQL']->getOne("select id from web_ahtv_reguser where uid={$userid} and channel='6'"); if (empty($user['id'])) { $_MooClass['MooMySQL']->query("insert into web_ahtv_reguser(uid,username,gender,birthday,province,city,mobile,regtime,channel) values('{$userid}','{$username}','{$gender}','{$birthday}','{$workprovince}','{$workcity}','{$mobile}','{$date}','6')"); } } else { $_MooClass['MooMySQL']->query("insert into web_ahtv(ip,uid,regnum,action,operationtime,channel) values('{$ip}','{$userid}',1,2,'{$date}','1')"); $user = $_MooClass['MooMySQL']->getOne("select id from web_ahtv_reguser where uid={$userid} and channel='1'"); if (empty($user['id'])) { $_MooClass['MooMySQL']->query("insert into web_ahtv_reguser(uid,username,gender,birthday,province,city,mobile,regtime,channel) values('{$userid}','{$username}','{$gender}','{$birthday}','{$workprovince}','{$workcity}','{$mobile}','{$date}','1')"); } } if ($channel == 4) { $url = 'index.php?n=payment&h=channel_qixi'; } else { if ($channel == 5) { $url = 'index.php?n=payment&h=channel_xuanyan'; } else { if ($channel == 6) { $url = 'index.php?n=payment&h=channel_eyes'; } else { $url = 'index.php?n=payment&h=diamond'; } } } MooMessage("请拨打 4006780405 找您的专线真爱一生联系!", $url, '03'); } elseif (empty($userid)) { $ip = GetIP(); if ($channel == '2') { $_MooClass['MooMySQL']->query("insert into web_ahtv(ip,uid,regnum,action,operationtime,channel) values('{$ip}','{$userid}',1,2,'{$date}','2')"); $user = $_MooClass['MooMySQL']->getOne("select id from web_ahtv_reguser where mobile='{$mobile}' and channel='2'"); if (empty($user['id'])) { $_MooClass['MooMySQL']->query("insert into web_ahtv_reguser(uid,username,gender,birthday,province,city,mobile,regtime,channel) values('{$userid}','{$username}','{$gender}','{$birthday}','{$workprovince}','{$workcity}','{$mobile}','{$date}','2')"); } } elseif ($channel == '3') { $_MooClass['MooMySQL']->query("insert into web_ahtv(ip,uid,regnum,action,operationtime,channel) values('{$ip}','{$userid}',1,2,'{$date}','3')"); $user = $_MooClass['MooMySQL']->getOne("select id from web_ahtv_reguser where mobile='{$mobile}' and channel='3'"); if (empty($user['id'])) { $_MooClass['MooMySQL']->query("insert into web_ahtv_reguser(uid,username,gender,birthday,province,city,mobile,regtime,channel) values('{$userid}','{$username}','{$gender}','{$birthday}','{$workprovince}','{$workcity}','{$mobile}','{$date}','3')"); } } elseif ($channel == '4' || $channel == '5' || $channel == '6') { MooMessage("尊敬的游客你好,本次活动仅限注册用户才可以,请你先注册或者登录后才可以参见!", 'index.php?n=register', '03'); } else { $_MooClass['MooMySQL']->query("insert into web_ahtv(ip,uid,regnum,action,operationtime,channel) values('{$ip}','{$userid}',1,2,'{$date}','1')"); $user = $_MooClass['MooMySQL']->getOne("select id from web_ahtv_reguser where mobile='{$mobile}' and channel='1'"); if (empty($user['id'])) { $_MooClass['MooMySQL']->query("insert into web_ahtv_reguser(uid,username,gender,birthday,province,city,mobile,regtime,channel) values('{$userid}','{$username}','{$gender}','{$birthday}','{$workprovince}','{$workcity}','{$mobile}','{$date}','1')"); } } MooMessage("您已成功报名参加活动,现在跳转到真爱一生网注册页面!", 'index.php?n=register', '03'); } }
$result = $client->PayTransNoResult($param); } catch (SoapFault $fault) { // echo "Fault! code:",$fault->faultcode,", string: ",$fault->faultstring; MooMessage('您的支付请求发送意外错误,请重新提交你的支付请求。', 'index.php?n=payment&h=govip'); } // var_dump($result);exit; //$Serl_result=serialize($result); $PayTransNoResultResult = $result->PayTransNoResultResult; //返回值 //$merOrderNum=$result->merOrderNum;//订单号 $tranDateTime = date('Y-m-d', $result->tranDateTime); //交易日期 //echo $Serl_result;exit; //if(preg_match("/N00000/",$Serl_result)){ if ($PayTransNoResultResult == 'N00000') { $memcached->set('telPay' . $uid, ++$sendedPayCount, 0, 28800); //设置当日提交支付请求数 //*********真爱一生备注********* /* $sid = $user_arr['sid']; $title = '您的会员'.$uid.'正在支付 ';//.$p5_Pid; $awoketime = $timestamp+3600; $sql_remark = "insert into {$dbTablePre}admin_remark set sid='{$sid}',title='{$title}',content='{$title}',awoketime='{$awoketime}',dateline='{$timestamp}'"; $res = $_MooClass['MooMySQL']->query($sql_remark); */ //**********end********** //header("Location: index.php?n=payment&h=telPaying&merOrderNum=$merOrderNum&tranDateTime=$tranDateTime&bank_type=$bank_type");exit; //确保重定向后,后续代码不会被执行 } else { /* $key=md5('telpay'); $memcached->set($Key,'ddd',600); */ MooMessage('您的支付请求失败,请重新提交您的支付请求。', 'index.php?n=index&h=govip'); }
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'); }
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'); }
function to_send_hn_message() { global $_MooClass, $dbTablePre, $userid, $user_arr; $s_title = MooGetGPC('s_title', 'string', 'P'); $s_title = rtrim($s_title); //对主题字数限制 $s_title = MooCutstr($s_title, 30, $dot = ''); $s_content = MooGetGPC('s_content', 'string', 'P'); //note 特殊字符 $s_content = rtrim($s_content); if ($s_title && $s_content) { //note 客服ID $user = $_MooClass['MooMySQL']->getOne("select uid,sid,telphone from {$dbTablePre}members_search where uid='{$userid}'"); if (empty($user['sid'])) { $sid = 20; } else { $sid = $user['sid']; } //note 添回复的消息、添加发送的消息 $remark_title = "{$userid}会员给给您发消息了,请速查看。"; $awoketime = time() + 600; $sql = "INSERT INTO `{$dbTablePre}admin_remark` SET sid='{$sid}',title='{$remark_title}',content='{$s_content}',awoketime='{$awoketime}',dateline='{$GLOBALS['timestamp']}'"; $send_status = $_MooClass['MooMySQL']->query($sql); //邮件回复提醒 $sql = "INSERT INTO {$GLOBALS['dbTablePre']}services(s_cid,s_uid,s_fromid,s_title,s_content,s_time,is_server,sid,flag)\n\t\t\t\tVALUES(3,{$userid},'{$sid}','真爱一生消息','您好!您的消息红娘已经收到,我们将在一个工作日内解决!4008787920','{$GLOBALS['timestamp']}','1','{$sid}','1')"; $ret = $GLOBALS['_MooClass']['MooMySQL']->query($sql); //短信回复提醒 Push_message_intab($userid, $user['telphone'], "邮件回复", "您的消息红娘已经收到,我们将在一个工作日内解决。4008787920!", "system"); //添加成功提示信息 if ($send_status) { MooMessage('发送成功', 'javascript:history.go(-2)', '05'); } else { MooMessage('发送失败', 'javascript:history.go(-1)', '03'); } } else { MooMessage('数据填写不完整', 'javascript:history.go(-1)', '03'); } }
function get_receive_rose() { global $_MooClass, $dbTablePre, $userid, $pagesize, $user_arr; //note 获取删除提交的变量 $delrose = MooGetGPC('delrose', 'string'); $delroseid = MooGetGPC('delroseid', 'array'); //note 删除提交的数据 if ($delrose && count($delroseid)) { $ids = "'" . implode("','", $delroseid) . "'"; $time = time(); $_MooClass['MooMySQL']->query("UPDATE {$dbTablePre}service_rose SET receive_del=1,receive_deltime='{$time}', receivenum = 0 WHERE rid IN ( {$ids} )"); MooMessage("鲜花删除成功", 'index.php?n=service&h=rose&t=igetrose', '05'); } //note 如果提交的数据不存在,或者是提交的时候没有选中 if ($delrose && !count($delroseid)) { MooMessage('请选择要删除的鲜花', 'index.php?n=service&h=rose&t=igetrose', '01'); exit; } //分页 $page_per = 4; $page_url = 'http://' . $_SERVER['SERVER_NAME'] . ':' . $_SERVER["SERVER_PORT"] . $_SERVER["REQUEST_URI"]; $page_url = preg_replace("/(&page=\\d+)/", "", $page_url); $page_now = MooGetGPC('page', 'integer', 'G'); $temp = $_MooClass['MooMySQL']->getOne("select count(1) as num FROM {$dbTablePre}service_rose WHERE receiveuid = '{$userid}' and send_del=0"); $item_num = $temp['num']; $page_num = ceil($item_num / $page_per); if ($page_now > $page_num) { $page_now = $page_num; } if ($page_now < 1) { $page_now = 1; } $start = ($page_now - 1) * $page_per; $rose = $_MooClass['MooMySQL']->getAll("SELECT * FROM {$dbTablePre}service_rose WHERE receiveuid = '{$userid}' and receive_del=0 ORDER BY receivetime desc LIMIT {$start},{$page_per}"); //note 已收到的玫瑰总数 $temp = $_MooClass['MooMySQL']->getOne("SELECT sum(case when receivenum>=1 then 1 else 0 end) as num FROM {$dbTablePre}service_rose WHERE receiveuid = '{$userid}' and receive_del=0"); $receive_num = empty($temp['num']) ? 0 : $temp['num']; //note 已发送的玫瑰总数 $temp = $_MooClass['MooMySQL']->getOne("SELECT sum(case when num>=1 then 1 else 0 end) as num FROM {$dbTablePre}service_rose WHERE senduid = '{$userid}' AND is_server=0 and send_del=0"); $send_num = empty($temp['num']) ? 0 : $temp['num']; require MooTemplate('public/service_rose_getreceiverose', 'module'); }
function getmyleers() { global $_MooClass, $dbTablePre, $userid, $pagesize, $user_arr; //note 处理回复秋波 $repeatleer = MooGetGPC('repeatleer', 'string'); $repeatleerid = MooGetGPC('repeatleerid', 'integer'); if ($repeatleer && $repeatleerid) { $_MooClass['MooMySQL']->query("UPDATE {$dbTablePre}service_leer SET stat = '{$repeatleer}' WHERE senduid = '{$repeatleerid}' AND receiveuid = '{$userid}'"); header("location:index.php?n=service&h=leer"); } //note 处理委婉拒绝秋波 $refuseleer = MooGetGPC('refuseleer', 'string'); $refuseleerid = MooGetGPC('refuseleerid', 'integer'); if ($refuseleer && $refuseleerid) { $_MooClass['MooMySQL']->query("UPDATE {$dbTablePre}service_leer SET stat = '2' WHERE senduid = '{$refuseleerid}' AND receiveuid = '{$userid}'"); header("location:index.php?n=service&h=leer"); } //note 获取删除提交的变量 $delleer = MooGetGPC('delleer', 'string'); $delleerid = MooGetGPC('delleerid', 'array'); //note 删除提交的数据 if ($delleer && count($delleerid)) { $time = time(); foreach ($delleerid as $v) { //$_MooClass['MooMySQL']->query("DELETE FROM {$dbTablePre}service_leer WHERE lid = '$v'"); $_MooClass['MooMySQL']->query("UPDATE {$dbTablePre}service_leer SET receive_del=1,receive_deltime='{$time}',receivenum = '0' WHERE lid = '{$v}'"); } MooMessage("秋波删除成功", 'index.php?n=service&h=leer'); } //note 如果提交的数据不存在,或者是提交的时候没有选中 if ($delleer && !count($delleerid)) { MooMessage('请选择要删除的秋波', 'index.php?n=service&h=leer', '01'); exit; } //分页 $page_per = 4; $page_url = 'http://' . $_SERVER['SERVER_NAME'] . ':' . $_SERVER["SERVER_PORT"] . $_SERVER["REQUEST_URI"]; $page_url = preg_replace("/(&page=\\d+)/", "", $page_url); $page_now = MooGetGPC('page', 'integer', 'G'); $temp = $_MooClass['MooMySQL']->getOne("select count(1) as num FROM {$dbTablePre}service_leer WHERE receiveuid = '{$userid}' and receive_del=0"); $item_num = $temp['num']; $page_num = ceil($item_num / $page_per); if ($page_now > $page_num) { $page_now = $page_num; } if ($page_now < 1) { $page_now = 1; } //读数据 $start = ($page_now - 1) * $page_per; $leer = $_MooClass['MooMySQL']->getAll("SELECT * FROM {$dbTablePre}service_leer WHERE receiveuid = '{$userid}' and receive_del=0 ORDER BY receivetime desc LIMIT {$start},{$page_per}"); //note 已收到的总数 $temp = $_MooClass['MooMySQL']->getOne("SELECT sum(case when receivenum>=1 then 1 else 0 end) as num FROM {$dbTablePre}service_leer WHERE receiveuid = '{$userid}' and receive_del=0"); $receive_num = empty($temp['num']) ? 0 : $temp['num']; //note 已发送的总数 $temp = $_MooClass['MooMySQL']->getOne("SELECT sum(case when num>=1 then 1 else 0 end) as num FROM {$dbTablePre}service_leer WHERE senduid = '{$userid}' AND send_del = 0 AND is_server=0"); $send_num = empty($temp['num']) ? 0 : $temp['num']; require MooTemplate('public/service_leer_getmyleers', 'module'); }
function whoismyfriend() { global $_MooClass, $dbTablePre, $userid, $pagesize, $user_arr; $pagesize = 4; //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}'"); } MooMessage("删除意中人成功", 'index.php?n=service&h=liker', '05'); } //note 如果提交的数据不存在,或者是提交的时候没有选中 if ($delfriend && !count($delfriendid)) { MooMessage('请选择要删除的意中人', 'index.php?n=service&h=liker', '01'); exit; } //note 获得当前url $currenturl = 'http://' . $_SERVER['SERVER_NAME'] . ':' . $_SERVER["SERVER_PORT"] . $_SERVER["REQUEST_URI"]; $currenturl2 = preg_replace("/(&page=\\d+)/", "", $currenturl); $currenturl2 = preg_replace("/7651/", "7652", $currenturl2); //note 获得第几页 $page = max(1, intval($_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}'", true); $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}"); } require MooTemplate('public/service_friend_myfriendlist', 'module'); }