function certification($key, $val, $uid) { global $_MooClass, $dbTablePre; $sql = "select count(*) as a from {$dbTablePre}certification where uid='{$uid}' "; $r = $_MooClass['MooMySQL']->getone($sql, true); if ($r[a] == 0) { $sql = " insert into {$dbTablePre}certification (uid,{$key}) values('{$uid}','{$val}')"; } else { $sql = "update {$dbTablePre}certification set {$key}='{$val}' where uid='{$uid}' "; } $_MooClass['MooMySQL']->query($sql); if (MOOPHP_ALLOW_FASTDB) { $cert_arr = array('uid' => $uid, $key => $val); MooFastdbUpdate('certification', 'uid', $uid, $cert_arr); } // 更新诚信值 reset_integrity($uid); }
<?php /* *更新用户的诚信值 * //reset_integrity_all.php?s=启动记录行&end=结束记录行 */ require "./framwork/MooPHP.php"; if(!isset($_GET['s'])) exit; $start = (int)$_GET['s']; $end = isset($_GET['end']) ? (int)$_GET['end'] : 0 ; //$length = 100; //reset_integrity('100012');exit; $sql = "select `uid`,`s_cid`,`images_ischeck` from web_members_search limit {$start},1000"; $re = $_MooClass['MooMySQL']->getAll($sql); if($re){ foreach($re as $r){ reset_integrity($r); } $start += 1000; if($end && $start >= $end){ exit("成功更新到$end条记录。"); } exit('<html><head><meta http-equiv="refresh" content="2;url=?s='.$start.'&sid='.$sid.'&end='.$end.'"> </head><body></body></html>'); }else{ exit("ok"); } ?>
function set_info_vote($tc_id) { global $userid; $votes = array(); //跟新members_action,用于算诚信值 $ordid = date('YmdHis') . rand(1111, 9999); $r = $GLOBALS['_MooClass']['MooMySQL']->getOne("select count(*) as c from {$GLOBALS['dbTablePre']}members_action where uid='{$userid}'", true); if ($r['c']) { $GLOBALS['_MooClass']['MooMySQL']->query("update {$GLOBALS['dbTablePre']}members_action set lovetest='{$ordid}' where uid='{$userid}'"); } else { $GLOBALS['_MooClass']['MooMySQL']->query("insert into {$GLOBALS['dbTablePre']}members_action (uid,lovetest) values('{$userid}','{$ordid}')"); } //更新诚信值 reset_integrity($userid); $sql = "SELECT SUM(scores) AS scores,`ctype` FROM {$GLOBALS['dbTablePre']}test_vote \n\t\t\tWHERE `uid`='{$userid}' AND `tc_id`='{$tc_id}' \n\t\t\tGROUP BY `ctype` "; $votes = $GLOBALS['_MooClass']['MooMySQL']->getAll($sql); $scores_count = 0; foreach ($votes as $vo) { //小类型 $scores_count += $vo['scores']; $sql = "SELECT `id` FROM {$GLOBALS['dbTablePre']}test_result \n\t\t\tWHERE `tc_id`='{$tc_id}' \n\t\t\t\tAND `rtype`='{$vo['ctype']}' \n\t\t\t\tAND `st_scores` <= {$vo['scores']}\n\t\t\t\tAND `ed_scores` >= {$vo['scores']} "; $temp = $GLOBALS['_MooClass']['MooMySQL']->getOne($sql); if (!empty($temp)) { $sql = "INSERT INTO {$GLOBALS['dbTablePre']}test_member \n\t\t\t\t(`uid`,`tc_id`,`scores_count`,`ctype`,`result_id`) \n\t\t\t\tVALUES ('{$userid}','{$tc_id}','{$vo['scores']}','{$vo['ctype']}','{$temp['id']}')"; //echo $sql; $GLOBALS['_MooClass']['MooMySQL']->query($sql); } } $sql = "SELECT `id` FROM {$GLOBALS['dbTablePre']}test_result \n\t\tWHERE `tc_id`='{$tc_id}' \n\t\t\tAND `rtype`='{$tc_id}' \n\t\t\tAND `st_scores` <= {$scores_count}\n\t\t\tAND `ed_scores` >= {$scores_count} "; $temp = $GLOBALS['_MooClass']['MooMySQL']->getOne($sql); $sql = "INSERT INTO {$GLOBALS['dbTablePre']}test_member \n\t\t\t(`uid`,`tc_id`,`scores_count`,`ctype`,`result_id`) \n\t\t\tVALUES ('{$userid}','{$tc_id}','{$scores_count}','{$tc_id}','{$temp['id']}')"; //echo $sql; $GLOBALS['_MooClass']['MooMySQL']->query($sql); return $votes; }
function check_paper() { $sid = $GLOBALS['adminid']; $type = MooGetGPC('type', 'string') == '' ? 'list' : MooGetGPC('type', 'string'); $usersid = MooGetGPC('usersid', 'string', 'G'); //makui $lei = "会员证件审核"; $uid = MooGetGPC('uid', 'integer'); $id = MooGetGPC('id', 'integer'); $checkArr = array(1 => '审核通过', 0 => '审核未通过'); $check = MooGetGPC('check', 'integer', 'G'); switch ($type) { case 'list': $paper_type = MooGetGPC('paper_type', 'string'); $type_as = MooGetGPC('typeas', 'integer'); //note 获得当前url $currenturl = "index.php?action=check&h=paper"; $currenturl2 = preg_replace("/(&page=\\d+)/", "", $currenturl); $page = get_page(); $prepage = 20; $start = ($page - 1) * $prepage; //所管理的客服id列表 $myservice_idlist = get_myservice_idlist(); if (empty($myservice_idlist)) { $sql_where .= " b.sid IN({$GLOBALS['adminid']}) AND "; } elseif ($myservice_idlist == 'all') { if (isset($_GET['usersid'])) { $sql_where = " b.sid='{$usersid}' AND"; } //查看某一客服的会员 //all为客服主管能查看所有的 } else { $sql_where .= " b.sid IN({$myservice_idlist}) AND "; if (isset($_GET['usersid'])) { $sql_where .= " b.sid='{$usersid}' AND"; } //查看某一客服的会员 } $n = 0; if ($uid > 0) { $sql_where .= " b.uid=" . $uid . " AND "; $n++; } if (!empty($paper_type) && $type_as > 0) { $sql_where .= "a." . $paper_type . "_check=" . $type_as . " AND "; $currenturl2 = "index.php?action=check&h=paper&paper_type=" . $paper_type . "&typeas=" . $type_as; $n++; } if ($n == 0) { $sql_where .= "(a.identity_check = 2 or a.marriage_check = 2 or a.education_check = 2 or a.occupation_check = 2 or a.salary_check = 2 or a.house_check = 2 or a.video_check = 2) and "; } $total_count = $GLOBALS['_MooClass']['MooMySQL']->getOne("SELECT count(1) as c FROM {$GLOBALS['dbTablePre']}certification AS a JOIN {$GLOBALS['dbTablePre']}members AS b WHERE {$sql_where} a.uid=b.uid"); $total = $total_count['c']; $pageLists = multipage($total, $prepage, $page, $currenturl2); $list = $GLOBALS['_MooClass']['MooMySQL']->getAll("SELECT a.*,b.nickname,b.birthyear,b.sid,b.gender FROM {$GLOBALS['dbTablePre']}certification AS a JOIN {$GLOBALS['dbTablePre']}members AS b WHERE {$sql_where} b.uid=a.uid ORDER BY b.last_login_time DESC LIMIT {$start},{$prepage}"); //echo ("SELECT a.*,b.nickname,b.birthyear,b.gender FROM {$GLOBALS['dbTablePre']}certification AS a JOIN {$GLOBALS['dbTablePre']}members AS b WHERE {$sql_where} a.uid=b.uid ORDER BY b.last_login_time DESC LIMIT $start,$prepage"); require adminTemplate("check_certification"); break; case 'show': $mintype = MooGetGPC('mintype', 'string'); $paper = $GLOBALS['_MooClass']['MooMySQL']->getOne("SELECT a.{$mintype} as mintype,b.birthyear,b.gender FROM {$GLOBALS['dbTablePre']}certification as a join {$GLOBALS['dbTablePre']}members as b WHERE a.uid=b.uid and a.uid='{$uid}'"); serverlog(1, $dbTablePre . $GLOBALS['username'] . "certification", "查询会员认证", $GLOBALS['adminid']); require adminTemplate("check_show"); break; case 'submit': $is_pass = MooGetGPC('pass', 'string'); $is_onpass = MooGetGPC('nopass', 'string'); if ($is_onpass) { $mintype = MooGetGPC('mintype', 'string'); $checktype = $mintype . "_check"; $paperimagessrc = MooGetGPC('paperimagessrc', 'string'); $GLOBALS['_MooClass']['MooMySQL']->query("UPDATE {$GLOBALS['dbTablePre']}certification SET {$checktype}=4 WHERE `uid`='{$uid}'"); if (MOOPHP_ALLOW_FASTDB) { $value[$checktype] = 4; MooFastdbUpdate('certification', 'uid', $uid, $value); } serverlog(2, $dbTablePre . "certification", $GLOBALS['username'] . "未通过用户的证件认证" . $uid, $GLOBALS['adminid'], $uid); sendusermessage($uid, "您的证件图片不符合要求,请您按要求进行操作", "证件审核"); salert('证件审核不通过'); } elseif ($is_pass) { $mintype = MooGetGPC('mintype', 'string'); $checktype = $mintype . "_check"; $GLOBALS['_MooClass']['MooMySQL']->query("UPDATE {$GLOBALS['dbTablePre']}certification SET {$checktype}=3 WHERE `uid`='{$uid}'"); if (MOOPHP_ALLOW_FASTDB) { $value[$checktype] = 3; MooFastdbUpdate('certification', 'uid', $uid, $value); } serverlog(3, $dbTablePre . "certification", $GLOBALS['username'] . "通过用户的证件认证" . $uid, $GLOBALS['adminid'], $uid); sendusermessage($uid, "您的证件图片已经过红娘的审核,您还可以继续上传您的其他证件照片,以提高您的诚信度", "证件图片审核"); //更新诚信值 reset_integrity($uid); salert('审核证件图片成功'); } echo "<script>window.history.go(-2);</script>"; break; } }
function ajax_contact() { $uid = MooGetGPC('uid', 'integer', 'G'); $tel = MooGetGPC('tel', 'string', 'G'); $tel2 = MooGetGPC('tel2', 'string', 'G'); $type = MooGetGPC('type', 'integer', 'G'); $from = MooGetGPC('from', 'string'); $to = MooGetGPC('to', 'string'); $ispost = MooGetGPC('ispost', 'integer', 'P'); //拨打电话 if ($type == 1) { } //note 发短信 if ($type == 2) { $page = max(1, MooGetGPC('page', 'integer', 'G')); $limit = 10; $offset = ($page - 1) * $limit; $gopage = MooGetGPC('gopage', 'integer', 'G'); if ($ispost) { $mes = MooGetGPC('tel_message', 'string', 'P'); $dateline = time(); $dateline2 = $dateline + 300; //$sql1="SELECT * FROM {$GLOBALS['dbTablePre']}smslog where uid='$uid' and content='$mes' and sendtime<'$dateline2'"; //error_log($sql1); // $msg_inf = $GLOBALS['_MooClass']['MooMySQL']->query($sql1); // $msg_num = $GLOBALS['_MooClass']['MooMySQL']->numRows($msg_inf); //$msg_inf = $GLOBALS['_MooClass']['MooMySQL']->getAll($sql1); //$msg_num = sizeof($msg_inf); $mes_ = $mes; //error_log($msg_num); //if($msg_num<1){ $ret = SendMsg($tel, $mes_); if ($ret !== false) { $sql = "INSERT INTO {$GLOBALS['dbTablePre']}smslog(sid,uid,content,sendtime) VALUES('{$GLOBALS['adminid']}','{$uid}','{$mes}','{$dateline}')"; $sid = $GLOBALS['_MooClass']['MooMySQL']->query($sql); echo 1; } else { echo 0; } //写日志 serverlog(3, $GLOBALS['dbTablePre'] . 'smslog', "{$GLOBALS['adminid']}号客服{$GLOBALS['username']}向会员{$uid}发送短信{$sid}", $GLOBALS['adminid'], $uid); exit; //}else echo "你已经发过两条同样的短信了!"; } $sql = "SELECT * FROM {$GLOBALS['dbTablePre']}smspre WHERE target = {$GLOBALS['adminid']} OR target = 0 LIMIT {$offset},{$limit}"; $sms = $GLOBALS['_MooClass']['MooMySQL']->getAll($sql, 0, 0, 0, true); $total = getcount('smspre', "WHERE target = {$GLOBALS['adminid']} OR target = 0"); $pages = ceil($total / $limit); if ($gopage) { foreach ($sms as $k => $v) { $content = str_replace('[adminid]', $GLOBALS['adminid'], $v['content']); preg_match("/\\[smstitle\\](.+?)\\[\\/smstitle\\]/isU", $content, $matche1); preg_match("/\\[\\/smstitle\\](.+?)/isU", $content, $matche2); if ($matche1[1]) { echo '<div style="padding:3px; cursor:pointer;" onclick="selectThis(' . (($page - 1) * $limit + $k + 1) . ');">' . (($page - 1) * $limit + $k + 1) . '.<font color="#0033CC">' . $matche1[1] . '</font><span id="sms_content_' . (($page - 1) * $limit + $k + 1) . '">' . $matche2[1] . '</span></div>'; } else { echo '<div style="padding:3px; cursor:pointer;" onclick="selectThis(' . (($page - 1) * $limit + $k + 1) . ');">' . (($page - 1) * $limit + $k + 1) . '.<span id="sms_content_' . (($page - 1) * $limit + $k + 1) . '">' . $content . '</span></div>'; } } exit; } } //note 发站内信 if ($type == 3 && $ispost) { $from = MooGetGPC('from', 'string', 'P'); $uid = $to ? $to : $uid; $title = MooGetGPC('title', 'string', 'P'); $content = MooGetGPC('content', 'string', 'P'); $filename = trim(MooGetGPC('filename', 'string', 'P')); $newfilename = trim(MooGetGPC('newfilename', 'string', 'P')); $filesize = trim(MooGetGPC('filesize', 'string', 'P')); $sendmsg = MooGetGPC('sendmsg', 'integer', 'P'); //是否短信提醒 $time = time(); if ($from) { $sql = "SELECT s_cid FROM {$GLOBALS['dbTablePre']}members_search WHERE uid = '{$from}'"; $ret = $GLOBALS['_MooClass']['MooMySQL']->getOne($sql, true); if (empty($ret['s_cid'])) { $mlevel = 2; } else { $mlevel = $ret['s_cid']; } } else { $from = $GLOBALS['adminid']; $mlevel = 3; } //note 如果上传附件,做相应处理 $file_sql1 = ''; $file_sql2 = ''; if ($filename && $newfilename && $filesize) { $file_sql1 = ",filename,newfilename,filesize"; $file_sql2 = ",'{$filename}','{$newfilename}','{$filesize}'"; } $sql = "INSERT INTO {$GLOBALS['dbTablePre']}services(s_cid,s_uid,s_fromid,s_title,s_content,s_time,is_server,sid,flag {$file_sql1})\n VALUES({$mlevel},{$uid},'{$from}','{$title}','{$content}','{$time}','1','1','1' {$file_sql2})"; $ret = $GLOBALS['_MooClass']['MooMySQL']->query($sql); $sql = "SELECT username,telphone,sid FROM {$GLOBALS['dbTablePre']}members_search WHERE uid='{$uid}'"; $user = $GLOBALS['_MooClass']['MooMySQL']->getOne($sql, true); //发站内信,勾选则短信提醒 if ($sendmsg == 1) { if (!empty($user['telphone'])) { $mes = '真爱一生网 有人已给您发送电子邮件,请及时到真爱一生网www.zhenaiyisheng.cc查看!4008787920(免长途)'; //fangin暂时屏蔽 Push_message_intab($uid, $tel['telphone'], "邮件", $mes, "system"); //$sendmsg_ret = siooSendMsg($tel['telphone'], $mes); /*$dateline = time(); if( $sendmsg_ret ){ $sql = "INSERT INTO {$GLOBALS['dbTablePre']}smslog(sid,uid,content,sendtime) VALUES('{$GLOBALS['adminid']}','{$uid}','{$mes}','{$dateline}')"; $GLOBALS['_MooClass']['MooMySQL']->query($sql); }*/ } } //发e-mail提醒(站内信)-------开始////////////////////////////////////////////????????? include_once "./include/crontab_config.php"; //$members_search = MooMembersData($from); //$members_choice = MooGetData('members_choice', 'uid', $from); $send_user_info = array_merge((array) MooGetData('members_choice', 'uid', $from), (array) MooMembersData($from)); /*$send_user_info = $GLOBALS['_MooClass']['MooMySQL']->getAll("select * from `{$GLOBALS['dbTablePre']}members_search` a left join {$GLOBALS['dbTablePre']}members_choice b on a.uid=b.uid where a.uid = '$from'"); $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 = isset($provice_list[$send_user_info['province']]) ? $provice_list[$send_user_info['province']] : ''; //省 $city = isset($city_list[$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 adminTemplate('mail/mail_space_commissiontpl'); $body = ob_get_clean(); MooSendMail($user['username'], "真爱一生网系统温馨提示", $body, "", false, $uid); //--------->发送邮件提醒 结束/////////////////////////////////////////// if ($ret) { echo 1; } else { echo 0; } //写日志 serverlog(3, $GLOBALS['dbTablePre'] . 'services', "{$GLOBALS['adminid']}号客服{$GLOBALS['username']}向会员{$uid}发送站内信", $GLOBALS['adminid'], $uid); exit; } //note 会员认证 if ($type == 4) { $change = MooGetGPC('change', 'string', 'G'); $a = MooGetGPC('a', 'integer', 'G'); $str = $a ? '已通过' : '未通过'; //note 下面判断的作用是防止certification表中无该会员的记录,导致认证失败 $sql = "SELECT uid FROM {$GLOBALS['dbTablePre']}certification WHERE uid = {$uid}"; $ret = $GLOBALS['_MooClass']['MooMySQL']->getOne($sql, true); if (empty($ret)) { $sql = "INSERT INTO {$GLOBALS['dbTablePre']}certification(uid) VALUE({$uid})"; $GLOBALS['_MooClass']['MooMySQL']->query($sql); if (MOOPHP_ALLOW_FASTDB) { $value['lastvisit'] = $GLOBALS['timestamp']; MooFastdbUpdate('members_login', 'uid', $sendid, $value); } } switch ($change) { case 'telphone': if ($a) { $sql = "SELECT telphone FROM {$GLOBALS['dbTablePre']}members_search WHERE uid = {$uid}"; $user = $GLOBALS['_MooClass']['MooMySQL']->getOne($sql, true); if (empty($user['telphone'])) { $telphone = '12345678900'; } else { $telphone = $user['telphone']; } } else { $telphone = ''; } $sql = "UPDATE {$GLOBALS['dbTablePre']}certification SET telphone = '{$telphone}' WHERE uid = {$uid}"; $ret = $GLOBALS['_MooClass']['MooMySQL']->query($sql); //if(MOOPHP_ALLOW_FASTDB){MooFastdbUpdate('certification','uid',$uid);} if (MOOPHP_ALLOW_FASTDB) { //$value = $GLOBALS['_MooClass']['MooMySQL']->getOne("SELECT * FROM {$GLOBALS['dbTablePre']}certification WHERE `uid`='{$uid}' LIMIT 1"); $value = array(); $value['telphone'] = $telphone; MooFastdbUpdate("certification", 'uid', $uid, $value); } reset_integrity($uid); //写日志 serverlog(2, $GLOBALS['dbTablePre'] . 'certification', "{$GLOBALS['adminid']}号客服{$GLOBALS['username']}将会员{$uid}的手机认证修改为{$str}", $GLOBALS['adminid'], $uid); echo $ret ? 'ok' : 'error'; exit; break; case 'sms': $sql = "UPDATE {$GLOBALS['dbTablePre']}certification SET sms = {$a} WHERE uid = {$uid}"; $ret = $GLOBALS['_MooClass']['MooMySQL']->query($sql); //if(MOOPHP_ALLOW_FASTDB){MooFastdbUpdate('certification','uid',$uid);} if (MOOPHP_ALLOW_FASTDB) { //$value = $GLOBALS['_MooClass']['MooMySQL']->getOne("SELECT * FROM {$GLOBALS['dbTablePre']}certification WHERE `uid`='{$uid}' LIMIT 1"); $value = array(); $value['sms'] = $a; MooFastdbUpdate("certification", 'uid', $uid, $value); } reset_integrity($uid); //写日志 serverlog(2, $GLOBALS['dbTablePre'] . 'certification', "{$GLOBALS['adminid']}号客服{$GLOBALS['username']}将会员{$uid}的身份通认证修改为{$str}", $GLOBALS['adminid'], $uid); echo $ret ? 'ok' : 'error'; exit; break; case 'email': $e = $a ? 'yes' : ''; $sql = "UPDATE {$GLOBALS['dbTablePre']}certification SET email = '{$e}' WHERE uid = {$uid}"; $ret = $GLOBALS['_MooClass']['MooMySQL']->query($sql); //if(MOOPHP_ALLOW_FASTDB){MooFastdbUpdate('certification','uid',$uid);} if (MOOPHP_ALLOW_FASTDB) { //$value = $GLOBALS['_MooClass']['MooMySQL']->getOne("SELECT * FROM {$GLOBALS['dbTablePre']}certification WHERE `uid`='{$uid}' LIMIT 1"); $value = array(); $value['email'] = $e; MooFastdbUpdate("certification", 'uid', $uid, $value); } reset_integrity($uid); //写日志 serverlog(2, $GLOBALS['dbTablePre'] . 'certification', "{$GLOBALS['adminid']}号客服{$GLOBALS['username']}将会员{$uid}的邮箱认证修改为{$str}", $GLOBALS['adminid'], $uid); echo $ret ? 'ok' : 'error'; exit; break; default: if (empty($change)) { break; } $v = $a ? 3 : 1; if ($change == 'video') { $change2 = '视频'; } elseif ($change == 'house') { $change2 = '房产'; } elseif ($change == 'salary') { $change2 = '工资'; } elseif ($change == 'occupation') { $change2 = '工作'; } elseif ($change == 'education') { $change2 = '学历'; } elseif ($change == 'marriage') { $change2 = '婚育'; } elseif ($change == 'identity') { $change2 = '身份证'; } $sql = "UPDATE {$GLOBALS['dbTablePre']}certification SET {$change}_check = {$v} WHERE uid = {$uid}"; $ret = $GLOBALS['_MooClass']['MooMySQL']->query($sql); //if(MOOPHP_ALLOW_FASTDB){MooFastdbUpdate('certification','uid',$uid);} if (MOOPHP_ALLOW_FASTDB) { //$value = array(); $value[$change . "_check"] = $v; MooFastdbUpdate("certification", 'uid', $uid, $value); } reset_integrity($uid); //写日志 serverlog(2, $GLOBALS['dbTablePre'] . 'certification', "{$GLOBALS['adminid']}号客服{$GLOBALS['username']}将会员{$uid}的{$change2}认证修改为{$str}", $GLOBALS['adminid'], $uid); echo $ret ? 'ok' : 'error'; exit; break; } $sql = "SELECT * FROM {$GLOBALS['dbTablePre']}certification WHERE uid = {$uid}"; $cert = $GLOBALS['_MooClass']['MooMySQL']->getOne($sql, true); } //note 发彩信北京易速彩信 /*if($type ==5){ //header("Content-Type: text/html; charset=utf-8"); $page = max(1,MooGetGPC('page','integer','G')); $limit = 10; $offset = ($page-1)*$limit; $gopage = MooGetGPC('gopage','integer','G'); if($ispost){ $mes = MooGetGPC('tel_message','string','P'); $title = MooGetGPC('title','string','P'); $pic_id=MooGetGPC('pic_id','string','P'); $pic_name=($pic_id*3)."_medium.jpg"; $pic_path="./../data/upload/userimg/"; $user_pic=$pic_path.$pic_name; $dateline = time(); $dateline2=$dateline+300; $sql1="SELECT * FROM {$GLOBALS['dbTablePre']}mmslog where uid='$uid' and title='$title' and content='$mes' and sendtime<'$dateline2'"; //error_log($sql1); $msg_inf = $GLOBALS['_MooClass']['MooMySQL']->query($sql1); $msg_num=$GLOBALS['_MooClass']['MooMySQL']->numRows($msg_inf); //error_log($msg_num); if($msg_num<2){ $mes_64=base64_encode($mes); $pic_64=base64_encode(file_get_contents($user_pic)); $content="1,txt,$mes_64;2,jpg,$pic_64"; $ret = send_mms($title,$tel,$content); if( $ret == "ok"){ $sql = "INSERT INTO {$GLOBALS['dbTablePre']}mmslog(sid,uid,title,content,sendtime) VALUES('{$GLOBALS['adminid']}','{$uid}','{$title}','{$mes}','{$dateline}')"; $sid = $GLOBALS['_MooClass']['MooMySQL']->query($sql); echo 1; }else{ echo 0; } //写日志 serverlog(3,$GLOBALS['dbTablePre'].'mmslog',"{$GLOBALS['adminid']}号客服{$GLOBALS['username']}向会员{$uid}发送彩信{$sid}",$GLOBALS['adminid'],$uid); exit; }else echo "你已经发过两条同样的彩信了!"; } $sql = "SELECT * FROM {$GLOBALS['dbTablePre']}mmspre WHERE user = {$GLOBALS['adminid']} OR user = 0 LIMIT {$offset},{$limit}"; $sms = $GLOBALS['_MooClass']['MooMySQL']->getAll($sql); $total = getcount('mmspre',"WHERE user = {$GLOBALS['adminid']} OR user = 0"); $pages = ceil($total/$limit); if( $gopage ){ foreach( $sms as $k=>$v){ $content = str_replace('[adminid]',$GLOBALS['adminid'],$v['content']); preg_match("/\[smstitle\](.+?)\[\/smstitle\]/isU",$content,$matche1); preg_match("/\[\/smstitle\](.+?)/isU",$content,$matche2); if ($matche1[1]){ echo '<div style="padding:3px; cursor:pointer;" onclick="selectThis('.(($page-1)*$limit+$k+1).');">'.(($page-1)*$limit+$k+1).'.<font color="#0033CC">'.$matche1[1].'</font><span id="sms_content_'.(($page-1)*$limit+$k+1).'">'.$matche2[1].'</span></div>'; }else{ echo '<div style="padding:3px; cursor:pointer;" onclick="selectThis('.(($page-1)*$limit+$k+1).');">'.(($page-1)*$limit+$k+1).'.<span id="sms_content_'.(($page-1)*$limit+$k+1).'">'.$content.'</span></div>'; } } exit; } }*/ if ($type == 5) { //上海亿美彩信 //header("Content-Type: text/html; charset=GB2312"); $page = max(1, MooGetGPC('page', 'integer', 'G')); $limit = 10; $offset = ($page - 1) * $limit; $gopage = MooGetGPC('gopage', 'integer', 'G'); if ($ispost) { $dateline = time(); $dateline2 = $dateline + 300; $today = mktime(0, 0, 0, date('m', time()), date('d', time()), date('Y', time())); $mes = MooGetGPC('tel_message', 'string', 'P'); $title = MooGetGPC('title', 'string', 'P'); $tel_message = $mes; $sql1 = "SELECT * FROM {$GLOBALS['dbTablePre']}mmslog where uid='{$uid}' and title='{$title}' and content='{$mes}' and sendtime<'{$dateline2}'"; echo $sql1; $msg_inf = $GLOBALS['_MooClass']['MooMySQL']->query($sql1); $msg_num = $GLOBALS['_MooClass']['MooMySQL']->numRows($msg_inf); $sql2 = "SELECT count(1) as num from {$GLOBALS['dbTablePre']}mmslog where sid='{$GLOBALS['adminid']}' and sendtime<'{$dateline}' and sendtime>'{$today}'"; $today_sendnum = $GLOBALS['_MooClass']['MooMySQL']->getOne($sql2, true); if ($today_sendnum['num'] > 30) { echo "你今天已经发送30条了,不可以再发送彩信了!请节约使用。"; exit; } //echo $msg_num;exit; if ($msg_num < 2) { include "include/crontab_config.php"; $pic_path = "./../data/upload/userimg/"; $file_path = "data/upload"; $mes = iconv("UTF-8", "gb2312", "{$mes}"); $mkdirs = MooAutoLoad('MooFiles'); $image = MooAutoLoad('MooImage'); $pic_id_list = MooGetGPC('pic_id', 'string', 'P') . "0"; $user_image_list = MooGetGPC('image_list', 'string', 'P'); $user_image_arr = explode(",", $user_image_list); $sql = "SELECT m.uid,m.nickname,m.province,m.city,m.gender,m.pic_name,m.birthyear,c.age1,c.age2,c.workprovince,c.workcity FROM {$GLOBALS['dbTablePre']}members_search m left join {$GLOBALS['dbTablePre']}members_choice c on m.uid=c.uid WHERE m.uid in ({$pic_id_list})"; $userinfo_arr = $GLOBALS['_MooClass']['MooMySQL']->getAll($sql, 0, 0, 0, true); $file_name_smil = 'temp' . time() . rand(10000, 99999); $file_array = $file_path . "/" . $file_name_smil . ".smil," . $file_path . "/" . $file_name_smil . ".txt"; foreach ($userinfo_arr as $key => $userinfo) { $file_name = 'temp' . time() . rand(10000, 99999) . $key; $need_del_file[] = $file_name; $nickname1 = "昵称:" . $userinfo['nickname']; $nickname = iconv("UTF-8", "gb2312", "{$nickname1}"); $txt = " ID:" . $userinfo['uid'] . "(" . (gmdate('Y', time()) - $userinfo['birthyear']) . "岁),居住在" . ($provice_list[$userinfo['province']] || $city_list[$userinfo['city']] ? $provice_list[$userinfo['province']] . $city_list[$userinfo['city']] : "未填") . "的" . ($userinfo['gender'] ? '女士' : '男士') . "寻找一位年龄在" . $userinfo['age1'] . "-" . $userinfo['age2'] . "岁,居住" . ($provice_list[$userinfo['workprovince']] || $city_list[$userinfo['workcity']] ? $provice_list[$userinfo['workprovince']] . $city_list[$userinfo['workcity']] : "未填") . "的" . ($userinfo['gender'] ? '男士' : '女士'); $txt1 = iconv("UTF-8", "gb2312", "{$txt}"); $txt = $nickname . $txt1; $mkdirs->fileWrite($file_path . "/" . $file_name . ".txt", $txt); $pic_name_old = MooGetphotoAdmin($userinfo['uid'], 'medium'); $pic_only_name = $userinfo['uid'] * 3 . "_medium.gif"; $image->config(array('thumbDir' => $file_path . '/', 'thumbStatus' => '1', 'saveType' => '0', 'thumbName' => $pic_only_name, 'waterMarkMinWidth' => '100', 'waterMarkMinHeight' => '125', 'waterMarkStatus' => 9)); $image->thumb('100', '125', $pic_name_old); $pic_name_file = $file_path . '/' . $pic_only_name; $pic = 'http://www.zhenaiyisheng.cc/' . $pic_name_old; $pic = file_get_contents($pic); file_put_contents($pic_name_file, $pic); //echo $pic_name_file;exit; //$pic_name="5226417_mid.jpg"; $par = $par . '<par dur="50000ms"><img src="' . $pic_only_name . '" region="Image" /><text src="' . $file_name . '.txt" region="Text" /></par>'; $file_array = $file_array . "," . $file_path . "/" . $file_name . ".txt," . $pic_name_file; foreach ($user_image_arr as $key => $user_image) { if ($user_image) { //$image_only_name=substr($user_image,45,36); $image_only_name = $file_name . $key . ".gif"; list($width, $height) = getimagesize(".." . $user_image); $d = $width / $height; $c = 85 / 100; if ($d < $c) { $thumb1_width = 85; $b = $width / $thumb1_width; $thumb1_height = $height / $b; } else { $thumb1_height = 100; $b = $height / $thumb1_height; $thumb1_width = $width / $b; } $big_path = $file_path . '/'; $image->config(array('thumbDir' => $big_path, 'thumbStatus' => '1', 'saveType' => '0', 'thumbName' => $image_only_name, 'waterMarkMinWidth' => '82', 'waterMarkMinHeight' => '114', 'waterMarkStatus' => 9)); $image->thumb($thumb1_height, $thumb1_width, '..' . $user_image); $need_product_img[] = $big_path . $image_only_name; $file_array = $file_array . "," . $file_path . '/' . $image_only_name; $par = $par . '<par dur="50000ms"><img src="' . $image_only_name . '" region="Image" /></par>'; } } } $mkdirs->fileWrite($file_path . "/" . $file_name_smil . ".txt", $mes); $user_pic = $pic_path; $smil = '<smil xmlns="http://www.w3.org/2000/SMIL20/CR/Language"><head><layout><root-layout width="208" height="176" /><region id="Image" left="0" top="0" width="128" height="128" fit="hidden" /><region id="Text" left="0" top="50" width="128" height="128" fit="hidden" /></layout></head><body><par dur="50000ms"><text src="' . $file_name_smil . '.txt" region="Text" /></par>' . $par . '</body></smil>'; $mkdirs->fileWrite($file_path . "/" . $file_name_smil . ".smil", $smil); require 'include/pclzip_new.lib.php'; $archive = new PclZip($file_path . "/" . $file_name_smil . '.zip'); $v_list = $archive->create($file_array, PCLZIP_OPT_REMOVE_ALL_PATH); if ($v_list == 0) { die("Error : " . $archive->errorInfo(true)); } $file_size = filesize($file_path . "/" . $file_name_smil . '.zip'); if ($file_size > 45 * 1024) { echo "文件过打,请删除部分图片"; $mkdirs->fileDelete($file_path . "/" . $file_name_smil . '.zip'); $mkdirs->fileDelete($file_path . "/" . $file_name_smil . '.txt'); $mkdirs->fileDelete($file_path . "/" . $file_name_smil . '.smil'); $mkdirs->fileDelete($file_path . "/" . $pic_only_name); if ($need_del_file) { foreach ($need_del_file as $del_file) { $mkdirs->fileDelete($file_path . "/" . $del_file . '.txt'); } } if ($need_product_img) { foreach ($need_product_img as $del_img) { $mkdirs->fileDelete($del_img); } } exit; } $ret = send_mms_yimei($title, $tel, $file_name_smil . '.zip'); $ret_ok = substr($ret, 0, 2); if ($ret_ok == "OK") { $sql = "INSERT INTO {$GLOBALS['dbTablePre']}mmslog(sid,uid,title,content,sendtime,id_list) VALUES('{$GLOBALS['adminid']}','{$uid}','{$title}','{$tel_message}','{$dateline}','{$pic_id_list}')"; $sid = $GLOBALS['_MooClass']['MooMySQL']->query($sql); echo 1; } else { echo 0; } $mkdirs->fileDelete($file_path . "/" . $file_name_smil . '.zip'); $mkdirs->fileDelete($file_path . "/" . $file_name_smil . '.txt'); $mkdirs->fileDelete($file_path . "/" . $file_name_smil . '.smil'); $mkdirs->fileDelete($file_path . "/" . $pic_only_name); if ($need_del_file) { foreach ($need_del_file as $del_file) { $mkdirs->fileDelete($file_path . "/" . $del_file . '.txt'); } } if ($need_product_img) { foreach ($need_product_img as $del_img) { $mkdirs->fileDelete($del_img); } } //写日志 serverlog(3, $GLOBALS['dbTablePre'] . 'mmslog', "{$GLOBALS['adminid']}号客服{$GLOBALS['username']}向会员{$uid}发送彩信{$sid}", $GLOBALS['adminid'], $uid); exit; } else { echo "你已经发过两条同样的彩信了!"; exit; } } $sql = "SELECT count(distinct senduid) as num FROM {$GLOBALS['dbTablePre']}service_rose where receiveuid='{$uid}' and receive_del=0 and send_del=0"; $send_rose = $GLOBALS['_MooClass']['MooMySQL']->getOne($sql, true); //$sql="SELECT count(1) as num FROM {$GLOBALS['dbTablePre']}service_leer where receiveuid='{$uid}' and receive_del=0 and send_del=0 and is_server=0"; //$send_leer = $GLOBALS['_MooClass']['MooMySQL']->getOne($sql); $sql = "SELECT count(1) as num FROM {$GLOBALS['dbTablePre']}service_contact where you_contact_other='{$uid}' and receive_del=0 and send_del=0 and is_server=0"; $send_contact = $GLOBALS['_MooClass']['MooMySQL']->getOne($sql, true); //$sql="SELECT count(1) as num FROM {$GLOBALS['dbTablePre']}service_friend where friendid='{$uid}' "; //$send_friend = $GLOBALS['_MooClass']['MooMySQL']->getOne($sql); //$sql="SELECT count(distinct cuid) as num FROM {$GLOBALS['dbTablePre']}members_comment where uid='{$uid}' and receive_del=0 and send_del=0"; //$send_comment = $GLOBALS['_MooClass']['MooMySQL']->getOne($sql); } require_once adminTemplate('allmember_contact'); }
MooFastdbUpdate('certification', 'uid', $uid, $val); } //$username=iconv('utf-8','gbk',MooAuthCode($_MooCookie['sftrz_username'], 'DECODE')); $username = MooAuthCode($_MooCookie['sftrz_username'], 'DECODE'); $usercode = MooAuthCode($_MooCookie['sftrz_usercode'], 'DECODE'); $mobile = MooAuthCode($_MooCookie['sftrz_mobile'], 'DECODE'); $sql = "select id from {$dbTablePre}smsauths where uid='{$uid}' "; $row = $_MooClass['MooMySQL']->getOne($sql); if (!empty($row['id'])) { $sql = "update {$dbTablePre}smsauths set time='{$time}',realname='{$username}',idcode='{$usercode}',mobile='{$mobile}' where uid='{$uid}'"; } else { $sql = "insert into {$dbTablePre}smsauths set uid='{$uid}',time='{$time}',realname='{$username}',idcode='{$usercode}',mobile='{$mobile}'"; } $_MooClass['MooMySQL']->query($sql); //重新设置诚信值 reset_integrity($user_arr); echo "success"; exit; default: $total_money = $r3_Amt; break; } //如果支付金额不正确 ——不改变会员状态 if ($total_fee_res < $total_money) { echo "success"; exit; } //会员信息 $sql = "SELECT nickname,telphone FROM {$dbTablePre}members_search WHERE uid='{$uid}'"; $res = $_MooClass['MooMySQL']->getOne($sql, true); //联系方式
function certification($key, $val) { global $_MooClass, $uid, $user_arr, $last_login_time; global $dbTablePre; $sql = "select count(*) as a from {$dbTablePre}certification where uid='{$uid}' "; $r = $_MooClass['MooMySQL']->getone($sql); if ($r[a] == 0) { $sql = " insert into {$dbTablePre}certification (uid,{$key}) values('{$uid}','{$val}')"; } else { $sql = "update {$dbTablePre}certification set {$key}='{$val}' where uid='{$uid}' "; } $_MooClass['MooMySQL']->query($sql); if (MOOPHP_ALLOW_FASTDB) { $value = array(); $value[$key] = $val; MooFastdbUpdate('certification', 'uid', $uid, $value); //!! } //更新诚信值 reset_integrity($user_arr); }