Beispiel #1
0
function smsChannel($mobile, $content, $linkid = 0, $tag = "code", $comment = "验证码")
{
    //查看某个tag的短息使用的短信通道类型
    $channelType = M("sms_setting")->where("tag='{$tag}' and status=1")->getField("type");
    $type = empty($channelType) ? 1 : $channelType;
    if ($type == 1) {
        return oldSendMsg($mobile, $content, $linkid, $tag, $comment);
    } elseif ($type == 2) {
        return sendMessageNew($mobile, $content, $linkid, $tag, $comment);
    }
}
 function info_save()
 {
     //判断传过来的信息是否合法,包括验证码是否正确
     foreach ($_POST as $k => $v) {
         $data[$k] = I("post." . $k);
     }
     //                echo "<pre>";var_dump($data);echo "</pre>";
     if (empty($data['name']) || empty($data['mobile']) || empty($data['able_time']) || empty($data['verify']) || empty($data['want']) || empty($data['updateFile'])) {
         echo json_encode(array("code" => "500", "msg" => "参数异常"));
         die;
     }
     if ($_SESSION['up_' . $data['mobile']] != $data['verify']) {
         echo json_encode(array("code" => "500", "msg" => "验证码不正确"));
         die;
     }
     //判断是否是已有账号用户,不是则为其注册新用户,发送账号短信息
     $memberOb = M("member");
     $arMember = $memberOb->query("select * from stj_member  m join stj_userinfo u where m.username=u.username and mobile='{$_POST['mobile']}' and flag=0");
     if (empty($arMember)) {
         //创建用户
         $userOb = M("userinfo");
         $username = $this->create_username($userOb);
         $pwd = substr($_POST['mobile'], 5);
         $user['password'] = md5(md5($pwd));
         $user['username'] = $username;
         $user['status'] = '1';
         $user['flag'] = '0';
         $card['username'] = $user['username'];
         $card['cnname'] = $data['name'];
         $card['password'] = $user['password'];
         $card['pwd'] = $pwd;
         $card['mobile'] = $_POST['mobile'];
         $card['activation'] = 1;
         $card['checkinfo'] = 'true';
         $card['regip'] = $_SERVER["REMOTE_ADDR"];
         $card['regtime'] = time();
         $card['logintime'] = time();
         $card['loginip'] = $_SERVER["REMOTE_ADDR"];
         $card['fromwhere'] = "upresume";
         $userOb->add($user);
         $memberOb->add($card);
         $memberId = $memberOb->getLastInsID();
         //发送短信
         $content = "您成功参与了人人猎上传简历坐等收钱活动,请用手机号登录,密码为手机号末六位。如有疑问,请联系010-57188076。";
         $tag = "uploadresume";
         $comment = "上传简历坐等收钱";
         $linkid = $memberId;
         oldSendMsg($_POST['mobile'], $content, $linkid, $tag, $comment);
     } else {
         echo json_encode(array("code" => "500", "msg" => "您已是系统用户,请登陆后,上传简历。"));
         die;
     }
     //保存信息到简历表中
     $resume['username'] = $data['name'];
     $resume['mobile'] = $data['mobile'];
     $resume['contact_time'] = $data['able_time'];
     $resume['keyword'] = $data['want'];
     $resume['wordname'] = $data['updateFile'];
     $resume['t_id'] = $memberId;
     $resume['keyid'] = getMillisecond();
     $resume['type'] = 5;
     $resume['other'] = $data['other'];
     $resume['posttime'] = time();
     //保存
     if (!empty($data['updateFile']) && !empty($data['updatePath'])) {
         $upload = array();
         $upload['name'] = $data['updateFile'];
         $upload['path'] = $_POST['updatePath'] . $_POST['updateFile'];
         $upload['posttime'] = time();
         M("uploads")->add($upload);
     }
     $_SESSION['up_' . $data['mobile']] = null;
     $re = M("resume")->add($resume);
     //                var_dump($re);
     //                echo M("customized")->getLastSql();
     echo json_encode(array("code" => "200", "msg" => "参与成功"));
     die;
 }