function order_paid($order_id){ $pay=get_pay_one($order_id); //购买服务,0:钻石会员,1:高级会员,2:城市之星 $serviceArr = array(0=>'钻石会员',1=>'高级会员',2=>'城市之星'); if($pay['status']=="1"){ return false; }else { update_pay($order_id);//更新状态防止快速刷新 update_user_rank($pay['uid'],$pay['pay_service']);//更新用户相应的等级 $type_name = $serviceArr[$pay['pay_service']]; $content="恭喜您,您已成功升级为真爱一生网{$type_name}!您的真爱一生单号".$order_id."请等待审核。[真爱一生网]"; if(!empty($pay['telphone'])){ if(SendMsg($pay['telphone'],$content)){ $time=time(); $_MooClass['MooMySQL']->query("INSERT INTO {$dbTablePre}smslog_sys (id,sid,uid,content,sendtime,type) values('','',".$pay['uid'].",'$content','$time','升级')"); } } MooSendMail($pay['username'],"真爱一生网会员升级",$content.'您可以咨询客服您的会员办理进度!',$is_template = true,$pay['uid']); return true; } }
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 sendemail_once() { global $_MooClass; $start = $_GET['s'] ? $_GET['s'] : 0; $userMsg = $_MooClass['MooMySQL']->getAll("select uid,username from web_members_search where usertype=1 limit {$start},100", 0, 0, 0, true); //$userMsg = array(array('uid'=>1599408,'username'=>'*****@*****.**')); if (empty($userMsg)) { exit('ok'); } //$ua =array(); //$a = MooReadFileadmin('public/mailtamp/template1.html', false); var_dump($a); $ToBody = " 尊敬的会员您好,真爱一生网最近进行了改版,新增了钻石会员,并且前期有些用户已经开始进行了尝试性使用,服务初期,我们进行优惠促销活动,原价1999元/6个月,现价1399元/6个月,如果您现在是,或者曾经是我们的高级会员,那么您还可以享受更多的优惠。我们对前50名升级的钻石会员采取以下优惠:1、如果您现在是高级会员升级钻石会员,将享受服务期顺延的方式,即从您升级钻石会员开始,我们将把您为服务完的高级会员的时间进行延长,就是6个月加上您剩余的高级会员的时间,并且您只需付两个价格的差价,即1100元即可。2、如果您以前是高级会员的,现在升级钻石会员,您也只需付差价,1100元即可享受钻石会员的服务。数量有限,希望各位尊敬的会员能抓住机会,为了自己明天的幸福,马上行动起来。钻石会员服务内容及详情,请登录真爱一生网 www.zhenaiyisheng.cc查看钻石会员介绍,或者直接拨打客服热线4006780405,直接找您的真爱一生进行了解。"; foreach ($userMsg as $u) { //$verifycode = strtoupper(md5('hongniangwang'.$u['uid'].$u['username'])); //$ToBody = "点击激活:<a href='http://".MOOPHP_HOST."/index.php?n=myaccount&h=activeaccount&y=active&p=".$u['username']."&uid=".$u['uid']."&verifycode=".$verifycode."'>http://".MOOPHP_HOST."/index.php?n=myaccount&h=activeaccount&y=active&p=".$u['username']."&uid=".$u['uid']."&verifycode=".$verifycode."</a>"; //exit($ToBody); $ToAddress = $u['username']; $ToSubject = "真爱一生网推陈出新,新版闪亮登场,推出钻石会员服务"; //发送邮件 $end = MooSendMail($ToAddress, $ToSubject, $ToBody, $is_template = true, $u['uid']); } $start += 100; echo '<html><head><meta http-equiv="refresh" content="2;url=?s=' . $start . '&y=sendemail_once&h=activeaccount&n=myaccount"> </head><body></body></html>'; }
function sendnewleer() { global $_MooClass, $dbTablePre, $timestamp, $user_arr, $serverid; $sendtoid = MooGetGPC('sendtoid', 'integer'); $userid = $user_arr['uid']; //note 分配客服 //allotserver($userid); //note 获得照片总数 //$query = $_MooClass['MooMySQL']->query("SELECT imgid FROM {$dbTablePre}pic WHERE uid = '$sendtoid'"); //$pic_total = $_MooClass['MooMySQL']->numRows($query); $query = $_MooClass['MooMySQL']->getOne("SELECT count(1) as c FROM {$dbTablePre}pic WHERE uid = '{$sendtoid}'"); $pic_total = $query['c']; //note 自己不能给自己发送秋波,直接转到秋波列表页面 if ($sendtoid == $userid) { MooMessage('自己不可以给自己发过送秋波', 'javascript:history.go(-1);', '04'); 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) { MooMessage('对不起您不能模拟操作', 'javascript:history.go(-1);', '04'); exit; } //note 双方屏蔽不给操作 if (MooGetScreen($userid, $sendtoid)) { MooMessage('因特殊原因,送秋波失败', "index.php?n=service&h=rose&t=getmorerose", '03'); exit; } //note 要做性别过滤,异性的发送秋波,直接转到秋波列表页面 $send_user1 = leer_send_user1($sendtoid); $user = leer_send_user1($userid); if ($send_user1['gender'] == $user['gender']) { MooMessage('同性之间不可互发秋波', 'javascript:history.go(-1);', '02'); exit; } //测试用的 by hwt if ($_POST['sendleer']) { if (empty($GLOBALS['MooUid'])) { list($uid, $password) = explode("\t", MooAuthCode($_MooCookie['auth'], 'DECODE')); $uid = intval($uid); } else { $uid = $GLOBALS['MooUid']; } if (empty($uid)) { MooMessage('您还没有登录', 'index.php?n=login'); } $leer = $_MooClass['MooMySQL']->getOne("SELECT * FROM {$dbTablePre}service_leer WHERE receiveuid = '{$sendtoid}' AND senduid = '{$userid}' "); if ($leer['lid']) { $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 { //note 发送新的秋波,写入数据库 发送者,接受者,发送时间 $_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"; if (MOOPHP_ALLOW_FASTDB) { $res = MooFastdbGet('members', 'uid', $sendtoid); } else { $res = $_MooClass['MooMySQL']->getOne("select * from {$dbTablePre}members where uid='{$sendtoid}'"); } $send_user_info = $_MooClass['MooMySQL']->getOne("select * from `{$dbTablePre}members` a left join {$dbTablePre}choice b on a.uid=b.uid where a.uid = '{$uid}' LIMIT 1"); //头像路径 $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 = $provice_list[$send_user_info[province]]; //省 $city = $city_list[$send_user_info[city]]; //市 $height = $send_user_info[height] ? $height_list[$send_user_info[height]] : "未知"; //身高 ob_start(); //require_once MooTemplate('public/mail_space_leertpl', 'module'); //秋波模板 require_once MooTemplate('public/mail_space_leertpl', 'module'); //秋波模板 $body = ob_get_clean(); MooSendMail($res['username'], "真爱一生网系统温馨提示", $body, "", false, $sendtoid); // MooSendMailSpace($res['username'],"真爱一生网系统温馨提示","真爱一生网提醒:有会员给您发送秋波了!请尽快查收!您的帐号是:".$res['username'],$type="1",$send_user,$send_type = "秋波",$userid,$send_user_img,$age,$tall,$area,$sendtime,$introduce); //每天向同一用户发送多次,短信记录数表只记一次 $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; } /*if($res['is_phone']){ SendMsg($res['telphone'],"真爱一生网 用户ID:".$userid.",".$send_user_grade.",已给您发送秋波,请及时把握您的缘分!4006780405"); }*/ //SendMsg($res['telphone'],"秋波","真爱一生网 用户ID:".$userid.",".$send_user_grade.",已给您发送秋波,请及时把握您的缘分!4006780405",$userid); /* $week_time = 24*3600*7;//一周时间秒数 $interval_time = $timestamp - $user_arr['last_login_time'];//当前时间-最后登录时间 $date1 = date("Y-m-d",strtotime("last Monday")); $date2 = date("Y-m-d",strtotime("Sunday")); if($interval_time > $week_time){//不活跃用户每周发一条短信 $_MooClass['MooMySQL']->query("INSERT INTO {$dbTablePre}today_send SET uid = '".$sendtoid."', sid = '".$userid."',phone = '".$res['telphone']."',sendtime = '".date("Y-m-d")."'" ); $cos = $_MooClass['MooMySQL']->getOne("select count(*) as c from {$dbTablePre}today_send where uid='$sendtoid' and sendtime>='$date1' and sendtime<='$date2'"); if($cos['c']<=1){ //fanglin暂时屏蔽 Push_message_intab($sendtoid,$res['telphone'],"秋波","真爱一生网 用户ID:".$userid.",".$send_user_grade.",已给您发送秋波,请及时把握您的缘分!4006780405",$userid); } }else{ //活跃用户每天一条 if($send_leer_date==date("Y-m-d") && $today_leer_count == 1){ //每天同一个用户发送多次秋波,短信只记一次 $cos = $_MooClass['MooMySQL']->getOne("select count(*) as c from {$dbTablePre}today_send where uid='$sendtoid' and sendtime='".date("Y-m-d")."'"); if($cos[c]<5){ $_MooClass['MooMySQL']->query("INSERT INTO {$dbTablePre}today_send SET uid = '".$sendtoid."', sid = '".$userid."',phone = '".$res['telphone']."',sendtime = '".date("Y-m-d")."'" ); //fanglin暂时屏蔽 Push_message_intab($sendtoid,$res['telphone'],"秋波","真爱一生网 用户ID:".$userid.",".$send_user_grade.",已给您发送秋波,请及时把握您的缘分!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; MooMessage('发送秋波成功', 'index.php?n=service&h=leertest&t=sendnewleer'); } else { $sql = "SELECT content FROM {$dbTablePre}members_sendinfo where type=1 and isShow=1"; $sendinfo = $_MooClass['MooMySQL']->getAll($sql); require MooTemplate('public/service_leer_sendnewleer', 'module'); } }
function to_send_message() { global $_MooClass, $dbTablePre, $userid, $pagesize, $user_arr, $timestamp, $serverid; //print_r($_POST); //note s_cid 发送者的权限(回复时才有) $s_cid = MooGetGPC('s_cid', 'integer', 'P'); //echo $s_cid;exit; //收件人id $sid = MooGetGPC('s_id', 'integer', 'P'); //发件人id $mid = MooGetGPC('m_id', 'integer', 'P'); ///echo $sid;exit; $s_title = MooGetGPC('s_title', 'string', 'P'); $s_title = rtrim($s_title); //对主题字数限制 $s_title = MooStrReplace(MooCutstr($s_title, 30, $dot = '')); $s_content = MooGetGPC('s_content', 'string', 'P'); //note 特殊字符 $s_content = rtrim(MooStrReplace(safeFilter($s_content))); $send_mymessage = MooGetGPC('send_mymessage', 'integer', 'P'); $message_back = MooGetGPC('message_back', 'integer', 'P'); //note 双方屏蔽不给操作 if (MooGetScreen($mid, $sid)) { MooMessage('因特殊原因,消息发送失败', "index.php?n=service&h=rose&t=getmorerose", '01'); exit; } if ($mid && $sid && $s_title && $s_content) { $m_level = get_userrank($userid); //会员等级 if ($m_level == 2 && $user_arr['usertype'] != 3) { //普通会员需要审核(除采集会员之外) //if($user_arr['gender'] == 0){ //如果是男方发的,需要审核,0表示 $send_status = $_MooClass['MooMySQL']->query("insert into {$dbTablePre}services (s_cid,s_uid,s_fromid,s_title,s_content,s_time,sid,flag) values ('{$s_cid}','{$sid}','{$mid}','{$s_title}','{$s_content}'," . time() . ",'{$user_arr['sid']}','0')"); } else { $send_status = $_MooClass['MooMySQL']->query("insert into {$dbTablePre}services (s_cid,s_uid,s_fromid,s_title,s_content,s_time,sid,flag) values ('{$s_cid}','{$sid}','{$mid}','{$s_title}','{$s_content}'," . time() . ",'{$user_arr['sid']}','1')"); } //发送短信和邮件 include_once "./module/crontab/crontab_config.php"; $res = MooMembersData($sid); // $send_user_info = $_MooClass['MooMySQL']->getAll("select * from `{$dbTablePre}members_search` a left join {$dbTablePre}members_choice b on a.uid=b.uid where a.uid = '$userid'"); $send_user_info = array_merge(MooGetData("members_choice", 'uid', $userid), MooMembersData($userid)); // $send_user_info = $send_user_info[0]; //头像路径 $path = thumbImgPath(2, $send_user_info['pic_date'], $send_user_info['pic_name'], $send_user_info['gender']); 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(); require_once MooTemplate('public/mail_space_messagetpl', 'module'); //模板 $body = ob_get_clean(); MooSendMail($res['username'], "真爱一生网系统温馨提示", $body, "", false, $sid); $week_time = 24 * 3600 * 7; //一周时间秒数 $interval_time = $timestamp - $user_arr['last_login_time']; //当前时间-最后登录时间 $date1 = date("Y-m-d", strtotime("last Monday")); $date2 = date("Y-m-d", strtotime("Sunday")); if ($interval_time > $week_time) { //不活跃用户每周发一条短信 $_MooClass['MooMySQL']->query("INSERT INTO {$dbTablePre}today_send SET uid = '" . $sid . "', sid = '" . $userid . "',phone = '" . $res['telphone'] . "',sendtime = '" . date("Y-m-d") . "'"); $cos = $_MooClass['MooMySQL']->getOne("select count(*) as c from {$dbTablePre}today_send where uid='{$sid}' and sendtime>='{$date1}' and sendtime<='{$date2}'", true); if ($cos['c'] <= 1) { //fanglin暂时屏蔽 Push_message_intab($sid, $res['telphone'], "邮件", "用户ID:" . $userid . "," . $send_user_grade . ",已给您发送电子邮件,请登录www.zhenaiyisheng.cc查看!4008787920【真爱一生网】", $userid); } } else { //活跃用户每天一条 //每天该用户超过5条信息不发送短信 $cos = $_MooClass['MooMySQL']->getOne("select count(*) as c from {$dbTablePre}today_send where uid='{$sid}' and sendtime='" . date("Y-m-d") . "'", true); if ($cos['c'] < 5) { $_MooClass['MooMySQL']->query("INSERT INTO {$dbTablePre}today_send SET uid = '" . $sid . "', sid = '" . $userid . "',phone = '" . $res['telphone'] . "',sendtime = '" . date("Y-m-d") . "'"); //fanglin暂时屏蔽 Push_message_intab($sid, $res['telphone'], '邮件', "用户ID:" . $userid . "," . $send_user_grade . ",已给您发送电子邮件,请登录www.zhenaiyisheng.cc!4008787920【真爱一生网】", $userid); } } //note 发送资料给接收方 if ($send_mymessage) { } //note 备份邮件操作 if ($message_back) { //note 发送MAIL时所需信息 $user = $_MooClass['MooMySQL']->getOne("select username,nickname from {$dbTablePre}members_search where uid='{$mid}'"); //note 发送MAIL时收信人的邮箱 $ToAddress = $user['username']; //note 发送MAIL时主题 $ToSubject = '提示:您在真爱一生网所发的消息备份'; //note 发送MAIL时Body内容所需信息 $username = $user['nickname']; //note 发送MAIL时Body内容所需信息 $toname = $_MooClass['MooMySQL']->getOne("select nickname from {$dbTablePre}members_search where uid='{$sid}'"); if ($username) { $ToBody = $username; } else { $ToBody = 'ID号为' . $mid . '的会员<br>'; } if ($toname['nickname']) { $ToBody .= ':您好,您于' . date('Y-m-d H:i:s', time()) . ',在真爱一生网发送电子邮件给' . $toname['nickname'] . ',内容如下:<br>'; } else { $ToBody .= ':您好,您于' . date('Y-m-d H:i:s', time()) . ',在真爱一生网发送电子邮件给ID号为' . $sid . '的会员,内容如下:<br>'; } if ($username) { $ToBody .= ' 发件人:' . $username . '<br>'; } else { $ToBody .= ' 发件人:ID号为' . $mid . '<br>'; } if ($toname['nickname']) { $ToBody .= ' 收件人:' . $toname['nickname'] . '<br>'; } else { $ToBody .= ' 收件人:ID号为' . $sid . '<br>'; } $ToBody .= ' 主题:' . $s_title . '<br>'; $ToBody .= ' 正文:<br> ' . $s_content; MooSendMail($ToAddress, $ToSubject, $ToBody, $is_template = true, $sid); } //添加成功提示信息 if ($send_status) { /*普通会员对全权会员反馈白名单*/ 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); } //提醒所属客服 $usid = $user_arr['sid']; $title = '您的会员 ' . $mid . ' 向 ' . $sid . ' 发送了邮件'; $awoketime = $timestamp + 3600; $sql_remark = "insert into {$dbTablePre}admin_remark set sid='{$usid}',title='{$title}',content='{$title}',awoketime='{$awoketime}',dateline='{$timestamp}'"; $res = $_MooClass['MooMySQL']->query($sql_remark); if ($user_arr['gender'] == 0) { //男方发的 MooMessage('发送成功,真爱一生审核后对方即可以收到。', 'index.php?n=service&h=message&t=sendmessage', '05'); } else { MooMessage('发送成功', 'index.php?n=service&h=message&t=sendmessage', '05'); } } else { MooMessage('发送失败', 'index.php?n=service&h=message&t=send&sendtoid=' . $sid, '03'); } } else { MooMessage('数据填写不完整', 'index.php?n=service&h=message&t=send&sendtoid=' . $sid, '02'); } }
function allmember_edit_info() { global $fastdb; if ($_POST) { $uid = MooGetGPC('uid', 'integer', 'P'); if (empty($uid)) { salert('参数不正确'); exit; } $validation = MooAutoLoad('MooValidation'); //search $search1 = array("nickname" => "昵称", "username" => "Email", "truename" => "姓名", "telphone" => "电话", "marriage" => "婚姻", "height" => "身高", "salary" => "收入", "education" => "学历", "children" => "小孩", "house" => "住房", "province" => "工作身份", "city" => "工作城市", "hometownProvince" => "籍贯省份", "hometownCity" => "籍贯城市", "corptype" => "公司类别", "is_lock" => "封锁", "city_star" => "城市之星", "usertype" => "会员类型", "s_cid" => "会员级别", "gender" => "性别", "occupation" => "职业", "nation" => "民族", "smoking" => "吸烟", "drinking" => "喝酒", "body" => "体形", "weight" => "体重", "nature" => "性格", "family" => "兄弟姐妹"); $search2 = array(array("marriage" => array("0" => "不限", "1" => "未婚", "3" => "离异", "4" => "丧偶")), array("salary" => array("0" => "不限", "1" => "1000元以下", "2" => "1001-2000元", "3" => "2001-3000元", "4" => "3001-5000元", "5" => "5001-8000元", "6" => "8001-10000元", "7" => "10001-20000元", "8" => "20001-50000元", "9" => "50000元以上")), array("education" => array("0" => "不限", "3" => "高中及以下", "4" => "大专", "5" => "大学本科", "6" => "硕士", "7" => "博士")), array("children" => array("0" => "不限", "1" => "没有", "3" => "有,我们住在一起", "4" => "有,我们偶尔一起住", "5" => "有,但不在身边", "2" => "保密")), array("house" => array("0" => "不限", "1" => "和父母家人同住", "2" => "自有物业", "3" => "租房", "4" => "婚后有房", "5" => "保密")), array("province" => array("0" => "不限", "10102000" => "北京", "10103000" => "上海", "10101201" => "深圳", "10101002" => "广州", "10101000" => "广东", "10104000" => "天津", "10105000" => "重庆", "10106000" => "安徽", "10107000" => "福建", "10108000" => "甘肃", "10109000" => "广西", "10110000" => "贵州", "10111000" => "海南", "10112000" => "河北", "10113000" => "河南", "10114000" => "黑龙江", "10115000" => "湖北", "10116000" => "湖南", "10117000" => "吉林", "10118000" => "江苏", "10119000" => "江西", "10120000" => "辽宁", "10121000" => "内蒙古", "10122000" => "宁夏", "10123000" => "青海", "10124000" => "山东", "10125000" => "山西", "10126000" => "陕西", "10127000" => "四川", "10128000" => "西藏", "10129000" => "新疆", "10130000" => "云南", "10131000" => "浙江", "10132000" => "澳门", "10133000" => "香港", "10134000" => "台湾", "2" => "国外")), array("hometownProvince" => array("0" => "不限", "10102000" => "北京", "10103000" => "上海", "10101201" => "深圳", "10101002" => "广州", "10101000" => "广东", "10104000" => "天津", "10105000" => "重庆", "10106000" => "安徽", "10107000" => "福建", "10108000" => "甘肃", "10109000" => "广西", "10110000" => "贵州", "10111000" => "海南", "10112000" => "河北", "10113000" => "河南", "10114000" => "黑龙江", "10115000" => "湖北", "10116000" => "湖南", "10117000" => "吉林", "10118000" => "江苏", "10119000" => "江西", "10120000" => "辽宁", "10121000" => "内蒙古", "10122000" => "宁夏", "10123000" => "青海", "10124000" => "山东", "10125000" => "山西", "10126000" => "陕西", "10127000" => "四川", "10128000" => "西藏", "10129000" => "新疆", "10130000" => "云南", "10131000" => "浙江", "10132000" => "澳门", "10133000" => "香港", "10134000" => "台湾", "2" => "国外")), array("city" => array("0" => "不限", "10101201" => "深圳", "10101002" => "广州", "10101003" => "佛山", "10101004" => "湛江", "10101005" => "珠海", "10101006" => "肇庆", "10101007" => "东莞", "10101008" => "惠州", "10101011" => "中山", "10101012" => "茂名", "10101013" => "汕头", "10101014" => "梅州", "10101015" => "韶关", "10101016" => "江门", "10101018" => "清远", "10101020" => "潮州", "10101022" => "阳江", "10101023" => "河源", "10101026" => "揭阳", "10101028" => "汕尾", "10101068" => "云浮", "10105001" => "重庆", "10106001" => "合肥", "10106002" => "淮南", "10106003" => "蚌埠", "10106004" => "宿州", "10106005" => "阜阳", "10106006" => "六安", "10106007" => "巢湖", "10106008" => "滁州", "10106009" => "芜湖", "10106011" => "安庆", "10106012" => "黄山", "10106013" => "铜陵", "10106027" => "贵池", "10106042" => "淮北", "10106030" => "桐城", "10106038" => "明光", "10106075" => "马鞍山", "10106078" => "天长", "10106079" => "池州", "10106080" => "宣城", "10106099" => "亳州", "10107001" => "福州", "10107002" => "厦门", "10107010" => "莆田", "10107003" => "泉州", "10107013" => "宁德", "10107004" => "南平", "10107007" => "漳州", "10107008" => "龙岩", "10107009" => "三明", "10108001" => "兰州", "10108002" => "张掖", "10108003" => "武威", "10108004" => "酒泉", "10108006" => "金昌", "10108022" => "临夏", "10108007" => "天水", "10108008" => "定西", "10108012" => "甘南", "10108009" => "平凉", "10108023" => "嘉峪关", "10108064" => "庆阳", "10108078" => "白银", "10108084" => "陇南", "10109001" => "南宁", "10109002" => "柳州", "10109003" => "钦州", "10109004" => "百色", "10109005" => "玉林", "10109006" => "防城港", "10109007" => "桂林", "10109008" => "梧州", "10109083" => "崇左", "10109009" => "河池", "10109010" => "北海", "10109014" => "贵港", "10109018" => "来宾", "10109089" => "贺州", "10110001" => "贵阳", "10110002" => "六盘水", "10110004" => "凯里", "10110005" => "都匀", "10110006" => "安顺", "10110007" => "遵义", "10110021" => "毕节", "10110026" => "兴义", "10110055" => "铜仁", "10110082" => "黔西南", "10110083" => "黔东南", "10110084" => "黔南", "10111001" => "海口", "10111002" => "三亚", "10111006" => "文昌", "10111007" => "琼海", "10111020" => "儋州", "10111021" => "五指山", "10112001" => "石家庄", "10112002" => "衡水", "10112003" => "邢台", "10112004" => "邯郸", "10112005" => "沧州", "10112006" => "唐山", "10112007" => "廊坊", "10112008" => "秦皇岛", "10112009" => "承德", "10112010" => "保定", "10112011" => "张家口", "10113001" => "郑州", "10113002" => "新乡", "10113003" => "安阳", "10113004" => "许昌", "10113005" => "驻马店", "10113006" => "漯河", "10113007" => "信阳", "10113008" => "周口", "10113009" => "洛阳", "10113099" => "济源", "10113010" => "平顶山", "10113011" => "三门峡", "10113012" => "南阳", "10113013" => "开封", "10113014" => "商丘", "10113015" => "鹤壁", "10113016" => "濮阳", "10113017" => "焦作", "10114001" => "哈尔滨", "10114002" => "绥化", "10114053" => "黑河", "10114003" => "佳木斯", "10114004" => "牡丹江", "10114005" => "齐齐哈尔", "10114007" => "大庆", "10114067" => "七台河", "10114008" => "大兴安岭", "10114009" => "鸡西", "10114042" => "伊春", "10114020" => "鹤岗", "10114024" => "双鸭山", "10115001" => "武汉", "10115002" => "黄石", "10115004" => "鄂州", "10115005" => "襄樊", "10115006" => "咸宁", "10115007" => "十堰", "10115008" => "宜昌", "10115009" => "恩施", "10115010" => "荆州", "10115011" => "黄冈", "10115012" => "荆门", "10115013" => "孝感", "10115016" => "神农架林区", "10115034" => "天门", "10115062" => "随州", "10115066" => "仙桃", "10116001" => "长沙", "10116002" => "株洲", "10116003" => "益阳", "10116004" => "岳阳", "10116005" => "常德", "10116007" => "娄底", "10116008" => "怀化", "10116009" => "衡阳", "10116010" => "邵阳", "10116011" => "郴州", "10116013" => "张家界", "10116014" => "湘潭", "10116075" => "永州", "10116097" => "湘西", "10117001" => "长春", "10117002" => "吉林", "10117003" => "延吉", "10117042" => "长白", "10117004" => "通化", "10117006" => "四平", "10117007" => "白城", "10117008" => "松原", "10117028" => "辽源", "10117049" => "延边", "10118001" => "南京", "10118002" => "苏州", "10118003" => "无锡", "10118004" => "徐州", "10118005" => "常州", "10118006" => "镇江", "10118051" => "泰州", "10118007" => "连云港", "10118008" => "淮安", "10118009" => "盐城", "10118010" => "扬州", "10118011" => "南通", "10118017" => "常熟", "10118063" => "宿迁", "10119001" => "南昌", "10119002" => "九江", "10119003" => "景德镇", "10119004" => "上饶", "10119005" => "鹰潭", "10119006" => "宜春", "10119007" => "萍乡", "10119008" => "赣州", "10119009" => "吉安", "10119010" => "抚州", "10119040" => "新余", "10119042" => "井岗山", "10120001" => "沈阳", "10120002" => "铁岭", "10120003" => "抚顺", "10120004" => "鞍山", "10120005" => "营口", "10120006" => "大连", "10120007" => "本溪", "10120008" => "丹东", "10120009" => "锦州", "10120010" => "朝阳", "10120011" => "阜新", "10120012" => "盘锦", "10120013" => "辽阳", "10120014" => "葫芦岛", "10121001" => "呼和浩特", "10121002" => "集宁", "10121003" => "包头", "10121004" => "临河", "10121005" => "乌海", "10121007" => "海拉尔", "10121008" => "赤峰", "10121009" => "锡林浩特", "10121011" => "通辽", "10121024" => "乌兰浩特", "10121089" => "锡林郭勒盟", "10121090" => "阿拉善盟", "10121091" => "兴安", "10121092" => "鄂尔多斯", "10121093" => "呼伦贝尔", "10121094" => "巴彦淖尔", "10121095" => "乌兰察布", "10122001" => "银川", "10122002" => "石嘴山", "10122003" => "固原", "10122010" => "吴忠", "10122011" => "中卫", "10123001" => "西宁", "10123002" => "果洛", "10123003" => "玉树", "10123004" => "格尔木", "10123005" => "海西", "10123045" => "海东", "10123046" => "海北", "10123047" => "黄南", "10123048" => "海南藏族自治州", "10124001" => "青岛", "10124002" => "威海", "10124003" => "济南", "10124004" => "淄博", "10124005" => "聊城", "10124006" => "德州", "10124007" => "东营", "10124008" => "潍坊", "10124009" => "烟台", "10124011" => "泰安", "10124012" => "菏泽", "10124013" => "临沂", "10124014" => "枣庄", "10124015" => "济宁", "10124016" => "日照", "10124068" => "莱芜", "10124018" => "滨州", "10125001" => "太原", "10125003" => "忻州", "10125005" => "大同", "10125006" => "临汾", "10125008" => "运城", "10125009" => "阳泉", "10125010" => "长治", "10125011" => "晋城", "10125107" => "晋中", "10125108" => "吕梁", "10126001" => "西安", "10126002" => "渭南", "10126003" => "延安", "10126005" => "榆林", "10126006" => "宝鸡", "10126007" => "安康", "10126008" => "汉中", "10126010" => "铜川", "10126011" => "咸阳", "10127001" => "成都", "10127125" => "巴中", "10127002" => "乐山", "10127003" => "凉山", "10127005" => "绵阳", "10127007" => "阿坝", "10127008" => "雅安", "10127009" => "甘孜", "10127010" => "广元", "10127117" => "遂宁", "10127011" => "南充", "10127013" => "内江", "10127014" => "自贡", "10127015" => "宜宾", "10127016" => "泸州", "10127017" => "攀枝花", "10127018" => "德阳", "10127056" => "眉山", "10127070" => "广安", "10127137" => "达州", "10128001" => "拉萨", "10128002" => "那曲", "10128003" => "昌都", "10128004" => "山南", "10128005" => "日喀则", "10128006" => "阿里", "10128007" => "林芝", "10129001" => "乌鲁木齐", "10129002" => "石河子", "10129003" => "乌苏", "10129004" => "克拉玛依", "10129006" => "阿勒泰", "10129007" => "巴音郭楞", "10129008" => "哈密", "10129009" => "吐鲁番", "10129010" => "阿克苏", "10129011" => "喀什", "10129012" => "和田", "10129013" => "图木舒克", "10129014" => "五家渠", "10129081" => "奎屯", "10129086" => "塔城", "10129088" => "克孜勒苏", "10129089" => "博尔塔拉", "10129017" => "昌吉", "10129090" => "伊犁", "10130001" => "昆明", "10130002" => "曲靖", "10130003" => "昭通", "10130005" => "文山", "10130007" => "大理", "10130008" => "楚雄", "10130098" => "红河", "10130009" => "临沧", "10130010" => "保山", "10130011" => "玉溪", "10130030" => "丽江", "10130052" => "普洱", "10130127" => "西双版纳", "10130128" => "德宏", "10130129" => "怒江", "10130130" => "迪庆", "10131001" => "杭州", "10131002" => "温州", "10131003" => "宁波", "10131004" => "绍兴", "10131005" => "湖州", "10131006" => "嘉兴", "10131009" => "金华", "10131010" => "丽水", "10131011" => "衢州", "10131012" => "台州", "10131013" => "义乌", "10131014" => "温岭", "10131015" => "舟山", "10132001" => "澳门", "10133001" => "香港", "10134001" => "台湾", "10500000" => "美国", "10600000" => "加拿大", "10700000" => "日本", "10800000" => "澳大利亚", "10900000" => "英国", "11000000" => "法国", "11100000" => "德国", "11200000" => "俄罗斯", "11300000" => "新西兰", "11400000" => "泰国", "11500000" => "马来西亚", "11600000" => "印度尼西亚", "11700000" => "菲律宾", "11800000" => "新加坡", "11900000" => "韩国", "12000000" => "缅甸", "12100000" => "越南", "12200000" => "柬埔寨", "12300000" => "老挝", "12400000" => "印度", "12500000" => "文莱", "12600000" => "巴基斯坦", "12700000" => "朝鲜", "12800000" => "尼泊尔", "12900000" => "斯里兰卡", "13000000" => "土耳其", "13100000" => "乌克兰", "13200000" => "意大利", "13300000" => "芬兰", "13400000" => "荷兰", "13500000" => "挪威", "13600000" => "葡萄牙", "13700000" => "西班牙", "13800000" => "瑞典", "13900000" => "瑞士", "14000000" => "阿根廷", "14100000" => "巴西", "14200000" => "智利", "14300000" => "墨西哥", "14400000" => "秘鲁", "14500000" => "奥地利", "14600000" => "比利时", "14700000" => "丹麦", "14800000" => "希腊", "14900000" => "匈牙利", "15000000" => "哥伦比亚", "15100000" => "委内瑞拉", "15200000" => "爱尔兰", "15300000" => "保加利亚", "15400000" => "冰岛", "15500000" => "卢森堡", "15600000" => "罗马尼亚", "15700000" => "以色列", "15800000" => "埃及", "15900000" => "南非", "16000000" => "奥克兰", "16100000" => "喀麦隆", "16200000" => "毛里求斯", "16300000" => "马达加斯加", "16400000" => "其它地区")), array("hometownCity" => array("0" => "不限", "10101201" => "深圳", "10101002" => "广州", "10101003" => "佛山", "10101004" => "湛江", "10101005" => "珠海", "10101006" => "肇庆", "10101007" => "东莞", "10101008" => "惠州", "10101011" => "中山", "10101012" => "茂名", "10101013" => "汕头", "10101014" => "梅州", "10101015" => "韶关", "10101016" => "江门", "10101018" => "清远", "10101020" => "潮州", "10101022" => "阳江", "10101023" => "河源", "10101026" => "揭阳", "10101028" => "汕尾", "10101068" => "云浮", "10105001" => "重庆", "10106001" => "合肥", "10106002" => "淮南", "10106003" => "蚌埠", "10106004" => "宿州", "10106005" => "阜阳", "10106006" => "六安", "10106007" => "巢湖", "10106008" => "滁州", "10106009" => "芜湖", "10106011" => "安庆", "10106012" => "黄山", "10106013" => "铜陵", "10106027" => "贵池", "10106042" => "淮北", "10106030" => "桐城", "10106038" => "明光", "10106075" => "马鞍山", "10106078" => "天长", "10106079" => "池州", "10106080" => "宣城", "10106099" => "亳州", "10107001" => "福州", "10107002" => "厦门", "10107010" => "莆田", "10107003" => "泉州", "10107013" => "宁德", "10107004" => "南平", "10107007" => "漳州", "10107008" => "龙岩", "10107009" => "三明", "10108001" => "兰州", "10108002" => "张掖", "10108003" => "武威", "10108004" => "酒泉", "10108006" => "金昌", "10108022" => "临夏", "10108007" => "天水", "10108008" => "定西", "10108012" => "甘南", "10108009" => "平凉", "10108023" => "嘉峪关", "10108064" => "庆阳", "10108078" => "白银", "10108084" => "陇南", "10109001" => "南宁", "10109002" => "柳州", "10109003" => "钦州", "10109004" => "百色", "10109005" => "玉林", "10109006" => "防城港", "10109007" => "桂林", "10109008" => "梧州", "10109083" => "崇左", "10109009" => "河池", "10109010" => "北海", "10109014" => "贵港", "10109018" => "来宾", "10109089" => "贺州", "10110001" => "贵阳", "10110002" => "六盘水", "10110004" => "凯里", "10110005" => "都匀", "10110006" => "安顺", "10110007" => "遵义", "10110021" => "毕节", "10110026" => "兴义", "10110055" => "铜仁", "10110082" => "黔西南", "10110083" => "黔东南", "10110084" => "黔南", "10111001" => "海口", "10111002" => "三亚", "10111006" => "文昌", "10111007" => "琼海", "10111020" => "儋州", "10111021" => "五指山", "10112001" => "石家庄", "10112002" => "衡水", "10112003" => "邢台", "10112004" => "邯郸", "10112005" => "沧州", "10112006" => "唐山", "10112007" => "廊坊", "10112008" => "秦皇岛", "10112009" => "承德", "10112010" => "保定", "10112011" => "张家口", "10113001" => "郑州", "10113002" => "新乡", "10113003" => "安阳", "10113004" => "许昌", "10113005" => "驻马店", "10113006" => "漯河", "10113007" => "信阳", "10113008" => "周口", "10113009" => "洛阳", "10113099" => "济源", "10113010" => "平顶山", "10113011" => "三门峡", "10113012" => "南阳", "10113013" => "开封", "10113014" => "商丘", "10113015" => "鹤壁", "10113016" => "濮阳", "10113017" => "焦作", "10114001" => "哈尔滨", "10114002" => "绥化", "10114053" => "黑河", "10114003" => "佳木斯", "10114004" => "牡丹江", "10114005" => "齐齐哈尔", "10114007" => "大庆", "10114067" => "七台河", "10114008" => "大兴安岭", "10114009" => "鸡西", "10114042" => "伊春", "10114020" => "鹤岗", "10114024" => "双鸭山", "10115001" => "武汉", "10115002" => "黄石", "10115004" => "鄂州", "10115005" => "襄樊", "10115006" => "咸宁", "10115007" => "十堰", "10115008" => "宜昌", "10115009" => "恩施", "10115010" => "荆州", "10115011" => "黄冈", "10115012" => "荆门", "10115013" => "孝感", "10115016" => "神农架林区", "10115034" => "天门", "10115062" => "随州", "10115066" => "仙桃", "10116001" => "长沙", "10116002" => "株洲", "10116003" => "益阳", "10116004" => "岳阳", "10116005" => "常德", "10116007" => "娄底", "10116008" => "怀化", "10116009" => "衡阳", "10116010" => "邵阳", "10116011" => "郴州", "10116013" => "张家界", "10116014" => "湘潭", "10116075" => "永州", "10116097" => "湘西", "10117001" => "长春", "10117002" => "吉林", "10117003" => "延吉", "10117042" => "长白", "10117004" => "通化", "10117006" => "四平", "10117007" => "白城", "10117008" => "松原", "10117028" => "辽源", "10117049" => "延边", "10118001" => "南京", "10118002" => "苏州", "10118003" => "无锡", "10118004" => "徐州", "10118005" => "常州", "10118006" => "镇江", "10118051" => "泰州", "10118007" => "连云港", "10118008" => "淮安", "10118009" => "盐城", "10118010" => "扬州", "10118011" => "南通", "10118017" => "常熟", "10118063" => "宿迁", "10119001" => "南昌", "10119002" => "九江", "10119003" => "景德镇", "10119004" => "上饶", "10119005" => "鹰潭", "10119006" => "宜春", "10119007" => "萍乡", "10119008" => "赣州", "10119009" => "吉安", "10119010" => "抚州", "10119040" => "新余", "10119042" => "井岗山", "10120001" => "沈阳", "10120002" => "铁岭", "10120003" => "抚顺", "10120004" => "鞍山", "10120005" => "营口", "10120006" => "大连", "10120007" => "本溪", "10120008" => "丹东", "10120009" => "锦州", "10120010" => "朝阳", "10120011" => "阜新", "10120012" => "盘锦", "10120013" => "辽阳", "10120014" => "葫芦岛", "10121001" => "呼和浩特", "10121002" => "集宁", "10121003" => "包头", "10121004" => "临河", "10121005" => "乌海", "10121007" => "海拉尔", "10121008" => "赤峰", "10121009" => "锡林浩特", "10121011" => "通辽", "10121024" => "乌兰浩特", "10121089" => "锡林郭勒盟", "10121090" => "阿拉善盟", "10121091" => "兴安", "10121092" => "鄂尔多斯", "10121093" => "呼伦贝尔", "10121094" => "巴彦淖尔", "10121095" => "乌兰察布", "10122001" => "银川", "10122002" => "石嘴山", "10122003" => "固原", "10122010" => "吴忠", "10122011" => "中卫", "10123001" => "西宁", "10123002" => "果洛", "10123003" => "玉树", "10123004" => "格尔木", "10123005" => "海西", "10123045" => "海东", "10123046" => "海北", "10123047" => "黄南", "10123048" => "海南藏族自治州", "10124001" => "青岛", "10124002" => "威海", "10124003" => "济南", "10124004" => "淄博", "10124005" => "聊城", "10124006" => "德州", "10124007" => "东营", "10124008" => "潍坊", "10124009" => "烟台", "10124011" => "泰安", "10124012" => "菏泽", "10124013" => "临沂", "10124014" => "枣庄", "10124015" => "济宁", "10124016" => "日照", "10124068" => "莱芜", "10124018" => "滨州", "10125001" => "太原", "10125003" => "忻州", "10125005" => "大同", "10125006" => "临汾", "10125008" => "运城", "10125009" => "阳泉", "10125010" => "长治", "10125011" => "晋城", "10125107" => "晋中", "10125108" => "吕梁", "10126001" => "西安", "10126002" => "渭南", "10126003" => "延安", "10126005" => "榆林", "10126006" => "宝鸡", "10126007" => "安康", "10126008" => "汉中", "10126010" => "铜川", "10126011" => "咸阳", "10127001" => "成都", "10127125" => "巴中", "10127002" => "乐山", "10127003" => "凉山", "10127005" => "绵阳", "10127007" => "阿坝", "10127008" => "雅安", "10127009" => "甘孜", "10127010" => "广元", "10127117" => "遂宁", "10127011" => "南充", "10127013" => "内江", "10127014" => "自贡", "10127015" => "宜宾", "10127016" => "泸州", "10127017" => "攀枝花", "10127018" => "德阳", "10127056" => "眉山", "10127070" => "广安", "10127137" => "达州", "10128001" => "拉萨", "10128002" => "那曲", "10128003" => "昌都", "10128004" => "山南", "10128005" => "日喀则", "10128006" => "阿里", "10128007" => "林芝", "10129001" => "乌鲁木齐", "10129002" => "石河子", "10129003" => "乌苏", "10129004" => "克拉玛依", "10129006" => "阿勒泰", "10129007" => "巴音郭楞", "10129008" => "哈密", "10129009" => "吐鲁番", "10129010" => "阿克苏", "10129011" => "喀什", "10129012" => "和田", "10129013" => "图木舒克", "10129014" => "五家渠", "10129081" => "奎屯", "10129086" => "塔城", "10129088" => "克孜勒苏", "10129089" => "博尔塔拉", "10129017" => "昌吉", "10129090" => "伊犁", "10130001" => "昆明", "10130002" => "曲靖", "10130003" => "昭通", "10130005" => "文山", "10130007" => "大理", "10130008" => "楚雄", "10130098" => "红河", "10130009" => "临沧", "10130010" => "保山", "10130011" => "玉溪", "10130030" => "丽江", "10130052" => "普洱", "10130127" => "西双版纳", "10130128" => "德宏", "10130129" => "怒江", "10130130" => "迪庆", "10131001" => "杭州", "10131002" => "温州", "10131003" => "宁波", "10131004" => "绍兴", "10131005" => "湖州", "10131006" => "嘉兴", "10131009" => "金华", "10131010" => "丽水", "10131011" => "衢州", "10131012" => "台州", "10131013" => "义乌", "10131014" => "温岭", "10131015" => "舟山", "10132001" => "澳门", "10133001" => "香港", "10134001" => "台湾", "10500000" => "美国", "10600000" => "加拿大", "10700000" => "日本", "10800000" => "澳大利亚", "10900000" => "英国", "11000000" => "法国", "11100000" => "德国", "11200000" => "俄罗斯", "11300000" => "新西兰", "11400000" => "泰国", "11500000" => "马来西亚", "11600000" => "印度尼西亚", "11700000" => "菲律宾", "11800000" => "新加坡", "11900000" => "韩国", "12000000" => "缅甸", "12100000" => "越南", "12200000" => "柬埔寨", "12300000" => "老挝", "12400000" => "印度", "12500000" => "文莱", "12600000" => "巴基斯坦", "12700000" => "朝鲜", "12800000" => "尼泊尔", "12900000" => "斯里兰卡", "13000000" => "土耳其", "13100000" => "乌克兰", "13200000" => "意大利", "13300000" => "芬兰", "13400000" => "荷兰", "13500000" => "挪威", "13600000" => "葡萄牙", "13700000" => "西班牙", "13800000" => "瑞典", "13900000" => "瑞士", "14000000" => "阿根廷", "14100000" => "巴西", "14200000" => "智利", "14300000" => "墨西哥", "14400000" => "秘鲁", "14500000" => "奥地利", "14600000" => "比利时", "14700000" => "丹麦", "14800000" => "希腊", "14900000" => "匈牙利", "15000000" => "哥伦比亚", "15100000" => "委内瑞拉", "15200000" => "爱尔兰", "15300000" => "保加利亚", "15400000" => "冰岛", "15500000" => "卢森堡", "15600000" => "罗马尼亚", "15700000" => "以色列", "15800000" => "埃及", "15900000" => "南非", "16000000" => "奥克兰", "16100000" => "喀麦隆", "16200000" => "毛里求斯", "16300000" => "马达加斯加", "16400000" => "其它地区")), array("corptype" => array("0" => "不限", "1" => "政府机关", "2" => "事业单位", "3" => "世界500强", "4" => "外资企业", "5" => "上市公司", "6" => "国营企业", "7" => "私营企业", "8" => "自有公司")), array("is_lock" => array("0" => "是", "1" => "否")), array("usertype" => array("1" => "本站", "2" => "外站", "3" => "全权", "4" => "内部")), array("s_cid" => array("10" => "铂金", "20" => "钻石", "30" => "高级", "40" => "普通")), array("gender" => array("0" => "男", "1" => "女")), array("occupation" => array("0" => "请选择", "1" => "金融业", "2" => "计算机业", "3" => "商业", "4" => "服务行业", "5" => "教育业", "6" => "工程师", "7" => "主管,经理", "8" => "政" + "府部门", "9" => "制造业", "10" => "销售/广告/市场", "11" => "资讯业", "12" => "自由业", "13" => "农渔牧", "14" => "医生", "15" => "律师", "16" => "教师", "17" => "幼师", "18" => "会计师", "19" => "设计师", "20" => "空姐", "21" => "护士", "22" => "记者", "23" => "学者", "24" => "公务员", "26" => "职业经理人", "27" => "秘书", "28" => "音乐家", "29" => "画家", "30" => "咨询师", "31" => "审计师", "32" => "注册会计师", "33" => "军人", "34" => "警察", "35" => "学生", "36" => "待业中", "37" => "消防员", "38" => "经纪人", "39" => "模特", "40" => "教授", "41" => "IT工程师", "42" => "摄影师", "43" => "企业高管", "44" => "作家", "99" => "其他行业")), array("nation" => array("0" => "不限", "1" => "汉族", "2" => "藏族", "3" => "朝鲜族", "4" => "蒙古族", "5" => "回族", "6" => "满族", "7" => "维吾尔族", "8" => "壮族", "9" => "彝族", "10" => "苗族", "11" => "侗族", "12" => "瑶族", "13" => "白族", "14" => "布依族", "15" => "傣族", "16" => "京族", "17" => "黎族", "18" => "羌族", "19" => "怒族", "20" => "佤族", "21" => "水族", "22" => "畲族", "23" => "土族", "24" => "阿昌族", "25" => "哈尼族", "26" => "高山族", "27" => "景颇族", "28" => "珞巴族", "29" => "锡伯族", "30" => "德昂(崩龙)族", "31" => "保安族", "32" => "基诺族", "33" => "门巴族", "34" => "毛南族", "35" => "赫哲族", "36" => "裕固族", "37" => "撒拉族", "38" => "独龙族", "39" => "普米族", "40" => "仫佬族", "41" => "仡佬族", "42" => "东乡族", "43" => "拉祜族", "44" => "土家族", "45" => "纳西族", "46" => "傈僳族", "47" => "布朗族", "48" => "哈萨克族", "49" => "达斡尔族", "50" => "鄂伦春族", "51" => "鄂温克族", "52" => "俄罗斯族", "53" => "塔塔尔族", "54" => "塔吉克族", "55" => "柯尔克孜族", "56" => "乌兹别克族", "57" => "国外")), array("smoking" => array("-1,不限", "0,都可以", "1,在意")), array("drinking" => array("0" => "请选择", "1" => "不喝酒", "2" => "稍微喝一点/社交场合喝", "3" => "喝的很凶", "5" => "保密")), array("body" => array("0" => "请选择", "1" => "一般", "2" => "瘦长", "3" => "运动员型", "4" => "比较胖", "5" => "体格魁梧", "6" => "苗条", "7" => "高大美丽", "8" => "丰满", "9" => "富线条美", "10" => "矮壮结实", "11" => "皮肤白皙", "12" => "长发飘飘", "13" => "时尚卷发", "14" => "干练短发", "15" => "黝黑健康", "16" => "眉清目秀", "17" => "浓眉大眼", "0" => "保密"))); $sql = 'select nickname,username,truename,telphone,marriage,height,salary,education,children,house,province,city,corptype,is_lock,city_star,usertype,s_cid,bgtime,endtime,gender,birthyear,password,occupation,nation,hometownProvince,hometownCity,smoking,drinking,body,weight,family from `' . $GLOBALS['dbTablePre'] . 'members_search` where `uid`=' . $uid; $userInfo = $GLOBALS['_MooClass']['MooMySQL']->getOne($sql, true); $update1_arr = $update2_arr = $update3_arr = array(); //note members表字段 if (isset($_POST['nickname'])) { $update1_arr['nickname'] = MooGetGPC('nickname', 'string', 'P'); } if (isset($_POST['username'])) { $update1_arr['username'] = MooGetGPC('username', 'string', 'P'); } if (isset($_POST['truename'])) { $update1_arr['truename'] = MooGetGPC('truename', 'string', 'P'); } if (isset($_POST['telphone'])) { $update1_arr['telphone'] = MooGetGPC('telphone', 'string', 'P'); } if (isset($_POST['marriage1'])) { $update1_arr['marriage'] = MooGetGPC('marriage1', 'integer', 'P'); } if (isset($_POST['height'])) { $update1_arr['height'] = MooGetGPC('height', 'integer', 'P'); } if (isset($_POST['salary'])) { $update1_arr['salary'] = MooGetGPC('salary', 'integer', 'P'); } if (isset($_POST['education1'])) { $update1_arr['education'] = MooGetGPC('education1', 'integer', 'P'); } if (isset($_POST['children1'])) { $update1_arr['children'] = MooGetGPC('children1', 'integer', 'P'); } if (isset($_POST['house'])) { $update1_arr['house'] = MooGetGPC('house', 'integer', 'P'); } if (isset($_POST['workprovince'])) { $update1_arr['province'] = MooGetGPC('workprovince', 'integer', 'P'); } if (isset($_POST['workCity'])) { $update1_arr['city'] = MooGetGPC('workCity', 'integer', 'P'); } if (isset($_POST['corptype'])) { $update1_arr['corptype'] = MooGetGPC('corptype', 'integer', 'P'); } if (isset($_POST['family'])) { $update1_arr['family'] = MooGetGPC('family', 'integer', 'P'); } //$update1_arr['sid'] = MooGetGPC('sid','integer'); if (isset($_POST['is_lock'])) { $update1_arr['is_lock'] = MooGetGPC('is_lock', 'integer', 'P'); } $update1_arr['city_star'] = MooGetGPC('city_star', 'integer', 'P'); if (!empty($update1_arr['city_star'])) { $city_star = $GLOBALS['_MooClass']['MooMySQL']->getOne('select `city_star` from `' . $GLOBALS['dbTablePre'] . 'members_search` where `uid`=' . $uid, true); $now_t = time(); if ($city_star['city_star'] < $now_t) { $update1_arr['city_star'] = 3600 * 24 * 31 + $now_t; } } if (isset($_POST['usertype'])) { $update1_arr['usertype'] = MooGetGPC('usertype', 'integer', 'P'); if ($update1_arr['usertype'] == 5) { $update1_arr['sid'] = 600; } //内部会员直接 设定 客服60号 } if (isset($_POST['s_cid'])) { $update1_arr['s_cid'] = MooGetGPC('s_cid', 'integer', 'P'); } if (isset($_POST['bgtime']) && !empty($_POST['bgtime'])) { $update1_arr['bgtime'] = strtotime(MooGetGPC('bgtime', 'string', 'P')); } if (isset($_POST['endtime']) && !empty($_POST['endtime'])) { $update1_arr['endtime'] = strtotime(MooGetGPC('endtime', 'string', 'P')); } if (isset($_POST['gender'])) { $update1_arr['gender'] = MooGetGPC('gender', 'integer', 'P'); } if (isset($_POST['presex'])) { $presex = MooGetGPC('presex', 'integer', 'P'); } //if(isset($_POST['year']))$update1_arr['birthyear'] = MooGetGPC('year','integer','P'); //if(isset($_POST['month']))$update1_arr['birthmonth'] = MooGetGPC('month','integer','P'); //if(isset($_POST['day']))$update1_arr['birthday'] = MooGetGPC('day','integer','P'); $password = trim(MooGetGPC('password', 'string', 'P')); if ($password) { $update1_arr['password'] = md5($password); } //$update1_arr['introduce'] = MoogetGPC('introduce','string','P'); //note memberfield表字段 if (isset($_POST['occupation2'])) { $update1_arr['occupation'] = MooGetGPC('occupation2', 'integer', 'P'); } if (isset($_POST['stock2'])) { $update1_arr['nation'] = MooGetGPC('stock2', 'integer', 'P'); } if (isset($_POST['hometownProvince'])) { $update1_arr['hometownProvince'] = MooGetGPC('hometownProvince', 'integer', 'P'); } if (isset($_POST['hometownCity'])) { $update1_arr['hometownCity'] = MooGetGPC('hometownCity', 'integer', 'P'); } //$update2_arr['wantchildren'] = MooGetGPC('wantchildren2','integer','P'); if (isset($_POST['issmoking'])) { $update1_arr['smoking'] = MooGetGPC('issmoking', 'integer', 'P'); } if (isset($_POST['isdrinking'])) { $update1_arr['drinking'] = MooGetGPC('isdrinking', 'integer', 'P'); } if (isset($_POST['body'])) { $update1_arr['body'] = MooGetGPC('body', 'integer', 'P'); } if (isset($_POST['weight'])) { $update1_arr['weight'] = MooGetGPC('weight', 'integer', 'P'); } $userBase = $GLOBALS['_MooClass']['MooMySQL']->getOne('select nature,qq,msn,birth,oldsex from `' . $GLOBALS['dbTablePre'] . 'members_base` where `uid`=' . $uid, true); if (isset($_POST['nature3'])) { $update2_arr['nature'] = MooGetGPC('nature3', 'integer', 'P'); } if (isset($_POST['qq'])) { $update2_arr['qq'] = MooGetGPC('qq', 'string', 'P'); } if (isset($_POST['msn'])) { $update2_arr['msn'] = MooGetGPC('msn', 'string', 'P'); } if (isset($_POST['oldsex'])) { $update2_arr['oldsex'] = MooGetGPC('oldsex', 'integer', 'P'); } if (isset($_POST['year']) || isset($_POST['month']) || isset($_POST['day'])) { //birth modify $year = isset($_POST['year']) && $_POST['year'] ? $_POST['year'] : 0; $month = isset($_POST['month']) && $_POST['month'] ? $_POST['month'] : 0; $day = isset($_POST['day']) && $_POST['day'] ? $_POST['day'] : 0; if (!$year) { $time = 0; } elseif (!$month) { $time = $year . '-01-01'; } elseif (!$day) { $time = $year . '-' . $month . '-01'; } else { $time = $year . '-' . $month . '-' . $day; } $update2_arr['birth'] = date('Y-m-d', strtotime($time)); } $sql = 'select age1,age2,height1,height2,weight1,weight2,salary,workprovince,workcity,hometownprovince,hometowncity,smoking,education,children,wantchildren,nature from `' . $GLOBALS['dbTablePre'] . 'members_choice` where `uid`=' . $uid; $userChoice = $GLOBALS['_MooClass']['MooMySQL']->getOne($sql, true); //note choice表字段 if (isset($_POST['spouse_age1'])) { $update3_arr['age1'] = MooGetGPC('spouse_age1', 'integer', 'P'); } if (isset($_POST['spouse_age2'])) { $update3_arr['age2'] = MooGetGPC('spouse_age2', 'integer', 'P'); } if (isset($_POST['spouse_minheight'])) { $update3_arr['height1'] = MooGetGPC('spouse_minheight', 'integer', 'P'); } if (isset($_POST['spouse_maxheight'])) { $update3_arr['height2'] = MooGetGPC('spouse_maxheight', 'integer', 'P'); } if (isset($_POST['spouse_minweight'])) { $update3_arr['weight1'] = MooGetGPC('spouse_minweight', 'integer', 'P'); } if (isset($_POST['spouse_maxweight'])) { $update3_arr['weight2'] = MooGetGPC('spouse_maxweight', 'integer', 'P'); } if (isset($_POST['spouse_salary'])) { $update3_arr['salary'] = MooGetGPC('spouse_salary', 'integer', 'P'); } if (isset($_POST['spouse_workprovince'])) { $update3_arr['workprovince'] = MooGetGPC('spouse_workprovince', 'integer', 'P'); } if (isset($_POST['spouse_workCity'])) { $update3_arr['workCity'] = MooGetGPC('spouse_workCity', 'integer', 'P'); } if (isset($_POST['spouse_smoking'])) { $update3_arr['smoking'] = MooGetGPC('spouse_smoking', 'integer', 'P'); } if (isset($_POST['spouse_hometownprovince'])) { $update3_arr['hometownprovince'] = MooGetGPC('spouse_hometownprovince', 'integer', 'P'); } if (isset($_POST['spouse_hometowncity'])) { $update3_arr['hometowncity'] = MooGetGPC('spouse_hometowncity', 'integer', 'P'); } if (isset($_POST['spouse_education'])) { $update3_arr['education'] = MooGetGPC('spouse_education', 'integer', 'P'); } if (isset($_POST['spouse_children'])) { $update3_arr['children'] = MooGetGPC('spouse_children', 'integer', 'P'); } if (isset($_POST['spouse_wantchildren'])) { $update3_arr['wantchildren'] = MooGetGPC('spouse_wantchildren', 'integer', 'P'); } if (isset($_POST['spouse_character'])) { $update3_arr['nature'] = MooGetGPC('spouse_character', 'integer', 'P'); } $where_arr = array('uid' => $uid); $modifyinfo = ''; //initialize modify information $comma = ","; $update1arr = array(); foreach ($update1_arr as $key => $val) { foreach ($search1 as $k => $v) { //修改的字段名 if ($k == $key) { $column = $v; } } $update1arr[$key] = $val; if ($userInfo[$key] != $val) { //修改了值 foreach ($search2 as $v1) { //循环数组 foreach ($v1 as $k2 => $v2) { if ($k2 == $key) { //如果出现在$search2数组中的 foreach ($v2 as $k3 => $v3) { if ($userInfo[$key] == $k3) { //对应修改的字段原先的值 $xx = $v3; } if ($val == $k3) { //对应修改的字段现在的值 $val = $v3; } } break; } elseif ($k2 != $key && in_array($key, array("username", "nickname", "height", "truename", "telphone", "weight", "family"))) { //如果不出现在$search2数组中的,直接显示的,比如姓名,电话,体重 $xx = $userInfo[$key]; } } } $modifyinfo .= $column . "原:" . $xx . "|现:" . $val; $modifyinfo .= $comma; } } foreach ($update2_arr as $key => $val) { $update2arr[$key] = $val; if (!empty($val) && $userBase[$key] != $val) { $modifyinfo .= $key . "原:" . $userBase[$key] . "|现:" . $val; $modifyinfo .= $comma; } } foreach ($update3_arr as $key => $val) { $update3arr[$key] = $val; if (!empty($val) && $userChoice[$key] != $val) { //echo $val.'and'.$key.'and'.$userChoice[$key];exit; $modifyinfo .= "配偶" . $key . "原:" . $userChoice[$key] . "|现:" . $val; $modifyinfo .= $comma; } } if (!isset($modifyinfo)) { echo "<script>alert('未修改任何信息');location.href='index.php?action=allmember&h=edit_info&uid={$uid}';</script>"; exit; } $now = time(); $update1arr['updatetime'] = $now; if (count($update1arr) >= 1) { updatetable('members_search', $update1arr, $where_arr); if (MOOPHP_ALLOW_FASTDB) { $fastdb->set('members_searchuid' . $uid, null); MooFastdbUpdate('members_search', 'uid', $uid, $update1arr); } if ($update1arr['s_cid'] == 20) { $sql = "REPLACE INTO {$GLOBALS['dbTablePre']}diamond (uid ,username ,skin ,status, nickname, gender, birthyear,bgtime,endtime)\n\t\t\t\t\t\t\tVALUES ( '{$uid}', '{$update1arr['username']}', '" . ($update1arr['gender'] == 0 ? 'cyan' : 'red') . "', '1', '{$update1arr['nickname']}','{$update1arr['gender']}','{$update1arr['birthyear']}','{$update1arr['bgtime']}','{$update1arr['endtime']}')"; if (!$GLOBALS['_MooClass']['MooMySQL']->query($sql)) { echo "操作失败!无法添加钻石会员数据.请联系管理员..."; exit; } } } if (count($update2arr) >= 1) { updatetable('members_base', $update2arr, $where_arr); if ($update2arr['birth']) { $yourage = date('Y', strtotime($update2arr['birth'])); $sql = "update web_members_search set birthyear=" . $yourage . " where uid={$uid}"; $GLOBALS['_MooClass']['MooMySQL']->query($sql); if (MOOPHP_ALLOW_FASTDB) { MooFastdbUpdate('members_search', 'uid', $uid, array("birthyear" => $yourage)); } } if (MOOPHP_ALLOW_FASTDB) { MooFastdbUpdate('members_base', 'uid', $uid, $update2arr); } } if (count($update3arr) >= 1) { updatetable('members_choice', $update3arr, $where_arr); if (MOOPHP_ALLOW_FASTDB) { // $fastdb->set('members_choiceuid'.$uid,null); MooFastdbUpdate('members_choice', 'uid', $uid, $update3arr); } } if (!empty($password)) { $userinfo = $GLOBALS['_MooClass']['MooMySQL']->getOne("SELECT username FROM {$GLOBALS['dbTablePre']}members_search WHERE uid='{$uid}'", true); $content = "尊敬的用户:您在真爱一生网的密码现在改为" . $password; MooSendMail($userinfo['username'], "修改密码", $content, '../public/system/mailtamp/template.html', $is_template = true, $uid); insert_admin_log($uid, "{$GLOBALS['username']}客服成功修改{$uid}会员密码为{$password}"); //fangin暂时屏蔽 //暂时不改 if ($userinfo['telphone']) { if (SendMsg($userinfo['telphone'], $content)) { $GLOBALS['_MooClass']['MooMySQL']->query("INSERT INTO {$GLOBALS['dbTablePre']}smslog(sid,uid,content,sendtime) VALUES('{$GLOBALS['adminid']}','{$uid}','{$content}','{$GLOBALS['timestamp']}')"); } } } if (!isset($tag)) { $tag = ''; } //添加操作日志 //serverlog(4,$GLOBALS['dbTablePre']."members_search和member_base","{$GLOBALS['username']}修改用户{$uid}资料",$GLOBALS['adminid'],$uid); serverlog(4, $GLOBALS['dbTablePre'] . "members_search和member_base", $modifyinfo, $GLOBALS['adminid'], $uid); echo "<script>alert('修改成功{$tag}');location.href='index.php?action=allmember&h=edit_info&uid={$uid}';</script>"; exit; //salert("修改成功{$tag}");exit; } $uid = MooGetGPC('uid', 'integer', 'G'); $userinfo = $GLOBALS['_MooClass']['MooMySQL']->getOne("SELECT * FROM {$GLOBALS['dbTablePre']}members_search WHERE uid='{$uid}'", true); $userfield = $GLOBALS['_MooClass']['MooMySQL']->getOne("SELECT * FROM {$GLOBALS['dbTablePre']}members_base WHERE uid='{$uid}'", true); $spouseinfo = $GLOBALS['_MooClass']['MooMySQL']->getOne("SELECT * FROM {$GLOBALS['dbTablePre']}members_choice WHERE uid='{$uid}'", true); $userinfo = $userfield = $userinfo + $userfield; if (in_array($GLOBALS['groupid'], $GLOBALS['admin_service_arr']) || in_array($GLOBALS['groupid'], $GLOBALS['admin_service_after']) || in_array($GLOBALS['groupid'], $GLOBALS['admin_service_team']) || in_array($GLOBALS['groupid'], $GLOBALS['admin_complaints']) || in_array($GLOBALS['groupid'], $GLOBALS['admin_all_group']) && $userinfo['usertype'] == 3 || in_array($GLOBALS['groupid'], $GLOBALS['admin_resource_manager']) || in_array($GLOBALS['groupid'], $GLOBALS['admin_service_manager']) || in_array($GLOBALS['groupid'], $GLOBALS['general_service']) && $userinfo['usertype'] == 3) { $is_admin = 0; //管理人员可以修改特殊字段 } else { $is_admin = 1; } require adminTemplate("allmember_edit_info"); }
function advance_search($gender, $age_begin, $age_end, $work_province, $work_city, $marriage, $salary, $education, $height1, $height2, $weight1, $weight2, $body, $smoking, $drinking, $occupation, $house, $vehicle, $corptype, $children, $wantchildren, $home_townprovince, $home_towncity, $nation, $body, $animalyear, $constellation, $bloodtype, $religion, $family, $language, $photo, $email, $searchsign) { global $_MooClass, $dbTablePre; global $user_arr; // 包含配置文件 require_once "crontab_config.php"; //note 获得当前的url 去除多余的参数page= $currenturl = 'http://' . $_SERVER['SERVER_NAME'] . ':' . $_SERVER["SERVER_PORT"] . $_SERVER["REQUEST_URI"]; $currenturl2 = preg_replace("/(&page=\\d+)/", "", $currenturl); $condition_str = ""; /* 以下分页参数设置 */ $pagesize = 16; //note limit查询开始位置 $start = 0; $index = 'members_man'; //索引 sphinx $filter = array(); //过滤条件 sphinx if ($gender == 1) { $condition_str .= "女性"; $index = 'members_women'; } elseif ($gender == 0) { $condition_str .= "男性"; } //note 查询是否显示照片 if ($photo == '1') { $condition_str .= " 必须要照片"; //$photo_sql = " AND `pic_name` != ''"; $filter[] = array('images_ischeck', 1); } //note 转换成实际的年份 if ($age_end) { $age_begin1 = gmdate('Y', time()) - intval($age_end); } if ($age_begin) { $age_end1 = gmdate('Y', time()) - intval($age_begin); } //note 年龄条件查询sql语句 //$age_sql = ''; if ($age_begin1 && $age_end1) { //$age_sql = ' AND (s.birthyear >= '.$age_begin1.' AND s.birthyear <= '.$age_end1.')'; $filter[] = array('birthyear', array($age_begin1, $age_end1)); $condition_str .= " 年龄" . $age_begin . "到" . $age_end . "岁"; } else { if ($age_begin1 && empty($age_end1)) { //$age_sql = ' AND s.birthyear >= '.$age_begin; $filter[] = array('birthyear', array($age_begin, $age_begin + 99)); $condition_str .= " 年龄大于等于" . $age_begin . "岁"; } else { if ($age_end1 && empty($age_begin1)) { //$age_sql = ' AND s.birthyear <= '.$age_end; $filter[] = array('birthyear', array($age_end1 - 99, $age_end1)); $condition_str .= " 年龄小于等于" . $age_end . "岁"; } } } //note 地区条件查询sql语句 /* $area_sql = ''; $area_sql = ' AND s.province = '.$work_province.' AND s.city = '.$work_city; if($work_city == '-1' && $work_province != '-1') $area_sql = ' AND province = '.$work_province; if($work_province == '-1' && $work_city == '-1') $area_sql = ''; if($work_province=="-1"){ $area_sql = ''; } */ if ($work_province != '-1' && $work_province != 0) { $condition_str .= " 所在地区:" . $provice_list[$work_province]; if ($work_province == '-2') { $work_province = 2; } $filter[] = array('province', $work_province); if ($work_city != '-1' && $work_city != 0) { $filter[] = array('city', $work_city); $condition_str .= " " . $city_list[$work_city]; } } //note 婚姻状况条件查询sql语句 if ($marriage != 0 && $marriage != '-1' && is_array($marriage)) { $marr_str = " 婚烟状况:"; //$marriage_sql =" and s.marriage in("; $marr_sql = array(); foreach ($marriage as $v) { $marr_str .= $marriage_list[$v] . " "; $marr_sql[] = $v; } /* if($marr_sql){ $marr_sql=join(",",$marr_sql); }*/ $filter[] = array('marriage', implode(' | ', $marr_sql)); //$marriage_sql.=$marr_sql.")"; $condition_str .= $marr_str; } //note 月收入条件查询sql语句 if ($salary != 0 && $salary != '-1' && is_array($salary)) { $salary_str = " 月收入:"; //$salary_sql = " and s.salary in("; $sal_sql = array(); foreach ($salary as $v) { $salary_str .= $salary_list[$v]; $sal_sql[] = $v; } /*if($sal_sql){ $sal_sql=join(",",$sal_sql); } $salary_sql.=$sal_sql.")";*/ $filter[] = array('salary', implode(' | ', $sal_sql)); $condition_str .= $salary_str; } //if($salary == '-1') $salary_sql = ''; //$condition_str .= $salary_str; //note 教育程度条件查询sql语句 if ($education != '0' && $education != '-1' && is_array($education)) { $education_str = " 教育程度:"; //$education_sql = " and s.education in("; $e_sql = array(); foreach ($education as $v) { $education_str .= $education_list[$v]; $e_sql[] = $v; } /*if($e_sql){ $e_sql=join(",",$e_sql); } $education_sql.=$e_sql.")";*/ $filter[] = array('education', implode(' | ', $e_sql)); $condition_str .= $education_str; } //if($education == '-1') $education_sql = ''; //note 身高条件查询sql语句 //$height_sql = ''; $height1 = $height1 != 0 && $height1 != '-1' ? $height1 : 0; $height2 = $height2 != 0 && $height2 != '-1' ? $height2 : 0; if ($height1 || $height1) { if ($height1 && $height2 && $height2 > $height1) { //$height_sql = ' AND (s.height >= '.$height1.' AND s.height <= '.$height2.')'; $filter[] = array('height', array($height1, $height2)); $condition_str .= " 身高" . $height1 . "cm到" . $height2 . "cm"; } else { if ($height1 && $height2 && $height2 < $height1) { //$height_sql = ' AND (s.height <= '.$height1.' AND s.height >= '.$height2.')'; $filter[] = array('height', array($height2, $height1)); $condition_str .= " 身高" . $height2 . "cm到" . $height1 . "cm"; } else { if ($height1 && !$height2) { //$height_sql = ' AND s.height >= '.$height1; $filter[] = array('height', array($height1, $height1 + 200)); $condition_str .= " 身高大于等于" . $height1 . "cm"; } else { if ($height2 && !$height1) { //$height_sql = ' AND s.height <='.$height2; $filter[] = array('height', array(0, $height2)); $condition_str .= " 身高小于等于" . $height2 . "cm"; } else { if ($height1 && $height2 && $height1 == $height2) { //$height_sql = ' AND s.height ='.$height1; $filter[] = array('height', $height1); $condition_str .= " 身高等于" . $height1 . "cm"; } } } } } } /*else if($height2 =='-1' && $height1 == '-1') { $height_sql = ''; } */ //note 体重条件查询sql语句 //$weight_sql = ''; $weight1 = $weight1 != 0 && $weight1 != '-1' ? $weight1 : 0; $weight2 = $weight2 != 0 && $weight2 != '-1' ? $weight2 : 0; if ($weight1 && $weight2) { if ($weight1 && $weight2 && $weight2 > $weight1) { //$weight_sql = ' AND (sf.weight >= '.$weight1.' AND sf.weight <= '.$weight2.')'; $filter[] = array('weight', array($weight1, $weight2)); $condition_str .= " 体重" . $weight1 . "kg到" . $weight2 . "kg"; } else { if ($weight1 && $weight2 && $weight2 < $weight1) { //$weight_sql = ' AND (sf.weight <= '.$weight1.' AND sf.weight >= '.$weight2.')'; $filter[] = array('weight', array($weight2, $weight1)); $condition_str .= " 体重" . $weight2 . "kg到" . $weight1 . "kg"; } else { if ($weight1 && !$weight2) { //$weight_sql = ' AND sf.weight >= '.$weight1; $filter[] = array('weight', array($weight1, $weight1 + 80)); $condition_str .= " 体重大于等于" . $weight1 . "kg"; } else { if ($weight2 && !$weight1) { //$weight_sql = ' AND sf.weight <='.$weight2; $filter[] = array('weight', array(0, $weight2)); $condition_str .= " 体重小于等于" . $weight2 . "kg"; } else { if ($weight1 && $weight2 && $weight1 == $weight2) { //$weight_sql = ' AND sf.weight ='.$weight1; $filter[] = array('weight', $weight1); $condition_str .= " 体重等于" . $weight1 . "kg"; } } } } } } /*else if($weight2 =='-1' && $weight1 == '-1') { $weight_sql = ''; }*/ //note 是否抽烟查询sql语句 if ($smoking != 0 && $smoking != '-1' && $smoking != '-2' && is_array($smoking)) { $smoking_str = " 抽烟要求:"; //$smoking_sql = " and sf.smoking in("; $smok_sql = array(); foreach ($smoking as $v) { $smoking_str .= $smoking_list[$v]; $smok_sql[] = $v; } /*if($smok_sql){ $smok_sql=join(",",$smok_sql); } $smoking_sql.= $smok_sql.")";*/ $filter[] = array('smoking', implode(' | ', $smok_sql)); $condition_str .= $smoking_str; } //if($smoking == '-1' || $smoking == '-2') $smoking_sql = ''; //note 是否喝酒查询sql语句 if ($drinking != 0 && $drinking != '-1' && $drinking != '-2' && is_array($drinking)) { $drinking_str = " 喝酒要求:"; //$drinking_sql = " and sf.drinking in("; $drink_sql = array(); foreach ($drinking as $v) { $drinking_str .= $drinking_list[$v] . " "; $drink_sql[] = $v; } $filter[] = array('drinking', implode(' | ', $drink_sql)); /* if($drink_sql){ $drink_sql=join(",",$drink_sql); } $drinking_sql.=$drink_sql.")";*/ $condition_str .= $drinking_str; } // //if($drinking == '-1' || $drinking == '-2') $drinking_sql = ''; //note 从事职业查询sql语句 if ($occupation != 0 && $occupation != '-1' && $occupation != '-2' && is_array($occupation)) { $occupation_str = " 从事行业要求:"; //$occupation_sql = " and sf.occupation in( "; $oc_sql = array(); foreach ($occupation as $v) { $occupation_str .= $drinking_list[$v] . " "; $oc_sql[] = $v; } /*if($oc_sql){ $oc_sql=join(",",$oc_sql); } $occupation_sql.=$oc_sql.")"; */ $filter[] = array('occupation', implode(' | ', $oc_sql)); $condition_str .= $occupation_str; } //if($occupation == '-1' || $occupation == '-2') $occupation_sql= ''; //note 住房情况查询sql语句 if ($house != 0 && $house != '-1' && $house != '-2' && is_array($house)) { $house_str = " 住房情况:"; //$house_sql = " and s.house in( "; $ho_sql = array(); foreach ($house as $v) { $house_str .= $house_list[$v] . " "; $ho_sql[] = $v; } /*if($ho_sql){ $ho_sql=join(",",$ho_sql); } $house_sql.=$ho_sql.")";*/ $filter[] = array('house', implode(' | ', $ho_sql)); $condition_str .= $house_str; } // if($house == '-1' || $house == '-2') $house_sql = ''; //note 购车查询sql语句 if ($vehicle != 0 && $vehicle != '-1' && $vehicle != '-2' && is_array($vehicle)) { $vehicle_str = " 购车情况:"; //$vehicle_sql =" and sf.vehicle in("; $ve_sql = array(); foreach ($vehicle as $v) { $vehicle_str .= $vehicle_list[$v] . " "; $ve_sql[] = $v; } /*if($ve_sql){ $ve_sql=join(",",$ve_sql); } $vehicle_sql.=$ve_sql.")";*/ $filter[] = array('vehicle', implode(' | ', $ve_sql)); $condition_str .= $vehicle_str; } //if($vehicle == '-1' || $vehicle == '-2') $vehicle_sql = ''; //note 公司类别sql语句 if ($corptype != 0 && $corptype != '-1' && $corptype != '-2' && is_array($corptype)) { $corptype_str = " 公司类别:"; //$corptype_sql = " and sf.corptype in("; $co_sql = array(); foreach ($corptype as $v) { $corptype_str .= $corptype_list[$v] . " "; $co_sql[] = $v; } /*if($co_sql){ $co_sql=join(",",$co_sql); } $corptype_sql.=$co_sql." )";*/ $filter[] = array('corptype', implode(' | ', $co_sql)); $condition_str .= $corptype_str; } //if($corptype == '-1' || $corptype == '-2') $corptype_sql = ''; //note 是否有孩子sql语句 if ($children != 0 && $children != '-1' && $children != '-2' && is_array($children)) { $children_str = " 有无孩子:"; //$children_sql = " and s.children in("; $chil_sql = array(); foreach ($children as $v) { $children_str .= $children_list[$v] . " "; $chil_sql[] = $v; } /*if($chil_sql){ $chil_sql=join(",",$chil_sql); } $children_sql.=$chil_sql.")";*/ $filter[] = array('children', implode(' | ', $chil_sql)); $condition_str .= $children_str; } //if($children == '-1' || $children == '-2') $children_sql = ''; //note 是否要孩子sql语句 if ($wantchildren != 0 && $wantchildren != '-1' && $wantchildren != '-2' && is_array($wantchildren)) { $wantchildren_str = " 可要孩子:"; //$wantchildren_sql = " and sf.wantchildren in("; $wan_sql = array(); foreach ($wantchildren as $v) { $wantchildren_str .= $wantchildren_list[$v] . " "; $wan_sql[] = $v; } /*if($wan_sql){ $wan_sql=join(",",$wan_sql); } $wantchildren_sql.=$wan_sql.")";*/ $filter[] = array('wantchildren', implode(' | ', $wan_sql)); $condition_str .= $wantchildren_str; } // if($wantchildren == '-1' || $wantchildren == '-2') $wantchildren_sql = ''; //note 籍贯查询sql语句 /* $hometown_sql = ''; $hometown_sql = ' AND sf.hometownprovince = '.$home_townprovince.' AND sf.hometowncity = '.$home_towncity; if($home_towncity == '-1' && $home_townprovince !='-1') { $hometown_sql = ' AND sf.hometownprovince = '.$home_townprovince; } if($home_townprovince == '-1' && $home_townprovince == '-1') $hometown_sql = '';*/ if ($home_townprovince != 0 && $home_townprovince != -1) { if ($home_townprovince == '-2') { $home_townprovince = 2; } $filter[] = array('home_townprovince', $home_townprovince); $condition_str .= " 籍贯:" . $city_list[$home_townprovince]; if ($home_towncity != 0 && $home_towncity != -1) { $filter[] = array('home_towncity', $home_towncity); $condtion_str .= " " . $city_list[$home_towncity]; } } //note 名族查询sql语句 /*$nation_sql = ''; $nation_sql = ' AND sf.nation = '.$nation; if($nation == '-1') $nation_sql = ''; */ if ($nation != -1) { $filter[] = array('nation', $nation); $condition_str .= " 民族:" . $stock_list[$nation]; } //note 体型查询sql语句 if ($body != 0 && $body != '-1' && $body != '-2' && is_array($body)) { $body_str = " 体型:"; //$body_sql = " and sf.body in("; $body_list = $user_arr["gender"] == 0 ? $body1_list : $body0_list; $bo_sql = array(); foreach ($body as $v) { /*if ($user_arr["gender"] == 0) { $body_str .= $body1_list[$v] . " "; } else { $body_str .= $body0_list[$v] . " "; }*/ $body_str .= $body_list[$v]; $bo_sql[] = $v; } /*if($bo_sql){ $bo_sql=join(",",$bo_sql); } $body_sql.=$bo_sql.")";*/ $filter[] = array('body', implode(' | ', $bo_sql)); $condition_str .= $body_str; } //if($body == '-1' || $body == '-2') $body_sql = ''; //note 生肖查询sql语句 if ($animalyear != 0 && $animalyear != '-1' && $animalyear != '-2' && is_array($animalyear)) { $animalyear_str = " 生肖:"; //$animalyear_sql = " and sf.animalyear in("; $ani_sql = array(); foreach ($animalyear as $v) { $animalyear_str .= $animals_list[$v] . " "; $ani_sql[] = $v; } /*if($ani_sql){ $ani_sql=join(",",$ani_sql); } $animalyear_sql.=$ani_sql.")";*/ $filter[] = array('animalyear', implode(' | ', $ani_sql)); $condition_str .= $animalyear_str; } //if($animalyear == '-1' || $animalyear == '-2') $animalyear_sql = ''; //note 星座查询sql语句 if ($constellation != 0 && $constellation != '-1' && $constellation != '-2' && is_array($constellation)) { $constellation_str = " 星座:"; //$constellation_sql = " and sf.constellation in( "; $cons_sql = array(); foreach ($constellation as $v) { $constellation_str .= $constellation_list[$v] . " "; $cons_sql[] = $v; } /*if($cons_sql){ $cons_sql=join(",",$cons_sql); } $constellation_sql.=$cons_sql.")";*/ $filter[] = array('constellation', implode(' | ', $cons_sql)); $condition_str .= $constellation_str; } //if($constellation == '-1' || $constellation == '-2') $constellation_sql = ''; //note 血型查询sql语句 if ($bloodtype != 0 && $bloodtype != '-1' && $bloodtype != '-2' && is_array($bloodtype)) { $bloodtype_str = " 血型:"; //$bloodtype_sql =" and sf.bloodtype in("; $bloo_sql = array(); foreach ($bloodtype as $v) { $bloodtype_str .= $bloodtype_list[$v] . " "; $bloo_sql[] = $v; } /*if($bloo_sql){ $bloo_sql=join(",",$bloo_sql); } $bloodtype_sql.=$bloo_sql.")";*/ $filter[] = array('bloodtype', implode(' | ', $bloo_sql)); $condition_str .= $bloodtype_str; } //if($bloodtype == '-1' || $bloodtype == '-2') $bloodtype_sql = ''; //note 信仰查询sql语句 if ($religion != 0 && $religion != '-1' && $religion != '-2' && is_array($religion)) { $religion_str = " 信仰:"; //$religion_sql = " and sf.religion in("; $reli_sql = array(); foreach ($religion as $v) { $religion_str .= $belief_list[$v] . " "; $reli_sql[] = $v; } /* if($reli_sql){ $reli_sql=join(",",$reli_sql); } $religion_sql.=$reli_sql.")";*/ $filter[] = array('religion', implode(' | ', $reli_sql)); $condition_str .= $religion_str; } // if($religion == '-1' || $religion == '-2') $religion_sql = ''; //note 兄弟姐妹sql语句 if ($family != '0' && $family != '-1' && $family != '-2' && is_array($family)) { $family_str = " 兄弟姐妹:"; //$family_sql = " and sf.family in("; $fami_sql = array(); foreach ($family as $v) { $family_str .= $family_list[$v]; $fami_sql[] = $v; } /*if($fami_sql){ $fami_sql=join(",",$fami_sql); } $family_sql.=$fami_sql.")";*/ $filter[] = array('family', implode(' | ', $fami_sql)); $condition_str .= $family_str; } //if($family == '-1' || $family == '-2') $family_sql = ''; //note 语言能力sql语句,采用like查询 $language_sql = ""; if (is_array($language)) { $language_str = " 语言能力:"; //$language_sql = " and("; //$lan_sql = ""; $lan_sql = array(); foreach ($language as $v) { $language_str .= $language_list[$v] . " "; $lan_sql[] = $v; /*if (empty($lan_sql)) { $lan_sql .= " FIND_IN_SET('" . $v . "'," . "sf.language)"; } else { $lan_sql .= " or FIND_IN_SET('" . $v . "'," . "sf.language)"; }*/ } $filter[] = array('language', implode(' | ', $lan_sql)); //$language_sql .= $lan_sql . ")"; $condition_str .= $language_str; } //if($language == '-1' || $language == '-2') $language_sql = ''; /*$sql = " on sf.uid=s.uid where s.is_lock = 1 and s.gender='$gender' ".$age_sql.$area_sql.$marriage_sql.$salary_sql.$education_sql.$height_sql.$weight_sql. $smoking_sql.$drinking_sql.$occupation_sql.$house_sql.$vehicle_sql.$corptype_sql.$children_sql.$wantchildren_sql.$hometown_sql. $nation_sql.$body_sql.$animalyear_sql.$constellation_sql.$bloodtype_sql.$religion_sql.$family_sql.$language_sql.$photo_sql;*/ $filter[] = array('is_lock', 1); $limit = array(16); $sp = searchApi($index); $sp->getResultOfReset($filter, $limit); $user_ids = $sp->getIds(); //$user = $_MooClass['MooMySQL']->getAll("select s.*,sf.body, sf.hometownprovince, sf.hometowncity from `{$dbTablePre}members` s left join `{$dbTablePre}memberfield` sf $sql LIMIT 0, 16"); //note 找不到匹配的结果返回单独提示页面 if (count($user_ids) == '0') { return; } $sql = "select s.uid,s.nickname,s.birthyear,s.height,s.hometownprovince,s.hometowncity,b.pic_date,b.pic_name from `{$dbTablePre}members_search` s left join `{$dbTablePre}members_base` b on s.uid=b.uid where s.uid in (" . implode(',', $user_ids) . ")"; $user = $_MooClass['MooMySQL']->getAll($sql); $recommend_member = $user[0]; $recommend_member_href = '<a href="http://' . MOOPHP_HOST . '/index.php?n=space&h=viewpro&uid=' . $recommend_member["uid"] . '" style="color:#bd0000; text-decoration:underline" target="_blank">'; if (!empty($recommend_member["nickname"])) { $recommend_member_href .= htmlspecialchars(MooCutstr($recommend_member["nickname"], 10)); } else { $recommend_member_href .= htmlspecialchars($recommend_member["uid"]); } $recommend_member_href .= "</a>"; $sql = "select introduce from " . $dbTablePre . "members_introduce where uid = '" . $recommend_member["uid"] . "'"; $choice = $_MooClass['MooMySQL']->getOne($sql, true); ob_start(); include MooTemplate('public/crontab_index', 'module'); $content = ob_get_clean(); //error_log($content, 0); //echo $email; $return = MooSendMail($email, "真爱一生网推荐会员", $content, "", false, $user_arr['uid']); }
function addmyfriend() { global $_MooClass, $dbTablePre, $pagesize, $user_arr, $timestamp, $serverid; $sendtoid = MooGetGPC('sendtoid', 'integer'); $userid = $user_arr['uid']; if ($sendtoid == $userid) { MooMessage('自己不可加自己为意中人', 'javascript:history.go(-1);', '04'); exit; } //note 双方屏蔽不给操作 if (MooGetScreen($userid, $sendtoid)) { MooMessage('因特殊原因,加意中人失败', "index.php?n=service&h=rose&t=getmorerose", '03'); 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) { MooMessage('对不起您不能模拟操作', 'javascript:history.go(-1);', '04'); exit; } //note 分配客服 //allotserver($userid); //note 获得照片总数 //$query = $_MooClass['MooMySQL']->query("SELECT imgid FROM {$dbTablePre}pic WHERE uid = '$sendtoid'"); //$pic_total = $_MooClass['MooMySQL']->numRows($query); $query = $_MooClass['MooMySQL']->getOne("SELECT count(1) as c FROM {$dbTablePre}pic WHERE uid = '{$sendtoid}'"); $pic_total = $query['c']; //note 要做性别过滤,异性的发送玫瑰,直接转到玫瑰列表页面 $send_user1 = leer_send_user1($sendtoid); $user = leer_send_user1($userid); if ($send_user1['gender'] == $user['gender']) { MooMessage('不可加同性为意中人', 'javascript:history.go(-1);', '04'); exit; } if (empty($GLOBALS['MooUid'])) { list($uid, $password) = explode("\t", MooAuthCode($_MooCookie['auth'], 'DECODE')); $uid = intval($uid); } else { $uid = $GLOBALS['MooUid']; } if (empty($uid)) { MooMessage('您还没有登录', 'index.php?n=login', '04'); } $friend = $_MooClass['MooMySQL']->getOne("SELECT * FROM {$dbTablePre}service_friend WHERE friendid = '{$sendtoid}' AND uid = '{$uid}'", true); if ($friend['fid']) { $content = '对不起,对方已经在您的意中人列表中'; $url = 'index.php?n=space&h=viewpro&uid=' . $sendtoid; MooMessage($content, $url, '02'); } else { //note 加为意中人,新插入一行记录,谁加谁 $_MooClass['MooMySQL']->query("INSERT INTO {$dbTablePre}service_friend SET friendid = '{$sendtoid}',uid = '{$uid}',sendtime='" . time() . "'"); } //将新注册的会员更新为优质会员 if (in_array($user_arr['sid'], array(0, 52, 123)) && $user_arr['is_well_user'] != 1) { update_iswell_user($uid); } //发送短信和邮件 include_once "./module/crontab/crontab_config.php"; if (MOOPHP_ALLOW_FASTDB) { $res = MooFastdbGet('members_search', 'uid', $sendtoid); $res_b = MooFastdbGet('members_base', 'uid', $sendtoid); $res = array_merge($res, $res_b); } else { $res = $_MooClass['MooMySQL']->getOne("select s.telphone,b.is_phone,s.username from {$dbTablePre}members_search s left join {$dbTablePre}members_base b on s.uid=b.uid where uid='{$sendtoid}'"); } $send_user_info = $_MooClass['MooMySQL']->getAll("select c.*,b.*,a.* from `{$dbTablePre}members_search` a left join {$dbTablePre}members_base b on a.uid=b.uid left join {$dbTablePre}choice c on a.uid=c.uid where a.uid = '{$uid}'"); $send_user_info = $send_user_info[0]; //头像路径 $path = thumbImgPath(2, $send_user_info[pic_date], $send_user_info[pic_name], $send_user_info['gender']); 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 = $provice_list[$send_user_info[province]]; //省 $city = $city_list[$send_user_info[city]]; //市 $height = $send_user_info[height] ? $height_list[$send_user_info[height]] : "未知"; //身高 ob_start(); require_once MooTemplate('public/mail_space_friendtpl', 'module'); //模板 $body = ob_get_clean(); // MooSendMailSpace2($res['username'],"真爱一生网系统温馨提示","真爱一生网提醒:有会员将您添加为意中人了!请尽快查收!您的帐号是:".$res['username'],$type="1",$body); MooSendMail($res['username'], "真爱一生网系统温馨提示", $body, "", false, $sendtoid); // MooSendMailSpace($res['username'],"真爱一生网系统温馨提示","真爱一生网提醒:有会员给您发送秋波了!请尽快查收!您的帐号是:".$res['username'],$type="1",$send_user,$send_type = "秋波",$userid,$send_user_img,$age,$tall,$area,$sendtime,$introduce); $week_time = 24 * 3600 * 7; //一周时间秒数 $interval_time = $timestamp - $user_arr['last_login_time']; //当前时间-最后登录时间 $date1 = date("Y-m-d", strtotime("last Monday")); $date2 = date("Y-m-d", strtotime("Sunday")); if ($interval_time > $week_time) { //不活跃用户每周发一条短信 $_MooClass['MooMySQL']->query("INSERT INTO {$dbTablePre}today_send SET uid = '" . $sendtoid . "', sid = '" . $userid . "',phone = '" . $res['telphone'] . "',sendtime = '" . date("Y-m-d") . "'"); $cos = $_MooClass['MooMySQL']->getOne("select count(*) as c from {$dbTablePre}today_send where uid='{$sendtoid}' and sendtime>='{$date1}' and sendtime<='{$date2}'"); if ($cos[c] <= 1) { //fanglin暂时屏蔽 Push_message_intab($sendtoid, $res['telphone'], "意中人", "真爱一生网 用户ID:" . $userid . "," . $send_user_grade . ",已将您添加为意中人,请及时把握您的缘分!4006780405", $userid); } } else { //每天该用户超过5条信息不发送短信 $cos = $_MooClass['MooMySQL']->getOne("select count(*) as c from {$dbTablePre}today_send where uid='{$sendtoid}' and sendtime='" . date("Y-m-d") . "'"); if ($cos[c] < 5) { $_MooClass['MooMySQL']->query("INSERT INTO {$dbTablePre}today_send SET uid = '" . $sendtoid . "', sid = '" . $userid . "',phone = '" . $res['telphone'] . "',sendtime = '" . date("Y-m-d") . "'"); //fanglin暂时屏蔽 Push_message_intab($sendtoid, $res['telphone'], "意中人", "真爱一生网 用户ID:" . $userid . "," . $send_user_grade . ",已将您添加为意中人,请及时把握您的缘分!4006780405", $userid); } } require MooTemplate('public/service_friend_addmyfriend', 'module'); }
function send_rose() { global $_MooClass, $dbTablePre, $timestamp, $user_arr, $serverid; $sendtoid = MooGetGPC('sendtoid', 'integer'); $userid = $user_arr['uid']; //note 分配客服 //allotserver($userid); //note 获得照片总数 $query = $_MooClass['MooMySQL']->query("SELECT imgid FROM {$dbTablePre}pic WHERE uid = '{$sendtoid}'"); $pic_total = $_MooClass['MooMySQL']->numRows($query); //note 自己不能给自己发送玫瑰,直接转到玫瑰列表页面 if ($userid == $sendtoid) { MooMessage('自己不可以给自己送鲜花', "index.php?n=service&h=rose&t=getmorerose"); 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) { MooMessage('对不起您不能模拟操作', 'javascript:history.go(-1);', '04'); exit; } //note 双方屏蔽不给操作 if (MooGetScreen($userid, $sendtoid)) { MooMessage('因特殊原因,送鲜花失败', "index.php?n=service&h=rose&t=getmorerose"); exit; } //note 要做性别过滤,异性的发送玫瑰,直接转到玫瑰列表页面 $send_user1 = leer_send_user1($sendtoid); $user = leer_send_user1($userid); if ($send_user1['gender'] == $user['gender']) { MooMessage('不可给同性发送鲜花', 'javascript:history.go(-1);'); exit; } //note 如果自己没有玫瑰花了,就提示没有玫瑰花了 if ($user['rosenumber'] <= 0) { MooMessage('您没有鲜花了,获取更多鲜花', "index.php?n=service&h=rose&t=getmorerose"); exit; } //发送短信和邮件 include_once "./module/crontab/crontab_config.php"; if (MOOPHP_ALLOW_FASTDB) { $res = MooFastdbGet('members_search', 'uid', $sendtoid); $res_b = MooFastdbGet('members_base', 'uid', $sendtoid); $res = array_merge($res, $res_b); } else { $res = $_MooClass['MooMySQL']->getOne("select s.telphone,b.is_phone,s.username from {$dbTablePre}members_search s left join {$dbTablePre}members_base b on s.uid=b.uid where s.uid='{$sendtoid}'"); } $send_user_info = $_MooClass['MooMySQL']->getAll("select b.*,c.*,a.* from `{$dbTablePre}members_search` a left join {$dbTablePre}members_base c on a.uid=c.uid left join {$dbTablePre}members_choice b on a.uid=b.uid where a.uid = '{$userid}'"); $send_user_info = $send_user_info[0]; //头像路径 $path = thumbImgPath(2, $send_user_info[pic_date], $send_user_info[pic_name], $send_user_info['gender']); 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 = $provice_list[$send_user_info['province']]; //省 $city = $city_list[$send_user_info['city']]; //市 $height = $send_user_info['height'] ? $height_list[$send_user_info['height']] : "未知"; //身高 ob_start(); require_once MooTemplate('public/mail_space_rosetpl', 'module'); //模板 $body = ob_get_clean(); MooSendMail($res['username'], "真爱一生网系统温馨提示", $body, "", false, $sendtoid); if (empty($GLOBALS['MooUid'])) { list($uid, $password) = explode("\t", MooAuthCode($_MooCookie['auth'], 'DECODE')); $uid = intval($uid); } else { $uid = $GLOBALS['MooUid']; } if (empty($uid)) { MooMessage('您还没有登录', 'index.php?n=login'); } $leer = $_MooClass['MooMySQL']->getOne("SELECT * FROM {$dbTablePre}service_rose WHERE receiveuid = '{$sendtoid}' AND senduid = '{$userid}' ORDER BY rid DESC LIMIT 1"); if ($user['rosenumber'] > 0) { if ($leer['rid']) { $rid = $leer['rid']; //note 如果已经发送过玫瑰,就增加发送玫瑰的次数 $_MooClass['MooMySQL']->query("UPDATE {$dbTablePre}service_rose SET num = num + 1, receivenum = receivenum + 1,sendtime = '{$timestamp}',receivetime='{$timestamp}',receive_del=0,send_del=0 WHERE rid = '{$rid}'"); } else { //note 发送新的玫瑰,写入数据库 发送者,接受者,发送时间 $_MooClass['MooMySQL']->query("INSERT INTO {$dbTablePre}service_rose SET num = 1, receivenum = 1, sendtime = '{$timestamp}',receivetime='{$timestamp}',senduid = '{$uid}',receiveuid = '{$sendtoid}' "); } //note 发送一朵玫瑰,自己就要减少一朵玫瑰 //enkytest //enkytestend $_MooClass['MooMySQL']->query("UPDATE {$dbTablePre}members_base SET rosenumber = rosenumber - 1 WHERE uid = '{$uid}'"); if (MOOPHP_ALLOW_FASTDB) { $user_rosenum = $GLOBALS['_MooClass']['MooMySQL']->getOne("SELECT rosenumber FROM {$GLOBALS['dbTablePre']}members_base WHERE `uid`='{$uid}' LIMIT 1"); $value['rosenumber'] = $user_rosenum['rosenumber']; MooFastdbUpdate('members_base', 'uid', $userid, $value); } } //将新注册的会员更新为优质会员 if (in_array($user_arr['sid'], array(0, 52, 123)) && $user_arr['is_well_user'] != 1) { update_iswell_user($user_arr['uid']); } //每天向同一用户发送多次,短信记录数表只记一次 $send_rose_date = isset($leer['sendtime']) ? date("Y-m-d", $leer['sendtime']) : date("Y-m-d"); // $today_rose_count = isset($leer['rid']) ? $leer['num'] + 1 : 1; if (date("Y-m-d") > $send_rose_date) { $today_rose_count = 1; } if ($res['is_phone']) { SendMsg($res['telphone'], "真爱一生网 用户ID:" . $userid . "," . $send_user_grade . ",已给您发送鲜花,请及时把握您的缘分!4006780405"); } //提醒所属客服 $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); MooMessage('发送鲜花成功' . $note, "index.php?n=service&h=rose&t=isendrose", "05"); require MooTemplate('public/service_rose_sendrose', 'module'); }
function sendnewfl() { 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 ($user['rosenumber'] <= 0) { $error = '您没有鲜花了,获取更多鲜花'; echo return_data($error, false); exit; } // //发送短信和邮件 include_once "./module/crontab/crontab_config.php"; $res = MooMembersData($sendtoid); $send_user_info = array_merge(MooGetData('members_choice', 'uid', $userid), MooMembersData($userid)); //头像路径 $path = thumbImgPath(2, $send_user_info['pic_date'], $send_user_info['pic_name'], $send_user_info['gender']); 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(); //require_once MooTemplate('public/mail_space_rosetpl', 'module'); //模板 $body = ob_get_clean(); if ($res['usertype'] != 3) { MooSendMail($res['username'], "真爱一生网系统温馨提示", $body, "", false, $sendtoid); } if (empty($GLOBALS['MooUid'])) { list($uid, $password) = explode("\t", MooAuthCode($_MooCookie['auth'], 'DECODE')); $uid = intval($uid); } else { $uid = $GLOBALS['MooUid']; } //if(empty($uid)){ // MooMessage('您还没有登录','index.php?n=login'); //} $leer = $_MooClass['MooMySQL']->getOne("SELECT * FROM {$dbTablePre}service_rose WHERE receiveuid = '{$sendtoid}' AND senduid = '{$userid}' ORDER BY rid DESC LIMIT 1"); //库中验证鲜花数 //$rosenum_check = $GLOBALS['_MooClass']['MooMySQL']->getOne("SELECT rosenumber FROM {$GLOBALS['dbTablePre']}members_base WHERE `uid`='{$uid}' LIMIT 1",true); //if($rosenum_check['rosenumber'] > 0) { if ($leer['rid']) { $is_first_send = false; $rid = $leer['rid']; //note 如果已经发送过玫瑰,就增加发送玫瑰的次数 $_MooClass['MooMySQL']->query("UPDATE {$dbTablePre}service_rose SET num = num + 1, receivenum = receivenum + 1,sendtime = '{$timestamp}',receivetime='{$timestamp}',receive_del=0,send_del=0 WHERE rid = '{$rid}'"); } else { //note 发送新的玫瑰,写入数据库 发送者,接受者,发送时间 $_MooClass['MooMySQL']->query("INSERT INTO {$dbTablePre}service_rose SET num = 1, receivenum = 1, sendtime = '{$timestamp}',receivetime='{$timestamp}',senduid = '{$uid}',receiveuid = '{$sendtoid}' "); } //note 发送一朵玫瑰,自己就要减少一朵玫瑰 $_MooClass['MooMySQL']->query("UPDATE {$dbTablePre}members_base SET rosenumber = rosenumber - 1 WHERE uid = '{$uid}'"); if (MOOPHP_ALLOW_FASTDB) { $user_rosenum = $GLOBALS['_MooClass']['MooMySQL']->getOne("SELECT rosenumber FROM {$GLOBALS['dbTablePre']}members_base WHERE `uid`='{$uid}' LIMIT 1", true); $value['rosenumber'] = $user_rosenum['rosenumber']; MooFastdbUpdate('members_base', 'uid', $userid, $value); } //} //将新注册的会员更新为优质会员 if (in_array($user_arr['sid'], array(0, 52, 123)) && $user_arr['is_well_user'] != 1) { update_iswell_user($user_arr['uid']); } //每天向同一用户发送多次,短信记录数表只记一次 $send_rose_date = isset($leer['sendtime']) ? date("Y-m-d", $leer['sendtime']) : date("Y-m-d"); // $today_rose_count = isset($leer['rid']) ? $leer['num'] + 1 : 1; if (date("Y-m-d") > $send_rose_date) { $today_rose_count = 1; } $sendinfo = MooGetGPC('sendinfo', 'string', 'G'); if (!empty($sendinfo)) { $sendinfo = ",对您说:" . $sendinfo; } if ($res['usertype'] != 3) { if ($serverid) { //客服模拟会员登录可以选择发送短信或彩信 $SMStype = MooGetGPC('selectSMSorCMS', 'string', 'G'); if ($SMStype == 'SMS' && $res['is_phone']) { 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); //发送条件:本站注册会员,有电话号码的,开启短信通知的会员发送 /* $sql="SELECT telphone FROM {$dbTablePre}members where uid='{$sendtoid}'";// and is_phone=1 and telphone!='' and usertype=1"; $sendto_user_info=$_MooClass['MooMySQL']->getOne($sql);*/ if ($sendfrom_user_info['uid']) { $sendedMMSCount = $memcached->get('hznsimulate' . $serverid); if (empty($sendedMMSCount)) { $sendedMMSCount = 0; } //if($sendedMMSCount > 10){ // MooMessage('您今天累计已经发过10条彩信','index.php?n=service&h=rose'); //} send_mms_commission($res['telphone'], 'rose', $userid); $memcached->set('hznsimulate' . $serverid, ++$sendedMMSCount, 0, 28800); } //====发送彩信 end ===== } } else { //真实会员登录 if ($res['is_phone'] && $is_first_send && $res['s_cid'] != 40) { //第一次发才短信提示 // SendMsg($res['telphone'],"真爱一生网 用户ID:".$userid.",".$send_user_grade.",已给您发送鲜花".$sendinfo." 请及时把握您的缘分!4006780405"); Push_message_intab($sendtoid, $res['telphone'], "鲜花", "真爱一生网 用户ID:" . $userid . "," . $send_user_grade . ",已给您发送鲜花" . $sendinfo . " 请及时把握您的缘分!4006780405", $userid); } } } /* $week_time = 24*3600*7;//一周时间秒数 $interval_time = $timestamp - $user_arr['last_login_time'];//当前时间-最后登录时间 $date1 = date("Y-m-d",strtotime("last Monday")); $date2 = date("Y-m-d",strtotime("Sunday")); //echo "interval_time:".$interval_time . ' and '.'week:'.$week_time;exit; if($interval_time > $week_time){//不活跃用户每周发一条短信 $_MooClass['MooMySQL']->query("INSERT INTO {$dbTablePre}today_send SET uid = '".$sendtoid."', sid = '".$userid."',phone = '".$res['telphone']."',sendtime = '".date("Y-m-d")."'" ); $cos = $_MooClass['MooMySQL']->getOne("select count(*) as c from {$dbTablePre}today_send where uid='$sendtoid' and sendtime>='$date1' and sendtime<='$date2'"); if($cos[c] <= 1){ //fanglin暂时屏蔽 Push_message_intab($sendtoid,$res['telphone'],"鲜花","真爱一生网 用户ID:".$userid.",".$send_user_grade.",已给您发送鲜花,请及时把握您的缘分!4006780405",$userid); } }else{ //echo $today_rose_count;exit; if($send_rose_date==date("Y-m-d") && $today_rose_count == 1){ //每天同一个用户发送多次秋波,短信只记一次 $cos = $_MooClass['MooMySQL']->getOne("select count(*) as c from {$dbTablePre}today_send where uid='$sendtoid' and sendtime='".date("Y-m-d")."'"); //print_r($cos);exit; if($cos[c]<5){ $_MooClass['MooMySQL']->query("INSERT INTO {$dbTablePre}today_send SET uid = '".$sendtoid."', sid = '".$userid."',phone = '".$res['telphone']."',sendtime = '".date("Y-m-d")."'" ); //fanglin暂时屏蔽 Push_message_intab($sendtoid,$res['telphone'],"鲜花","真爱一生网 用户ID:".$userid.",".$send_user_grade.",已给您发送鲜花,请及时把握您的缘分!4006780405",$userid); } } } */ /* //发送彩信 $sql="SELECT uid FROM {$dbTablePre}members where uid='{$uid}' and mainimg!='' and images_ischeck=1 and pic_num>0"; //$sql="SELECT uid FROM {$dbTablePre}members where uid='{$uid}'"; $sendout_user_info=$_MooClass['MooMySQL']->getOne($sql); //发送人有照片 $sql="SELECT telphone FROM {$dbTablePre}members where uid='{$sendtoid}' and is_phone=1 and telphone!='' and usertype=1"; $sendto_user_info=$_MooClass['MooMySQL']->getOne($sql); //发送条件:本站注册会员,有电话号码的,开启短信通知的会员发送 //echo $sendto_user_info['telphone'].' and '.$sendout_user_info['uid'];exit; if($sendto_user_info['telphone']&&$sendout_user_info['uid']){ //echo 'ffff';exit; if(send_mms_commission($sendto_user_info['telphone'],'rose',$sendout_user_info['uid'])){ $note="。"; }else{ $note="!"; } } */ /*普通会员对全权会员反馈白名单*/ 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); } //提醒所属客服 $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); $return = "发送鲜花成功"; echo return_data($return); exit; //MooMessage('发送鲜花成功',"index.php?n=service&h=rose&t=isendrose","05"); //require MooTemplate('public/service_rose_sendrose', 'module'); }
function sendMailByNow($ToAddress, $ToSubject, $ToBody, $type = '', $is_template = true) { global $_MooClass, $dbTablePre; global $mailHost; global $mailUser; global $mailPasswd; global $mailSenderMail; global $mailSenderName; global $mailTemplateFile; global $g_mail_list; // 查询是否来自采集的 $filter = array(); $filter[] = array('username', $ToAddress); $filter[] = array('usertype', '3'); $limit = array(0, 1); $members_id = searchApi('members_man members_women')->getResultOfReset($filter, $limit); if (!empty($members_id)) { return true; } /** $sql = "select usertype from " . $dbTablePre . "members_search where uid = '" . $members_id[0] . "' limit 1"; $member = $_MooClass['MooMySQL']->getOne($sql); if (count($member) > 0) { if ($member["usertype"] == 3) { return true; } } else { return true; } **/ //} $key = array_rand($g_mail_list, 1); $mailSenderMail = $g_mail_list[$key]; if ($is_template == true) { if ($type == '') { $body = MooReadFileadmin($mailTemplateFile); } else { $body = MooReadFileadmin($type, false); } $body = str_replace('\\', '', $body); //邮件时间替换 //date_default_timezone_set ('Asia/Shanghai'); $Time = date('Y-m-d H:i:s'); $body = str_replace("#DATETIME#", $Time, $body); //note 邮件正文替换 $body = str_replace("#BODY#", $ToBody, $body); //note 模板几个内部图片地址 $body = str_replace("#siteurl#", 'http://' . $_SERVER['HTTP_HOST'] . '/', $body); } else { $body = $ToBody; } try { ob_start(); require "framwork/libraries/class.phpmailer.php"; $mail = new PHPMailer(); //建立邮件发送类 $mail->IsSMTP(); // 使用SMTP方式发送 $mail->Host = $mailHost; // 您的企业邮局域名 $mail->Port = 25; $mail->SMTPAuth = true; // 启用SMTP验证功能 //$mail->SMTPSecure = "ssl"; $mail->Username = $mailSenderMail; // 邮局用户名(请填写完整的email地址) $mail->Password = $mailPasswd; // 邮局密码 $mail->From = $mailSenderMail; //邮件发送者email地址 $mail->CharSet = "utf-8"; $mail->Encoding = "base64"; $mail->FromName = $ToSubject; //$mail->AddReplyTo("", ""); //$mail->AddAttachment("/var/tmp/file.tar.gz"); // 添加附件 $mail->IsHTML(true); // set email format to HTML //是否使用HTML格式 $mail->AltBody = ""; //附加信息,可以省略 // 自动换行 $mail->WordWrap = 70; // 这里指定字符集!如果是utf-8则将gb2312修改为utf-8 $mail->CharSet = 'utf-8'; $mail->Subject = $ToSubject; $mail->Body = $body; $mail->AddAddress($ToAddress, ""); if ($mail->Send()) { return true; } else { return MooSendMail($ToAddress, $ToSubject, $ToBody, $type); } } catch (Exception $e) { return MooSendMail($ToAddress, $ToSubject, $ToBody, $type); } }
function sendcontact() { global $_MooClass, $dbTablePre, $timestamp, $user, $user_arr, $hzn, $serverid; $returnurl = 'index.php?' . $_SERVER['QUERY_STRING']; //返回的url $userid = $GLOBALS['MooUid']; //note 目前默认系统不审核 $contact_sys_check = '0'; //note 目前系统默认是委托真爱一生等待对方的回应 $contact_stat = '1'; $content = MooCutstr(safeFilter(MooGetGPC('content1', 'string')), 200, ''); $sendid = MooGetGPC('sendid', 'integer'); //客服不可模拟操作 /*if($hzn == "hongniangwang"){ MooMessage('对不起您不能模拟操作','javascript:history.go(-1);','04'); exit; }*/ if ($serverid) { MooMessage('对不起您不能模拟操作', 'javascript:history.go(-1);', '04'); exit; } //自己不可委托真爱一生联系自己 if ($sendid == $userid) { MooMessage('自己不可委托真爱一生联系自己', 'javascript:history.go(-1);', '02'); exit; } //note 双方屏蔽不给操作 if (MooGetScreen($userid, $sendid)) { MooMessage('因特殊原因,委托失败', "index.php?n=service&h=rose&t=getmorerose", '03'); exit; } $formsubmit1 = MooGetGPC('formsubmit1', 'string'); //委托联系人表 $checkuser = $_MooClass['MooMySQL']->getOne("SELECT mid,sendtime FROM {$dbTablePre}service_contact WHERE you_contact_other='{$sendid}' AND other_contact_you = '{$userid}' and receive_del=0 and send_del=0 and is_server=0"); //查今天委托次数 $checkuser2 = $user_arr; //note 委托也要做性别限制 if (MOOPHP_ALLOW_FASTDB) { $user_s = MooFastdbGet('members_search', 'uid', $sendid); } else { $user_s = $_MooClass['MooMySQL']->getOne("SELECT * FROM {$dbTablePre}members_search WHERE uid = '{$sendid}'", true); } //note 获得照片总数 $ret_count = $_MooClass['MooMySQL']->getOne("SELECT count(imgid) as c FROM {$dbTablePre}pic WHERE uid = '{$user_s['uid']}'"); $pic_total = $ret_count['c']; if ($checkuser2['gender'] == $user_s['gender']) { MooMessage('同性之间不可委托真爱一生', 'javascript:history.go(-1);', '02'); exit; } //note 检查绑定是否过期 if ($user_s['isbind'] == 1) { //note 如果被绑定,检测绑定是否到期 $user_s['isbind'] = check_bind($user_s['bind_id']); if ($user_s['isbind'] == 1) { MooMessage('不能向绑定中的会员发委托', 'javascript:history.go(-1);', '02'); exit; } } if ($user_s['showinformation'] != 1) { MooMessage('发起委托失败,该会员已经关闭资料!', 'javascript:history.go(-1);', '02'); exit; } //note 如果已经联系他就直接提示 if ($checkuser['mid']) { MooMessage("对不起,您已经委托真爱一生联系TA了", 'javascript:history.go(-1);', '02'); } //note 如果是今天超过3次就直接提示 $mtime = date("Ymd"); $contact_time_Ymd = date("Ymd", $checkuser2['contact_time']); if ($contact_time_Ymd == $mtime && $checkuser2['contact_num'] >= 3) { MooMessage("今天委托真爱一生已经超过3次", 'javascript:history.go(-1);', '02'); } //提交时 if ($formsubmit1 && $content && $sendid) { if (!$checkuser['mid']) { //发送短信和邮件 include_once "./module/crontab/crontab_config.php"; if (MOOPHP_ALLOW_FASTDB) { $res = MooFastdbGet('members_search', 'uid', $sendid); } else { $res = $_MooClass['MooMySQL']->getOne("select telphone,is_phone,username from {$dbTablePre}members_search where uid='{$sendid}'"); } if (MOOPHP_ALLOW_FASTDB) { $send_user_info = MooFastdbGet('members_search', 'uid', $userid); $send_user_info = array_merge($send_user_info, MooFastdbGet('members_choice', 'uid', $userid)); } else { $send_user_info = $_MooClass['MooMySQL']->getAll("select b.*,a.* from `{$dbTablePre}members_search` a left join {$dbTablePre}members_choice b on a.uid=b.uid where a.uid = '{$userid}'"); $send_user_info = $send_user_info['0']; } //头像路径 $path = thumbImgPath(2, $send_user_info['pic_date'], $send_user_info['pic_name'], $send_user_info['gender']); 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 = $provice_list[$send_user_info['province']]; //省 $city = $city_list[$send_user_info['city']]; //市 $height = $send_user_info['height'] ? $height_list[$send_user_info['height']] : "未知"; //身高 ob_start(); require_once MooTemplate('public/mail_space_commissiontpl', 'module'); //模板 $body = ob_get_clean(); MooSendMail($res['username'], "真爱一生网系统温馨提示", $body, "", false, $sendid); /*发送短信提醒 begin $week_time = 24*3600*7;//一周时间秒数 $interval_time = $timestamp - $user_arr['last_login_time'];//当前时间-最后登录时间 $date1 = date("Y-m-d",strtotime("last Monday")); $date2 = date("Y-m-d",strtotime("Sunday")); if($interval_time > $week_time){//不活跃用户每周发一条短信 $_MooClass['MooMySQL']->query("INSERT INTO {$dbTablePre}today_send SET uid = '".$sendid."', sid = '".$userid."',phone = '".$res['telphone']."',sendtime = '".date("Y-m-d")."'" ); $cos = $_MooClass['MooMySQL']->getOne("select count(*) as c from {$dbTablePre}today_send where uid='$sendtoid' and sendtime>='$date1' and sendtime<='$date2'"); if($cos['c'] <= 1){ //fanglin暂时屏蔽 Push_message_intab($sendid,$res['telphone'],"委托","真爱一生网 用户ID:".$send_user_info['uid'].",".$send_user_grade.",已委托真爱一生联系您,请及时把握您的缘分!4006780405",$send_user_info['uid']); } }else{ //每天该用户超过5条信息不发送短信 $cos = $_MooClass['MooMySQL']->getOne("select count(*) as c from {$dbTablePre}today_send where uid='$sendid' and sendtime='".date("Y-m-d")."'"); if($cos['c']<5){ $_MooClass['MooMySQL']->query("INSERT INTO {$dbTablePre}today_send SET uid = '".$sendid."', sid = '".$userid."',phone = '".$res['telphone']."',sendtime = '".date("Y-m-d")."'" ); //fanglin暂时屏蔽 Push_message_intab($sendid,$res['telphone'],"委托","真爱一生网 用户ID:".$send_user_info['uid'].",".$send_user_grade.",已委托真爱一生联系您,请及时把握您的缘分!4006780405",$send_user_info['uid']); } } end */ //note 今天提交委托真爱一生,表中的委托计数还是昨天的就 update为0 if ($contact_time_Ymd != $mtime) { $_MooClass['MooMySQL']->query("UPDATE {$dbTablePre}members_base SET contact_num = 0,contact_time = '{$timestamp}' WHERE uid = '{$userid}'"); if (MOOPHP_ALLOW_FASTDB) { $value = array(); $value['contact_num'] = 0; $value['contact_time'] = $timestamp; MooFastdbUpdate('members_base', 'uid', $userid, $value); } } //note 如果今天提交委托真爱一生次数超过3次不能再发起委托,否则更新次数 $today_contact_num = $_MooClass['MooMySQL']->getOne("SELECT contact_num FROM {$dbTablePre}members_base WHERE uid = '{$userid}'", true); //$today_contact_num = $checkuser2; $today_contact_num = $today_contact_num['contact_num']; //今天委托的次数 //if($user_arr['uid']=='20796965') $today_contact_num=0; if ($today_contact_num < 3) { //优质会员列表 $update_sql = ''; if (empty($user_arr['sid']) && $user_arr['usertype'] == 1) { $update_sql = ',is_well_user=1'; } $_MooClass['MooMySQL']->query("UPDATE {$dbTablePre}members_base SET contact_num = contact_num + 1,contact_time = '{$timestamp}' {$update_sql} WHERE uid = '{$userid}'"); if (MOOPHP_ALLOW_FASTDB) { $oldarr = MooFastdbGet('members_base', 'uid', $userid); $value = array(); $value['contact_num'] = $oldarr['contact_num'] + 1; $value['contact_time'] = $timestamp; if ($update_sql != '') { $value['is_well_user'] = 1; } MooFastdbUpdate('members_base', 'uid', $userid, $value); } //note 记录委托真爱一生的内容 $_MooClass['MooMySQL']->query("INSERT INTO {$dbTablePre}service_contact SET content = '{$content}',other_contact_you = '{$userid}',you_contact_other='{$sendid}',stat = '{$contact_stat}',syscheck='{$contact_sys_check}',sendtime = '{$timestamp}'"); //将新注册的会员更新为优质会员 if (in_array($user_arr['sid'], array(1, 52, 123)) && $user_arr['is_well_user'] != 1) { update_iswell_user($user_arr['uid']); } //if($user_arr['uid']=='20796965'){ //====发送委托彩信 begin ==== $sql = "SELECT uid,telphone FROM {$dbTablePre}members_search where uid='{$userid}' and mainimg!='' and images_ischeck=1 and pic_num>0"; $sendout_user_info = $_MooClass['MooMySQL']->getOne($sql); //发送人有照片 //echo $sendid."<br />".$userid; $sql = "SELECT s.telphone FROM {$dbTablePre}members_search as s\n\t left join {$dbTablePre}members_base as b on s.uid=b.uid\n\t where s.uid='{$sendid}' and b.is_phone=1 and s.telphone!='' and s.usertype=1"; $sendto_user_info = $_MooClass['MooMySQL']->getOne($sql, true); //发送条件:本站注册会员,有电话号码的,开启短信通知的会员发送 //print_r($sendout_user_info); //exit;$sendout_user_info['telphone'] if ($sendto_user_info['telphone'] && $sendout_user_info['uid']) { //SendMsg('18911883821',"真爱一生网 用户ID:".$user_arr['uid'].",".$gender.",已给委托真爱一生 委托您,请及时把握您的缘分!4006780405"); send_mms_commission($sendto_user_info['telphone'], 'contact', $sendout_user_info['uid']); } //====发送委托彩信 end ===== //} MooMessage("委托成功", 'index.php?n=service', '05'); } else { MooMessage("今天委托真爱一生已经 超过3次", 'javascript:history.go(-1);', '02'); } } else { MooMessage("对不起,您已经委托真爱一生联系TA了", 'javascript:history.go(-1);', '02'); } } //是否有手机号码 if (MOOPHP_ALLOW_FASTDB) { $status = MooFastdbGet('certification', 'uid', $userid); } else { $status = $_MooClass['MooMySQL']->getOne("SELECT telphone FROM {$dbTablePre}certification WHERE uid='{$userid}'", true); } if (!$status['telphone']) { MooMessage("对不起,您没有通过手机验证,请先通过验证再委托", 'index.php?n=myaccount&h=telphone', '02'); } else { $tel = $status['telphone']; } require MooTemplate('public/service_contact_sendcontact', 'module'); }
function ajax_sellsendactive() { $type = MooGetGPC('type', 'string', 'G'); $sendid = MooGetGPC('from', 'integer', 'G'); $receiveuid = MooGetGPC('to', 'integer', 'G'); if ($type == '' || $sendid == '' || $receiveuid == '' || $sendid == 0 || $receiveuid == 0) { echo 'errors'; } $nowtime = time(); $user = MooMembersData($receiveuid); $senduser = MooMembersData($sendid); /*if(MOOPHP_ALLOW_FASTDB){ $user = MooFastdbGet('members','uid',$receiveuid); $senduser = MooFastdbGet('members','uid',$sendid); }else{ $sql = "SELECT username,telphone FROM {$GLOBALS['dbTablePre']}members WHERE `uid`='".$receiveuid."'"; $user=$GLOBALS['_MooClass']['MooMySQL']->getOne($sql); $sql = "SELECT gender FROM {$GLOBALS['dbTablePre']}members WHERE `uid`='".$sendid."'"; $senduser=$GLOBALS['_MooClass']['MooMySQL']->getOne($sql); }*/ $gender = $senduser['gender'] == 1 ? "女" : "男"; switch ($type) { case 'commission': //$sql = "SELECT mid,sendtime FROM {$GLOBALS['dbTablePre']}service_contact WHERE you_contact_other='$sendid' AND other_contact_you = '$userid' and receive_del=0 and send_del=0 and is_server=0"; $sql = "SELECT * FROM {$GLOBALS['dbTablePre']}service_contact WHERE you_contact_other = '{$receiveuid}' AND other_contact_you = '{$sendid}' "; $com = $GLOBALS['_MooClass']['MooMySQL']->getOne($sql, true); if (empty($com)) { $sql = "INSERT INTO {$GLOBALS['dbTablePre']}service_contact SET `you_contact_other`='" . $receiveuid . "',`other_contact_you`='" . $sendid . "',`stat`=1,`syscheck`=1,`sendtime`='" . $nowtime . "',`is_server`=1"; $result = $GLOBALS['_MooClass']['MooMySQL']->query($sql); echo 'ok'; exit; } else { echo 'having'; exit; } //更改最后活动时间,上线 $sql = "UPDATE {$GLOBALS['dbTablePre']}members_login SET lastvisit='{$GLOBALS['timestamp']}' WHERE uid='{$sendid}'"; $GLOBALS['_MooClass']['MooMySQL']->query($sql); if (MOOPHP_ALLOW_FASTDB) { $value['lastvisit'] = $GLOBALS['timestamp']; MooFastdbUpdate('members_login', 'uid', $sendid, $value); } //发e-mail提醒(委托)-------开始//////////////////////////////////////////// include_once "./include/crontab_config.php"; $send_user_info = array_merge(MooGetData('members_choice', 'uid', $sendid), MooMembersData($sendid)); /*$send_user_info = $GLOBALS['_MooClass']['MooMySQL']->getAll("select * from `{$GLOBALS['dbTablePre']}members` a left join {$GLOBALS['dbTablePre']}choice b on a.uid=b.uid where a.uid = '$sendid'"); $send_user_info = $send_user_info[0];*/ //头像路径 $path = thumbImgPath(2, $send_user_info['pic_date'], $send_user_info['pic_name'], $send_user_info['gender']); 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 = $provice_list[$send_user_info['province']]; //省 $city = $city_list[$send_user_info['city']]; //市 $height = $send_user_info['height'] ? $height_list[$send_user_info['height']] : "未知"; //身高 ob_start(); require_once adminTemplate('mail/mail_space_commissiontpl'); $body = ob_get_clean(); MooSendMail($user['username'], "真爱一生网系统温馨提示", $body, "", false, $receiveuid); //--------->发送邮件提醒 结束/////////////////////////////////////////// //fangin暂时屏蔽 Push_message_intab($receiveuid, $user['telphone'], "委托", "尊敬的会员您好!" . $sendid . "," . $gender . ",委托我们联系您,请及时登录www.zhenaiyisheng.cc查收,把握您的缘分。【真爱一生网】", $sendid); //写日志 serverlog(3, $GLOBALS['dbTablePre'] . 'service_contact', "{$GLOBALS['adminid']}号客服{$GLOBALS['username']}在后台以会员{$sendid}的身份向{$receiveuid}会员发送委托", $GLOBALS['adminid'], $receiveuid); echo 'ok'; exit; break; case 'leer': $sql = "SELECT * FROM {$GLOBALS['dbTablePre']}service_leer WHERE senduid = '{$sendid}' AND receiveuid= '{$receiveuid}' "; $leer = $GLOBALS['_MooClass']['MooMySQL']->getOne($sql, true); if (!empty($leer)) { $lid = $leer['lid']; //note 如果已经发送过秋波,就增加发送秋波的次数 $sql = "UPDATE {$GLOBALS['dbTablePre']}service_leer SET fakenum = fakenum + 1,num = num + 1,receivenum = receivenum + 1,sendtime = '{$nowtime}',receivetime = '{$nowtime}',receive_del = '0' WHERE lid = '{$lid}'"; $GLOBALS['_MooClass']['MooMySQL']->query($sql); //note 如果已经收到这个人的秋波,已经拒绝,现在改变注意,又发送秋波给这个人,拒绝状态2更改为0 if ($leer['receive_del'] == 1 || $leer['stat'] == 2) { $sql = "UPDATE {$GLOBALS['dbTablePre']}service_leer SET stat = '0',receive_del = 0 WHERE senduid = '{$sendid}' AND receiveuid = '{$receiveuid}' AND stat = '2'"; $GLOBALS['_MooClass']['MooMySQL']->query($sql); } } else { //note 发送新的秋波,写入数据库 发送者,接受者,发送时间 $sql = "INSERT INTO {$GLOBALS['dbTablePre']}service_leer SET sendtime = '{$nowtime}',receivetime = '{$nowtime}',fakenum = '1', receivenum = '1', num = '1', senduid = '{$sendid}',receiveuid = '{$receiveuid}',is_server=1"; $GLOBALS['_MooClass']['MooMySQL']->query($sql); } //更改最后活动时间,上线 $sql = "UPDATE {$GLOBALS['dbTablePre']}members_login SET lastvisit='{$GLOBALS['timestamp']}' WHERE uid='{$sendid}'"; $GLOBALS['_MooClass']['MooMySQL']->query($sql); if (MOOPHP_ALLOW_FASTDB) { $value['lastvisit'] = $GLOBALS['timestamp']; MooFastdbUpdate('members_login', 'uid', $sendid, $value); } //发e-mail提醒(委托)-------开始//////////////////////////////////////////// include_once "./include/crontab_config.php"; $send_user_info = array_merge(MooGetData('members_choice', 'uid', $sendid), MooMembersData($sendid)); /*$send_user_info = $GLOBALS['_MooClass']['MooMySQL']->getAll("select * from `{$GLOBALS['dbTablePre']}members` a left join {$GLOBALS['dbTablePre']}choice b on a.uid=b.uid where a.uid = '$sendid'"); $send_user_info = $send_user_info[0];*/ //头像路径 $path = thumbImgPath(2, $send_user_info['pic_date'], $send_user_info['pic_name'], $send_user_info['gender']); 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 = $provice_list[$send_user_info['province']]; //省 $city = $city_list[$send_user_info['city']]; //市 $height = $send_user_info['height'] ? $height_list[$send_user_info['height']] : "未知"; //身高 ob_start(); require_once adminTemplate('mail/mail_space_leertpl'); $body = ob_get_clean(); MooSendMail($user['username'], "真爱一生网系统温馨提示", $body, "", false, $receiveuid); //--------->发送邮件提醒 结束/////////////////////////////////////////// //fangin暂时屏蔽 Push_message_intab($receiveuid, $user['telphone'], "秋波", "尊敬的会员您好!ID" . $sendid . "," . $gender . ",给您发送秋波,请及时登录www.zhenaiyisheng.cc查收,把握您的缘分。【真爱一生网】", $sendid); //写日志 serverlog(3, $GLOBALS['dbTablePre'] . 'service_leer', "{$GLOBALS['adminid']}号客服{$GLOBALS['username']}在后台以会员{$sendid}的身份向{$receiveuid}会员发送秋波", $GLOBALS['adminid'], $receiveuid); echo 'ok'; exit; break; case 'rose': $sql = "SELECT * FROM {$GLOBALS['dbTablePre']}service_rose WHERE senduid = '{$sendid}' AND receiveuid= '{$receiveuid}' "; $rose = $GLOBALS['_MooClass']['MooMySQL']->getOne($sql, true); if (!empty($rose)) { $rid = $rose['rid']; //note 如果已经发送过鲜花,就增加发送鲜花的次数 $sql = "UPDATE {$GLOBALS['dbTablePre']}service_rose SET fakenum = fakenum + 1,num = num + 1,receivenum = receivenum + 1,sendtime = '{$nowtime}',receivetime = '{$nowtime}',receive_del = '0' WHERE rid = '{$rid}'"; $GLOBALS['_MooClass']['MooMySQL']->query($sql); //note 如果用户已经将该鲜花记录删除,则要改变删除状态,不然鲜花不会在前台显示 if ($rose['receive_del'] == 1) { $sql = "UPDATE {$GLOBALS['dbTablePre']}service_leer SET receive_del = 0 WHERE senduid = '{$sendid}' AND receiveuid = '{$receiveuid}'"; $GLOBALS['_MooClass']['MooMySQL']->query($sql); } } else { //note 发送新的鲜花,写入数据库 发送者,接受者,发送时间 $sql = "INSERT INTO {$GLOBALS['dbTablePre']}service_rose SET sendtime = '{$nowtime}',receivetime = '{$nowtime}',fakenum = '1', receivenum = '1', num = '1', senduid = '{$sendid}',receiveuid = '{$receiveuid}',is_server=1"; $GLOBALS['_MooClass']['MooMySQL']->query($sql); } //更改最后活动时间,上线 $sql = "UPDATE {$GLOBALS['dbTablePre']}members_login SET lastvisit='{$GLOBALS['timestamp']}' WHERE uid='{$sendid}'"; $GLOBALS['_MooClass']['MooMySQL']->query($sql); if (MOOPHP_ALLOW_FASTDB) { $value['lastvisit'] = $GLOBALS['timestamp']; MooFastdbUpdate('members_login', 'uid', $sendid, $value); } //发e-mail提醒--->开始/////////////////////////////////// include_once "./include/crontab_config.php"; $send_user_info = array_merge(MooGetData('members_choice', 'uid', $sendid), MooMembersData($sendid)); /*$send_user_info = $GLOBALS['_MooClass']['MooMySQL']->getAll("select * from `{$GLOBALS['dbTablePre']}members` a left join {$GLOBALS['dbTablePre']}choice b on a.uid=b.uid where a.uid = '$sendid'"); $send_user_info = $send_user_info[0];*/ //头像路径 $path = thumbImgPath(2, $send_user_info['pic_date'], $send_user_info['pic_name'], $send_user_info['gender']); 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 = $provice_list[$send_user_info['province']]; //省 $city = $city_list[$send_user_info['city']]; //市 $height = $send_user_info['height'] ? $height_list[$send_user_info['height']] : "未知"; //身高 ob_start(); require_once adminTemplate('mail/mail_space_rosetpl'); $body = ob_get_clean(); MooSendMail($user['username'], "真爱一生网系统温馨提示", $body, "", false, $receiveuid); //----->发送email-->结束///////////////////////// //fangin暂时屏蔽 Push_message_intab($receiveuid, $user['telphone'], "鲜花", "尊敬的会员您好!ID" . $sendid . "," . $gender . ",给您发送鲜花,请及时登录www.zhenaiyisheng.cc查收,把握您的缘分。【真爱一生网】", $sendid); //写日志 serverlog(3, $GLOBALS['dbTablePre'] . 'service_rose', "{$GLOBALS['adminid']}号客服{$GLOBALS['username']}在后台以会员{$sendid}的身份向{$receiveuid}会员发送鲜花", $GLOBALS['adminid'], $receiveuid); echo 'ok'; exit; break; default: echo "errors"; break; } exit; }
function other_sendmail_batch_2() { global $dbTablePre, $timestamp, $_MooClass; $uid_list = MooGetGPC('uid_list', 'string', 'P'); //过滤黑名单 BEGIN BY HWT $uid_arr = explode(',', $uid_list); $uid = array(); foreach ($uid_arr as $k => $v) { $sql = "select username,uid from web_members_search where uid= {$v}"; $result = $GLOBALS['_MooClass']['MooMySQL']->getOne($sql); if (!empty($result['username'])) { $username[$k]['username'] = $result['username']; $username[$k]['uid'] = $result['uid']; } } $content = MooGetGPC('content', 'string', 'P'); $title = MooGetGPC('title', 'string', 'P'); foreach ($username as $key => $value) { MooSendMail($value['username'], $title, $content, $type = '', $is_template = true, $uid = $value['uid']); } }
function to_send_message() { global $_MooClass, $dbTablePre, $userid, $user_arr, $memcached, $timestamp, $serverid; $and_uuid = isset($_GET['uuid']) ? $_GET['uuid'] : ''; $uid = isset($_GET['uid']) ? $_GET['uid'] : ''; if ($uid) { $userid = $mem_uid = $memcached->get('uid_' . $uid); } $uuid = $memcached->get('uuid_' . $userid); //$error[] = array("getand_uuid"=>$and_uuid,"getuid"=>$uid,"userid"=>$userid,"mem_uuid"=>$uuid); $checkuuid = check_uuid($and_uuid, $userid); if (!$checkuuid) { $error = "uuid_error"; echo return_data($error, false); exit; } $user_arr = MooMembersData($userid); $contentid = MooGetGPC('s_id', 'integer', 'P'); //不可给同性别发送消息 $receive_info = MooMembersData($contentid); $receive_gender = $receive_info['gender']; if ($user_arr['gender'] == $receive_gender) { $err = "不可给同性别发送消息"; echo return_data($err, 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; }*/ $result = $_MooClass['MooMySQL']->getOne("select groupid from web_admin_user where uid='{$serverid}'"); $groupid = $result['groupid']; if ($serverid && $user_arr['usertype'] != 3) { $err = "对不起您不能模拟操作"; echo return_data($err, false); exit; } if ($serverid && $user_arr['usertype'] == 3 && !in_array($groupid, $GLOBALS['admin_aftersales'])) { $err = "对不起您不能模拟操作"; echo return_data($err, false); exit; } //如果是本站注册会员 if ($user_arr['usertype'] == 1) { $m_level = get_userrank($userid); //会员等级 if ($m_level != 1) { //不是高级会员 if (!checkIsMobileCertical($userid)) { //没有通过了手机验证 $err = "您还没有进行手机验证,请先认证"; echo return_data($err, false); exit; } else { //if(!checkIsOver($userid)){ //过了试用期 $err = "只有钻石或高级会员才可以发送电子邮件给对方"; echo return_data($err, false); exit; //} } } } //print_r($_POST); //note s_cid 发送者的权限(回复时才有) $s_cid = MooGetGPC('s_cid', 'integer', 'P'); //echo $s_cid;exit; //收件人id $sid = $contentid; //发件人id $mid = $userid; ///echo $sid;exit; $s_title = MooGetGPC('s_title', 'string', 'P'); $s_title = rtrim($s_title); //对主题字数限制 $s_title = MooStrReplace(MooCutstr($s_title, 30, $dot = '')); $s_content = MooGetGPC('s_content', 'string', 'P'); //note 特殊字符 $s_content = rtrim(MooStrReplace(safeFilter($s_content))); $send_mymessage = MooGetGPC('send_mymessage', 'integer', 'P'); $message_back = MooGetGPC('message_back', 'integer', 'P'); //note 双方屏蔽不给操作 if (MooGetScreen($mid, $sid)) { $err = "因特殊原因,消息发送失败"; echo return_data($err, false); exit; } if ($mid && $sid && $s_title && $s_content) { $m_level = get_userrank($userid); //会员等级 if ($m_level == 2 && $user_arr['usertype'] != 3) { //普通会员需要审核(除采集会员之外) //if($user_arr['gender'] == 0){ //如果是男方发的,需要审核,0表示 $send_status = $_MooClass['MooMySQL']->query("insert into {$dbTablePre}services (s_cid,s_uid,s_fromid,s_title,s_content,s_time,sid,flag) values ('{$s_cid}','{$sid}','{$mid}','{$s_title}','{$s_content}'," . time() . ",'{$user_arr['sid']}','0')"); } else { $send_status = $_MooClass['MooMySQL']->query("insert into {$dbTablePre}services (s_cid,s_uid,s_fromid,s_title,s_content,s_time,sid,flag) values ('{$s_cid}','{$sid}','{$mid}','{$s_title}','{$s_content}'," . time() . ",'{$user_arr['sid']}','1')"); } //发送短信和邮件 include_once "./module/crontab/crontab_config.php"; $res = MooMembersData($sid); // $send_user_info = $_MooClass['MooMySQL']->getAll("select * from `{$dbTablePre}members_search` a left join {$dbTablePre}members_choice b on a.uid=b.uid where a.uid = '$userid'"); $send_user_info = array_merge(MooGetData("members_choice", 'uid', $userid), MooMembersData($userid)); // $send_user_info = $send_user_info[0]; //头像路径 $path = thumbImgPath(2, $send_user_info['pic_date'], $send_user_info['pic_name'], $send_user_info['gender']); 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(); require_once MooTemplate('public/mail_space_messagetpl', 'module'); //模板 $body = ob_get_clean(); MooSendMail($res['username'], "真爱一生网系统温馨提示", $body, "", false, $sid); $week_time = 24 * 3600 * 7; //一周时间秒数 $interval_time = $timestamp - $user_arr['last_login_time']; //当前时间-最后登录时间 $date1 = date("Y-m-d", strtotime("last Monday")); $date2 = date("Y-m-d", strtotime("Sunday")); if ($interval_time > $week_time) { //不活跃用户每周发一条短信 $_MooClass['MooMySQL']->query("INSERT INTO {$dbTablePre}today_send SET uid = '" . $sid . "', sid = '" . $userid . "',phone = '" . $res['telphone'] . "',sendtime = '" . date("Y-m-d") . "'"); $cos = $_MooClass['MooMySQL']->getOne("select count(*) as c from {$dbTablePre}today_send where uid='{$sid}' and sendtime>='{$date1}' and sendtime<='{$date2}'", true); if ($cos['c'] <= 1) { //fanglin暂时屏蔽 Push_message_intab($sid, $res['telphone'], "邮件", "真爱一生网 用户ID:" . $userid . "," . $send_user_grade . ",已给您发送电子邮件,请及时到真爱一生网查看!4006780405", $userid); } } else { //活跃用户每天一条 //每天该用户超过5条信息不发送短信 $cos = $_MooClass['MooMySQL']->getOne("select count(*) as c from {$dbTablePre}today_send where uid='{$sid}' and sendtime='" . date("Y-m-d") . "'", true); if ($cos['c'] < 5) { $_MooClass['MooMySQL']->query("INSERT INTO {$dbTablePre}today_send SET uid = '" . $sid . "', sid = '" . $userid . "',phone = '" . $res['telphone'] . "',sendtime = '" . date("Y-m-d") . "'"); //fanglin暂时屏蔽 Push_message_intab($sid, $res['telphone'], '邮件', "真爱一生网 用户ID:" . $userid . "," . $send_user_grade . ",已给您发送电子邮件,请及时到真爱一生网查看!4006780405", $userid); } } //note 发送资料给接收方 if ($send_mymessage) { } //note 备份邮件操作 if ($message_back) { //note 发送MAIL时所需信息 $user = $_MooClass['MooMySQL']->getOne("select username,nickname from {$dbTablePre}members_search where uid='{$mid}'"); //note 发送MAIL时收信人的邮箱 $ToAddress = $user['username']; //note 发送MAIL时主题 $ToSubject = '提示:您在真爱一生网所发的消息备份'; //note 发送MAIL时Body内容所需信息 $username = $user['nickname']; //note 发送MAIL时Body内容所需信息 $toname = $_MooClass['MooMySQL']->getOne("select nickname from {$dbTablePre}members_search where uid='{$sid}'"); if ($username) { $ToBody = $username; } else { $ToBody = 'ID号为' . $mid . '的会员<br>'; } if ($toname['nickname']) { $ToBody .= ':您好,您于' . date('Y-m-d H:i:s', time()) . ',在真爱一生网发送电子邮件给' . $toname['nickname'] . ',内容如下:<br>'; } else { $ToBody .= ':您好,您于' . date('Y-m-d H:i:s', time()) . ',在真爱一生网发送电子邮件给ID号为' . $sid . '的会员,内容如下:<br>'; } if ($username) { $ToBody .= ' 发件人:' . $username . '<br>'; } else { $ToBody .= ' 发件人:ID号为' . $mid . '<br>'; } if ($toname['nickname']) { $ToBody .= ' 收件人:' . $toname['nickname'] . '<br>'; } else { $ToBody .= ' 收件人:ID号为' . $sid . '<br>'; } $ToBody .= ' 主题:' . $s_title . '<br>'; $ToBody .= ' 正文:<br> ' . $s_content; MooSendMail($ToAddress, $ToSubject, $ToBody, $is_template = true, $sid); } //添加成功提示信息 if ($send_status) { /*普通会员对全权会员反馈白名单*/ 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); } //提醒所属客服 $usid = $user_arr['sid']; $title = '您的会员 ' . $mid . ' 向 ' . $sid . ' 发送了邮件'; $awoketime = $timestamp + 3600; $sql_remark = "insert into {$dbTablePre}admin_remark set sid='{$usid}',title='{$title}',content='{$title}',awoketime='{$awoketime}',dateline='{$timestamp}'"; $res = $_MooClass['MooMySQL']->query($sql_remark); if ($user_arr['gender'] == 0) { //男方发的 $suc = "发送成功,真爱一生审核后对方即可以收到。"; echo return_data($suc, true); exit; } else { $suc = "发送成功"; echo return_data($suc, true); exit; } } else { $err = "发送失败"; echo return_data($err, false); exit; } } else { $err = "数据填写不完整"; echo return_data($err, false); exit; } }
if ($usercer['email'] == 'yes') { MooMessage("您已经验证过邮箱了!", "index.php?n=myaccount&h=emailindex", "03"); } } $verifycode = md5($timestamp); //note 用户密码 //$userMsg = $_MooClass['MooMySQL']->getOne("SELECT password FROM {$dbTablePre}members WHERE uid = '$uid'"); $userMsg = $user_arr; $email_message = "点击验证:<a href='" . MOOPHP_HOST . "/index.php?n=myaccount&h=verifyemail&t=" . $userMsg['password'] . "&uid=" . $uid . "&rand=" . time() . "&verifycode=" . $verifycode . "'>" . MOOPHP_HOST . "/index.php?n=myaccount&h=verifyemail&t=" . $userMsg['password'] . "&uid=" . $uid . "&rand=" . time() . "&verifycode=" . $verifycode . "</a>"; //note 会员邮箱 //$userMsg = $_MooClass['MooMySQL']->getOne("select username from {$dbTablePre}members where uid='$uid'"); $ToAddress = $userMsg['username']; $ToSubject = "请完成真爱一生网邮箱验证"; $ToBody = $email_message; //发送邮件 $end = MooSendMail($ToAddress, $ToSubject, $ToBody, '', true, $uid); if (!$end) { MooMessage("发送失败!返回至邮箱验证", "index.php?n=myaccount&h=emailindex", "01"); } else { $updatesqlarr = array('email' => $verifycode); $wheresqlarr = array('uid' => $uid); updatetable('certification', $updatesqlarr, $wheresqlarr); if (MOOPHP_ALLOW_FASTDB) { $val = array(); $val['email'] = $verifycode; MooFastdbUpdate('certification', 'uid', $uid, $val); //!! } MooMessage("发送成功!请前往您的邮箱完成邮箱验证", "index.php?n=myaccount&h=emailindex", "05"); } } else {