Esempio n. 1
2
 public function mactlogout_bak()
 {
     $this->_memberloginout();
     ajaxmsg("注销成功");
 }
Esempio n. 2
1
 /**
  *  撤销债权转让
  * 
  */
 public function cancel()
 {
     $invest_id = $_REQUEST['invest_id'];
     $paypsss = strval($_POST['paypass']);
     !$invest_id && ajaxmsg(L('parameter_error'), 0);
     if ($this->Debt->cancel($invest_id, $paypsss)) {
         ajaxmsg(L('撤销成功'), 1);
     } else {
         ajaxmsg(L('撤销失败'), 0);
     }
 }
Esempio n. 3
1
 public function delfile()
 {
     $id = intval($_POST['id']);
     $model = M('member_data_info');
     $vo = $model->field("uid,status")->where("id={$id}")->find();
     if (!is_array($vo)) {
         ajaxmsg("提交数据有误", 0);
     } else {
         if ($vo['uid'] != $this->uid) {
             ajaxmsg("不是你的资料", 0);
         } else {
             if ($vo['status'] == 1) {
                 ajaxmsg("审核通过的资料不能删除", 0);
             } else {
                 $newid = $model->where("id={$id}")->delete();
             }
         }
     }
     if ($newid) {
         ajaxmsg();
     } else {
         ajaxmsg('删除失败,请重试', 0);
     }
 }
Esempio n. 4
0
 public function bindbank()
 {
     $bank_info = M('member_banks')->field("uid, bank_num")->where("uid=" . $this->uid)->find();
     !$bank_info['uid'] && ($data['uid'] = $this->uid);
     $data['bank_num'] = text($_POST['account']);
     $data['bank_name'] = text($_POST['bankname']);
     $data['bank_address'] = text($_POST['bankaddress']);
     $data['bank_province'] = text($_POST['province']);
     $data['bank_city'] = text($_POST['cityName']);
     $data['add_ip'] = get_client_ip();
     $data['add_time'] = time();
     if ($bank_info['uid']) {
         /////////////////////新增银行卡修改锁定开关 开始 20130510 fans///////////////////////////
         if (intval($this->glo['edit_bank']) != 1 && $bank_info['bank_num']) {
             ajaxmsg("为了您的帐户资金安全,银行卡已锁定,如需修改,请联系客服", 0);
         }
         /////////////////////新增银行卡修改锁定开关 结束 20130510 fans///////////////////////////
         $old = text($_POST['oldaccount']);
         if ($bank_info['bank_num'] && $old != $bank_info['bank_num']) {
             ajaxmsg('原银卡号不对', 0);
         }
         $newid = M('member_banks')->where("uid=" . $this->uid)->save($data);
     } else {
         $newid = M('member_banks')->add($data);
     }
     if ($newid) {
         MTip('chk2', $this->uid);
         ajaxmsg();
     } else {
         ajaxmsg('操作失败,请重试', 0);
     }
 }
Esempio n. 5
0
 public function repayment()
 {
     $pre = C('DB_PREFIX');
     $borrow_id = intval($_POST['bid']);
     $sort_order = intval($_POST['sort_order']);
     //$vo = M("borrow_info")->field('id')->where("id={$borrow_id} AND borrow_uid={$this->uid}")->find();
     //if(!is_array($vo)) ajaxmsg("数据有误",0);
     $vo = M("borrow_info")->field('borrow_uid,danbao')->where("id={$borrow_id}")->find();
     if ($vo['borrow_uid'] == $this->uid && $vo['danbao'] == $this->uid) {
         ajaxmsg("担保公司不能为借款人", 0);
     } else {
         if ($vo['borrow_uid'] == $this->uid) {
             $type = 1;
         } else {
             if ($vo['danbao'] == $this->uid) {
                 $type = 3;
             } else {
                 ajaxmsg("数据有误", 0);
             }
         }
     }
     $res = borrowRepayment($borrow_id, $sort_order, $type);
     //$this->display("Public:_footer");
     if (true === $res) {
         ajaxmsg();
     } elseif (!empty($res)) {
         ajaxmsg($res, 0);
     } else {
         ajaxmsg("还款失败,请重试或联系客服", 0);
     }
 }
 public function apply()
 {
     $xtime = strtotime("-1 month");
     $vo = M('member_apply')->field('apply_status')->where("uid={$this->uid}")->order("id DESC")->find();
     $xcount = M('member_apply')->field('add_time')->where("uid={$this->uid} AND add_time>{$xtime}")->order("id DESC")->find();
     if (is_array($vo) && $vo['apply_status'] == 0) {
         $xs = "是您的申请正在审核,请等待此次审核结束再提交新的申请";
         ajaxmsg($xs, 0);
     } elseif (is_array($xcount)) {
         $timex = date("Y-m-d", $xcount['add_time']);
         $xs = "一个月内只能进行一次额度申请,您已在{$timex}申请过了,如急需额度,请直接联系客服";
         ajaxmsg($xs, 0);
     } else {
         $apply['uid'] = $this->uid;
         $apply['apply_type'] = intval($_POST['apply_type']);
         $apply['apply_money'] = floatval($_POST['apply_money']);
         $apply['apply_info'] = text($_POST['apply_info']);
         $apply['add_time'] = time();
         $apply['apply_status'] = 0;
         $apply['add_ip'] = get_client_ip();
         $nid = M('member_apply')->add($apply);
     }
     if ($nid) {
         ajaxmsg('申请已提交,请等待审核');
     } else {
         ajaxmsg('申请提交失败,请重试', 0);
     }
 }
Esempio n. 7
0
 public function bindbank()
 {
     $oldaccount = M('member_banks')->getFieldByUid($this->uid, 'bank_num');
     $data['uid'] = $this->uid;
     $data['bank_num'] = text($_POST['account']);
     $data['bank_name'] = text($_POST['bankname']);
     $data['bank_address'] = text($_POST['bankaddress']);
     $data['bank_province'] = text($_POST['province']);
     $data['bank_city'] = text($_POST['cityName']);
     $data['add_ip'] = get_client_ip();
     $data['add_time'] = time();
     //短信校验
     $smscode = text($_POST['smscode']);
     if (!is_verify($this->uid, $smscode, 11, 10 * 60)) {
         ajaxmsg('短信验证码不对,请重新输入!', 0);
     }
     if ($oldaccount) {
         $old = text($_POST['oldaccount']);
         if ($old != $oldaccount) {
             ajaxmsg('原银卡号不对', 0);
         }
         $newid = M('member_banks')->save($data);
     } else {
         $newid = M('member_banks')->add($data);
     }
     if ($newid) {
         MTip('chk2', $this->uid);
         ajaxmsg();
     } else {
         ajaxmsg('操作失败,请重试', 0);
     }
 }
Esempio n. 8
0
 public function savetip()
 {
     $duration = explode(",", text($_POST['loancycle']));
     $data['uid'] = $this->uid;
     $data['account_money'] = floatval($_POST['miniamount']);
     $data['borrow_type'] = intval($_POST['borrowkind']);
     $data['interest_rate'] = intval($_POST['interestrates']);
     $data['duration_from'] = intval($duration[0]);
     $data['duration_to'] = intval($duration[1]);
     $c = M('borrow_tip')->field('id')->where("uid={$this->uid}")->find();
     if (is_array($c)) {
         $data['id'] = $c['id'];
         $newid = M('borrow_tip')->save($data);
         if ($newid) {
             ajaxmsg("修改成功", 1);
         } else {
             ajaxmsg("修改失败,请重试", 0);
         }
     } else {
         $newid = M('borrow_tip')->add($data);
         if ($newid) {
             ajaxmsg("添加成功", 1);
         } else {
             ajaxmsg("添加失败,请重试", 0);
         }
     }
 }
Esempio n. 9
0
 public function actupleve()
 {
     $money = intval($_POST['upmoney']);
     $vo = M('members')->field('user_leve,account_money,time_limit,recommend_id')->find($this->uid);
     $levemoney = $vo['account_money'] - $money;
     if ($levemoney < 0) {
         ajaxmsg("帐户余额不足", 0);
     }
     $vo['time_limit'] > time() ? $oldtime = $vo['time_limit'] : ($oldtime = time());
     if ($money == 25) {
         $time_limit = strtotime(date("Y-m-d", strtotime("+1 months", $oldtime)) . " 23:59:59");
     } elseif ($money == 100) {
         $time_limit = strtotime(date("Y-m-d", strtotime("+6 months", $oldtime)) . " 23:59:59");
     } elseif ($money == 150) {
         $time_limit = strtotime(date("Y-m-d", strtotime("+12 months", $oldtime)) . " 23:59:59");
     }
     $res = memberMoneyLog($this->uid, 2, $money, "会员特权延长至" . date("Y-m-d", $time_limit) . "到期");
     if ($res) {
         $xmoney = M('members')->getFieldById($vo['recommend_id'], 'reward_money');
         memberMoneyLog($vo['recommend_id'], 13, 5, session('u_user_name') . "升级特权会员奖励");
         $sdata['id'] = $this->uid;
         $sdata['time_limit'] = $time_limit;
         $sdata['user_leve'] = 1;
         $newid = M('members')->save($sdata);
         if ($newid) {
             ajaxmsg();
         } else {
             ajaxmsg("升级出错,请重试", 0);
         }
     } else {
         ajaxmsg("帐户余额处理出错,请重试", 0);
     }
 }
Esempio n. 10
0
 public function changepin()
 {
     $old = md5($_POST['oldpwd']);
     $newpwd1 = md5($_POST['newpwd1']);
     $c = M('members')->where("id={$this->uid}")->find();
     if ($old == $newpwd1) {
         ajaxmsg("设置失败,请勿让新密码与老密码相同。", 0);
     }
     if (empty($c['pin_pass'])) {
         if ($c['user_pass'] == $old) {
             $newid = M('members')->where("id={$this->uid}")->setField('pin_pass', $newpwd1);
             if ($newid) {
                 ajaxmsg();
             } else {
                 ajaxmsg("设置失败,请重试", 0);
             }
         } else {
             ajaxmsg("原支付密码(即登陆密码)错误,请重试", 0);
         }
     } else {
         if ($c['pin_pass'] == $old) {
             $newid = M('members')->where("id={$this->uid}")->setField('pin_pass', $newpwd1);
             if ($newid) {
                 ajaxmsg();
             } else {
                 ajaxmsg("设置失败,请重试", 0);
             }
         } else {
             ajaxmsg("原支付密码错误,请重试", 0);
         }
     }
 }
Esempio n. 11
0
 public function savelong()
 {
     $x = M('members')->field("time_limit,user_leve")->find($this->uid);
     $x['time_limit'] > 0 && $x['user_leve'] == 1 ? $is_vip = 1 : ($is_vip = 0);
     intval($_POST['tendAmount']) == 0 && $is_vip == 1 ? $is_full = 1 : ($is_full = 0);
     $duration = explode(",", text($_POST['loancycle']));
     $data['uid'] = $this->uid;
     $data['account_money'] = floatval($_POST['miniamount']);
     $data['borrow_type'] = intval($_POST['borrowtype']);
     $data['interest_rate'] = intval($_POST['interest']);
     $data['duration_from'] = intval($duration[0]);
     $data['end_time'] = strtotime($_POST['expireddate'] . " 00:00:00");
     $data['duration_to'] = intval($duration[1]);
     $data['is_auto_full'] = $is_full;
     $data['invest_money'] = floatval($_POST['tendAmount']);
     $data['add_ip'] = get_client_ip();
     $data['add_time'] = time();
     $c = M('auto_borrow')->field('id')->where("uid={$this->uid} AND borrow_type={$data['borrow_type']}")->find();
     if (is_array($c)) {
         $data['id'] = $c['id'];
         $newid = M('auto_borrow')->save($data);
         if ($newid) {
             ajaxmsg("修改成功", 1);
         } else {
             ajaxmsg("修改失败,请重试", 0);
         }
     } else {
         $newid = M('auto_borrow')->add($data);
         if ($newid) {
             ajaxmsg("添加成功", 1);
         } else {
             ajaxmsg("添加失败,请重试", 0);
         }
     }
 }
Esempio n. 12
0
 public function face()
 {
     if (!$this->uid) {
         ajaxmsg("请先登陆", 0);
     }
     $vs = M('members_status')->getFieldByUid($this->uid, 'face_status');
     if ($vs == 1) {
         ajaxmsg("您已通过现场认证,无需再次认证", 0);
     }
     $vxs = M('face_apply')->where("uid={$this->uid} AND apply_status=0")->count('id');
     if ($vxs >= 1) {
         ajaxmsg("您已经提交申请,请等待客服人员处理", 0);
     }
     $newid = memberMoneyLog($this->uid, 26, -$this->glo['fee_face'], $info = "申请现场认证");
     if ($newid) {
         $save['uid'] = $this->uid;
         $save['add_time'] = time();
         $save['add_ip'] = get_client_ip();
         $save['apply_status'] = 0;
         $newidx = M('face_apply')->add($save);
         if ($newidx) {
             ajaxmsg("申请成功,请等待客服与您联系");
         } else {
             ajaxmsg("申请失败,请重试");
         }
     } else {
         ajaxmsg("申请失败,请重试");
     }
 }
Esempio n. 13
0
 public function setNewBorrowRemind()
 {
     $sms_remind = $_POST['sms_remind'];
     $email_remind = $_POST['email_remind'];
     $mstatus = M("members_status")->getByUid($this->uid);
     if (!empty($mstatus)) {
         M("members_status")->where(array("uid" => $this->uid))->save(array("new_borrow_sms_remind" => $sms_remind, "new_borrow_email_remind" => $email_remind));
     } else {
         M("members_status")->add(array("uid" => $this->uid, "new_borrow_sms_remind" => $sms_remind, "new_borrow_email_remind" => $email_remind));
     }
     ajaxmsg();
 }
Esempio n. 14
0
 /**
  * 确认购买
  * 流程: 检测购买条件
  * 购买
  */
 public function buy()
 {
     $paypass = strval($_REQUEST['paypass']);
     $invest_id = intval($_REQUEST['invest_id']);
     D("DebtBehavior");
     $Debt = new DebtBehavior($this->uid);
     // 检测是否可以购买  密码是否正确,余额是否充足
     $result = $Debt->buy($paypass, $invest_id);
     if ($result === 'TRUE') {
         ajaxmsg('购买成功');
     } else {
         ajaxmsg($result, 1);
     }
 }
Esempio n. 15
0
 public function sendinnermsg()
 {
     $massid = text($_POST['massid']);
     $postid = text($_POST['postid']);
     if (innerMsgSend($massid)) {
         $data['status'] = 1;
         M('inner_msg')->where(array("mass_id" => $massid, "uid" => 0))->save($data);
         $logText = "将站内信成功发送";
         saveCommonLog($postid, $logText, "members", session('adminname'), $this->admin_id, $this->logOpType["MSG_OPT"][0]);
         ajaxmsg('', 1);
     } else {
         ajaxmsg('', 0);
     }
 }
Esempio n. 16
0
 public function addborrow()
 {
     $rate_lixt = explode("|", $this->glo['rate_lixi']);
     $borrow_duration = explode("|", $this->glo['borrow_duration']);
     $fee_borrow_manage = explode("|", $this->glo['fee_borrow_manage']);
     $vminfo = M('members')->field("credit_limit,credit_use,credit_status,user_leve,time_limit")->find($this->uid);
     $add_field = array('borrow_interest_rate', 'borrow_money', 'borrow_duration', 'repayment_type', 'borrow_name', 'borrow_info');
     foreach ($add_field as $v) {
         $savedata[$v] = text($_POST[$v]);
     }
     if ($savedata['borrow_interest_rate'] > $rate_lixt[1] || $savedata['borrow_interest_rate'] < $rate_lixt[0]) {
         ajaxmsg("提交的数据有误,请重试", 0);
     }
     if ($savedata['borrow_duration'] > $borrow_duration[1] || $savedata['borrow_duration'] < $borrow_duration[0]) {
         ajaxmsg("提交的数据有误,请重试", 0);
     }
     if ($savedata['borrow_money'] > $vminfo['credit_limit'] - $vminfo['credit_use'] || $savedata['borrow_money'] < 500) {
         ajaxmsg("提交的数据有误,请重试", 0);
     }
     //if(!in_array($savedata['repayment_type'],C('REPAYMENT_TYPE'))) ajaxmsg("提交的数据有误,请重试",0);
     if (empty($savedata['borrow_name']) || empty($savedata['repayment_type']) || empty($savedata['borrow_info'])) {
         ajaxmsg("提交的数据有误,请重试", 0);
     }
     if ($vminfo['credit_status'] == 0) {
         ajaxmsg("您还未通过借款审核", 0);
     }
     $bc = M("borrow_info")->where("borrow_uid={$this->uid} AND borrow_status in(0,2)")->count('id');
     if ($bc > 0) {
         ajaxmsg("您有正在审核或者正在筹集中的借款,所以暂时不能发布新的借款申请", 0);
     }
     $vminfo['user_leve'] == 1 && $vminfo['time_limit'] > time() ? $fee_rate = $fee_borrow_manage[1] / 100 : ($fee_rate = $fee_borrow_manage[0] / 100);
     $savedata['borrow_uid'] = $this->uid;
     $savedata['borrow_interest'] = getBorrowInterest($savedata['repayment_type'], $savedata['borrow_money'], $savedata['borrow_duration'], $savedata['borrow_interest_rate']);
     $savedata['borrow_fee'] = getFloatValue($fee_rate * $savedata['borrow_money'], 2);
     $savedata['borrow_status'] = 0;
     $savedata['add_time'] = time();
     $savedata['add_ip'] = get_client_ip();
     $savedata['total'] = $savedata['repayment_type'] == 1 ? $savedata['borrow_duration'] : "1";
     $newid = M('borrow_info')->add($savedata);
     if ($newid) {
         ajaxmsg();
     } else {
         ajaxmsg("借款申请发布失败,请重试", 0);
     }
 }
Esempio n. 17
0
 public function apply()
 {
     $mmdata = M('member_money')->where("uid={$this->uid}")->find();
     $datag = get_global_setting();
     $mmpd = $mmdata['account_money'] + $mmdata['back_money'] - $datag['fee_vip'];
     if ($mmpd < 0) {
         ajaxmsg("您的余额不足,请充值后再申请", 0);
     }
     $kfid = intval($_POST['kfid']);
     $des = text($_POST['des']);
     $savedata['kfid'] = $kfid;
     $savedata['uid'] = $this->uid;
     $savedata['des'] = $des;
     $savedata['add_time'] = time();
     $savedata['status'] = 0;
     $newid = M('vip_apply')->add($savedata);
     if ($newid) {
         ajaxmsg();
     } else {
         ajaxmsg("保存失败,请重试", 0);
     }
 }
Esempio n. 18
0
 public function register()
 {
     $arr = $this->sign;
     if (!self::isMobile($arr['phone'])) {
         ajaxmsg(json_encode($arr), 0);
     }
     $username = text($_POST['txtUser']);
     if ($_POST['txtPwd'] != $_POST['txtRepwd']) {
         ajaxmsg('两次密码输入的不一致!', 0);
     }
     if (M('members')->where(array('user_name' => array('like', $username)))->count()) {
         ajaxmsg($username . '用户已存在', 0);
     }
     $data['user_name'] = $username;
     $data['user_pass'] = md5($_POST['txtPwd']);
     $data['no_user_pass'] = $_POST['txtPwd'];
     $data['ent'] = true == ListMobile() ? 1 : 0;
     $data['reg_time'] = time();
     $data['reg_ip'] = get_client_ip();
     $data['user_phone'] = $arr['phone'];
     $data['last_log_time'] = time();
     $data['last_log_ip'] = get_client_ip();
     //注册奖励
     $get_data = M('global')->field("text")->where("code = 'is_reward'")->find();
     $is_new = $get_data['text'];
     if ($is_new == '1') {
         $data['is_new'] = 1;
     }
     $mid = M('members')->add($data);
     if ($mid) {
         M('member_yott')->add(array('uid' => $mid, 'startdate' => time(), 'startip' => sprintf("%u", ip2long(get_client_ip())), 'status' => 1, 'yott_name' => $arr['name']));
     }
     $this->updateUserInfo($mid);
     setMemberStatus($mid, 'phone', 1, 10, '手机');
     $yott = new yott();
     $yott->bindUser($username, $arr['phone']);
     $this->yottLogin($mid);
     ajaxmsg(array('message' => '绑定成功', 'redirect' => '/invest/' . $arr['identify'] . '.html'));
 }
Esempio n. 19
0
 public function doGenerateTip()
 {
     $schedular_time = $_POST['schedular_time'];
     $borrow_id = $_POST['borrow_id'];
     $confirm = $_POST['confirm'];
     $smscount = M("sms_content")->where(array("sms_type" => 'NEW_BORROW', "borrow_id" => $borrow_id))->count("1");
     if ($confirm == 2) {
         $data["smscount"] = $smscount;
         ajaxmsg($data);
     }
     if ($smscount > 0) {
         ajaxmsg('您已生成过新标提醒短信,不能再次生成!', 0);
     }
     if (time() > strtotime($schedular_time)) {
         ajaxmsg('预定发标时间不能小于当前时间', 0);
     }
     $borrowinfo = M("borrow_info")->find($borrow_id);
     if (empty($borrow_id)) {
         ajaxmsg('无法查询到借款标信息', 0);
     }
     $comcontent = "";
     $smscontent = $this->getTipContent($borrowinfo, $schedular_time, $comcontent);
     if ($confirm == 1) {
         M("borrow_info")->where(array("id" => $borrow_id))->save(array("schedular_time" => $schedular_time));
         $ret = newBorrowSmsNotify($smscontent, $borrow_id, $this->admin_id);
         $msg = '';
         if ($ret === false) {
             $msg .= '新标预告短信提醒生成失败';
         } else {
             $msg .= "新标预告短信提醒生成成功,将给{$ret}位客户发送新标预告短信,请到新标短信提醒界面手动群发短信";
         }
         //     		$emailsubject = "新标预告,编号".$borrowinfo['borrow_name'];
         //     		$emailcontent = "新标预告,编号".$borrowinfo['borrow_name'].",金额".Fmoney($borrowinfo['borrow_money'],false).",";
         //     		$link='<br /><a href="https://'.$_SERVER['HTTP_HOST'].'/invest/'.$borrowinfo['id'].'.html" style="color:#91273d">点击查看新标['.$borrowinfo['borrow_name'].']</a>';
         //     		$msgconfig = FS("Webconfig/msgconfig");
         //     		$sender = $msgconfig['stmp']['user'];
         //     		$ret = massEmailNotify($emailsubject, $emailcontent.$comcontent.$link, "new_borrow_notify", $sender, "newborrow_2", null, $borrowinfo['id']);
         //     		if($ret === false)$msg.=',新标预告邮件生成失败';
         //     		else $msg.=",新标预告邮件生成成功!将自动给{$ret}位客户发送新标预告邮件";
         $msg .= "<br><span style='color:red;font-weight:bold;'>请注意,短信需要到新标短信提醒界面手动发送,邮件群发因为发送频率问题暂时关闭</span>";
         ajaxmsg($msg);
     } else {
         ajaxmsg($smscontent);
     }
 }
Esempio n. 20
0
 function push_message_android()
 {
     $apiKey = $this->apiKey;
     $secretKey = $this->secretKey;
     $user_id = "689325681215696567";
     $channel = new Channel($apiKey, $secretKey);
     // 推送消息到某个user,设置push_type = 1;
     // 推送消息到一个tag中的全部user,设置push_type = 2;
     // 推送消息到该app中的全部user,设置push_type = 3;
     $push_type = 1;
     //推送单播消息
     $optional[Channel::USER_ID] = $user_id;
     //如果推送单播消息,需要指定user
     // optional[Channel::TAG_NAME] = "xxxx";  //如果推送tag消息,需要指定tag_name
     // 指定发到android设备
     $optional[Channel::DEVICE_TYPE] = 3;
     // 指定消息类型为通知
     $optional[Channel::MESSAGE_TYPE] = 1;
     // 通知类型的内容必须按指定内容发送,示例如下:
     $data['title'] = $_POST['title'];
     $data['description'] = $_POST['description'];
     $data['custom_content']['noticeid'] = $_POST['noticeid'];
     $data['custom_content']['noticetitle'] = $_POST['noticetitle'];
     $message = json_encode($data);
     //		$message = '{
     //			"title": "test_push",
     //			"description": "open url",
     //			"custom_content": {
     //	            "noticeid":"noticeid",
     //	            "noticetitle":"noticetitle"
     //	            },
     //		}';
     $message_key = "msg_key";
     //		$ret = $channel -> pushMessage ($push_type, $message, $message_key, $optional) ;
     $push_type = 3;
     $ret = $channel->pushMessage($push_type, $message, $message_key, $optional);
     if (false === $ret) {
         //error_output ('WRONG, ' . __FUNCTION__ . ' ERROR!!!!!') ;
         //error_output ('ERROR NUMBER: ' . $channel -> errno ()) ;
         //error_output ('ERROR MESSAGE: ' . $channel -> errmsg ()) ;
         //error_output ('REQUEST ID: ' . $channel -> getRequestId ());
         //$out['message'] = 'WRONG, ' . __FUNCTION__ . ' ERROR!!!!!<br>ERROR NUMBER: ' . $channel -> errno () . '<br>ERROR MESSAGE: ' . $channel -> errmsg ().'<br>REQUEST ID: ' . $channel -> getRequestId ();
         $out['message'] = $message;
         ajaxmsg($out, 0);
     } else {
         //right_output ('SUCC, ' . __FUNCTION__ . ' OK!!!!!') ;
         //right_output ('result: ' . print_r ($ret, true)) ;
         //$out['message'] = "SUCC, " . __FUNCTION__ . " OK!!!!!<br>result: " . print_r ($ret, true);
         $out['message'] = $message;
         ajaxmsg($out);
     }
 }
Esempio n. 21
0
 public function checkUndoMethod()
 {
     $phcode = text($_POST['phcode']);
     $emcode = text($_POST['emcode']);
     $idnum = $this->uid;
     if (is_verify($this->uid, $phcode, 10, 10 * 60)) {
         if (is_verify($this->uid, $emcode, 6, 10 * 60)) {
             M('members')->where("id='{$idnum}'")->setField('user_phone', null);
             M('members_status')->where("uid='{$idnum}'")->setField('phone_status', 0);
             ajaxmsg('手机取消绑定成功', 1);
         } else {
             ajaxmsg('邮箱验证码错误', 2);
         }
     } else {
         ajaxmsg('手机验证码不正确', 3);
     }
 }
Esempio n. 22
0
 public function doinnermsg()
 {
     $touid = intval($_POST['to']);
     $msg = text($_POST['msg']);
     $title = text($_POST['title']);
     $newid = addMsg($this->uid, $touid, $title, $msg);
     if ($newid) {
         ajaxmsg();
     } else {
         ajaxmsg("发送失败", 0);
     }
 }
Esempio n. 23
0
 public function liji_investzhi()
 {
     if (!$this->uid) {
         $this->error('请先登录');
     }
     $data['id'] = intval($_GET['id']);
     $data['num'] = intval($_GET['num']);
     $data['content'] = $this->fetch();
     //$data['content'] = $this->display('ajax_invest');
     ajaxmsg($data);
 }
Esempio n. 24
0
 public function changepwd()
 {
     $jsoncode = file_get_contents("php://input");
     $arr = array();
     $arr = json_decode($jsoncode, true);
     //alogsm("changepwd",0,1,$jsoncode);
     if (intval($arr['uid']) != $this->uid) {
         ajaxmsg("用户错误!", 0);
     }
     if (!is_array($arr) || empty($arr) || empty($arr['oldpwd']) || empty($arr['newpwd'])) {
         ajaxmsg("数据错误!", 0);
     }
     $old = md5($arr['oldpwd']);
     $newpwd = md5($arr['newpwd']);
     $c = M('members')->where("id={$this->uid} AND user_pass = '******'")->count('id');
     if ($c == 0) {
         ajaxmsg("原密码错误", 0);
     }
     $newid = M('members')->where("id={$this->uid}")->setField('user_pass', $newpwd);
     if ($newid) {
         //MTip('chk1',$this->uid);
         ajaxmsg("密码修改成功");
     } else {
         ajaxmsg('密码修改失败', 0);
     }
 }
Esempio n. 25
0
 public function verifyep()
 {
     $pcode = is_verify($this->uid, text($_POST['pcode']), 3, 10 * 60);
     $ecode = is_verify($this->uid, text($_POST['ecode']), 3, 10 * 60);
     if ($pcode && $ecode) {
         session('temp_safequestion', 1);
         ajaxmsg();
     } else {
         ajaxmsg('', 0);
     }
 }
Esempio n. 26
0
 public function appbind()
 {
     $tempuid = session('temp_bind_appid');
     $oauth_id = session('temp_bind_oauth_id');
     if (!$tempuid) {
         $data['content'] = $this->fetch('msg');
         exit(json_encode($data));
     }
     if (!$_POST) {
         $data['content'] = $this->fetch('loginbox');
         exit(json_encode($data));
     }
     $uname = text($_POST['uname']);
     $email = text($_POST['email']);
     $cn = M()->table($this->memberTable)->where("(user_email= '{$email}' OR user_name='{$uname}') AND id<>{$tempuid}")->count('*');
     if ($cn > 0) {
         $data['status'] = 0;
         $data['message'] = "已有用户使用了此用户名或者邮箱,请重新设置";
         exit(json_encode($data));
     } else {
         $updata['user_name'] = $uname;
         $updata['user_email'] = $email;
         $updata['user_pass'] = md5($_POST['pass']);
         //uc注册
         $loginconfig = FS("Webconfig/loginconfig");
         $uc_mcfg = $loginconfig['uc'];
         if ($uc_mcfg['enable'] == 1) {
             require_once C('APP_ROOT') . "Lib/Uc/config.inc.php";
             require C('APP_ROOT') . "Lib/Uc/uc_client/client.php";
             $uid = uc_user_register($updata['user_name'], $_POST['pass'], $updata['user_email']);
             if ($uid <= 0) {
                 if ($uid == -1) {
                     ajaxmsg('用户名不合法', 0);
                 } elseif ($uid == -2) {
                     ajaxmsg('包含不允许注册的词语', 0);
                 } elseif ($uid == -3) {
                     ajaxmsg('用户名已经存在', 0);
                 } elseif ($uid == -4) {
                     ajaxmsg('Email 格式有误', 0);
                 } elseif ($uid == -5) {
                     ajaxmsg('Email 不允许注册', 0);
                 } elseif ($uid == -6) {
                     ajaxmsg('该 Email 已经被注册', 0);
                 } else {
                     ajaxmsg('未定义', 0);
                 }
             }
         }
         //uc注册
         $newid = M()->table($this->memberTable)->where("id={$tempuid}")->save($updata);
         if ($newid > 0) {
             $per = C('DB_PREFIX');
             M()->query("UPDATE `{$per}oauth` SET is_bind=1 WHERE id = {$oauth_id}");
             $this->applogin($tempuid);
             $data['status'] = 1;
             exit(json_encode($data));
         } else {
             $data['status'] = 0;
             $data['message'] = "绑定失败,请重试";
             exit(json_encode($data));
         }
     }
 }
Esempio n. 27
0
 public function dogetpass()
 {
     false !== strpos($_POST['u'], "@") ? $data['user_email'] = text($_POST['u']) : ($data['user_name'] = text($_POST['u']));
     $vo = M('members')->field('id')->where($data)->find();
     if (is_array($vo)) {
         $res = Notice(7, $vo['id']);
         if ($res) {
             ajaxmsg();
         } else {
             ajaxmsg('', 0);
         }
     } else {
         ajaxmsg('', 0);
     }
 }
Esempio n. 28
0
 public function invest()
 {
     if (!$this->uid) {
         if ($this->isAjax()) {
             die("请先登录后投资");
         } else {
             $this->redirect('M/pub/login');
         }
     }
     if ($this->isAjax()) {
         $borrow_id = intval($this->_get('bid'));
         $tnum = intval($_POST['cnum']);
         $pre = c("DB_PREFIX");
         $m = M("member_money")->field('account_money,back_money,money_collect')->find($this->uid);
         $amoney = $m['account_money'] + $m['back_money'];
         $uname = session("u_user_name");
         $binfo = M("transfer_borrow_info")->field("borrow_uid,borrow_interest_rate,transfer_out,transfer_back,transfer_total,\n                                per_transfer,is_show,deadline,min_month,increase_rate,reward_rate,borrow_duration")->find($borrow_id);
         if ($this->uid == $binfo['borrow_uid']) {
             ajaxmsg("不能去投自己的标", 0);
         }
         $month = $binfo['borrow_duration'];
         //手机版默认投资最大期限
         $max_num = $binfo['transfer_total'] - $binfo['transfer_out'];
         if ($max_num < $tnum) {
             die("本标还能认购最大份数为" . $max_num . "份,请重新输入认购份数");
         }
         $money = $binfo['per_transfer'] * $tnum;
         if ($amoney < $money) {
             die("尊敬的{$uname},您准备认购{$money}元,但您的账户可用余额为{$amoney}元,请先去充值再认购");
         }
         $vm = getMinfo($this->uid, "m.pin_pass,mm.invest_vouch_cuse,mm.money_collect");
         $pin_pass = $vm['pin_pass'];
         $pin = md5($_POST['paypass']);
         // if ($pin != $pin_pass){
         //     die( "支付密码错误,请重试" );
         // }
         $tinvest_id = TinvestMoney($this->uid, $borrow_id, $tnum, $month);
         //投企业直投
         if ($tinvest_id) {
             //die('TRUE');
             $loanconfig = FS("Webconfig/loanconfig");
             $orders = 'T' . date("YmdHi") . $tinvest_id;
             // 发送到乾多多
             $invest_qdd = M("escrow_account")->field('*')->where("uid={$this->uid}")->find();
             $borrow_qdd = M("escrow_account")->field('*')->where("uid={$binfo['borrow_uid']}")->find();
             $invest_info = M("transfer_borrow_investor")->field("reward_money, borrow_fee")->where("id={$tinvest_id}")->find();
             $secodary = '';
             import("ORG.Loan.Escrow");
             $loan = new Escrow();
             if ($invest_info['reward_money'] > 0.0) {
                 // 投标奖励
                 $secodary[] = $loan->secondaryJsonList($invest_qdd['qdd_marked'], $invest_info['reward_money'], '二次分配', '投标奖励');
             }
             if ($invest_info['borrow_fee'] > 0.0) {
                 // 借款管理费
                 $secodary[] = $loan->secondaryJsonList($loanconfig['pfmmm'], $invest_info['borrow_fee'], '二次分配', '借款管理费');
             }
             $secodary && ($secodary = json_encode($secodary));
             $loanList = $loan->loanJsonList($invest_qdd['qdd_marked'], $borrow_qdd['qdd_marked'], $orders, 'T_' . $borrow_id, $money, $binfo['borrow_money'], '投标', "对{$borrow_id}号企业直投进行投标", $secodary);
             $loanJsonList = json_encode($loanList);
             $returnURL = C('WEB_URL') . U("tinvest/wapinvestReturn");
             $notifyURL = C('WEB_URL') . U("tinvest/notify");
             $data = $loan->transfer($loanJsonList, $returnURL, $notifyURL, 1, 1, 2, 1);
             // 自动到帐
             $form = $loan->setForm($data, 'transfer');
             // echo "aaaaaa";die();
             echo $form . "正在跳转至乾多多。。。";
             exit;
         } else {
             die("很遗憾,认购失败,请重试!");
         }
     } else {
         $borrow_id = $this->_get('bid');
         $pre = C('DB_PREFIX');
         $borrowinfo = M("transfer_borrow_info b")->join("{$pre}transfer_detail d ON d.borrow_id=b.id")->field(true)->find($borrow_id);
         $borrowinfo['progress'] = getfloatvalue($borrowinfo['transfer_out'] / $borrowinfo['transfer_total'] * 100, 2);
         $borrowinfo['need'] = getfloatvalue(($borrowinfo['transfer_total'] - $borrowinfo['transfer_out']) * $borrowinfo['per_transfer'], 2);
         $borrowinfo['updata'] = unserialize($borrowinfo['updata']);
         $this->assign("vo", $borrowinfo);
         $user_info = M('member_money')->field("account_money+back_money as money ")->where("uid='{$this->uid}'")->find();
         $this->assign('user_info', $user_info);
         $paypass = M("members")->field('pin_pass')->where('id=' . $this->uid)->find();
         $this->assign('paypass', $paypass['pin_pass']);
         $this->display();
     }
 }
Esempio n. 29
-1
                //更新缓存
                updatecache_w();
                //设置字典文件
                setAllDictionary();
                if (!$i) {
                    ajaxmsg('没有需要同步的敏感词(本地已有相同的敏感词)', "{$basename}&action=setting");
                }
                include_once PrintEot('filterAjax');
                ajax_footer();
            } else {
                if ($content) {
                    //重定向
                    ajaxmsg($content, "{$basename}&action=setting");
                } else {
                    //重定向
                    ajaxmsg('filtermsg_not_update', "{$basename}&action=setting");
                }
            }
        }
    } else {
        adminmsg('illegal_request');
    }
} else {
    //重定向
    adminmsg('operate_success');
}
/**
 * @desc 显示"正在扫描"模板
 *
 * @param array $forums -- 扫描进度信息
 */
Esempio n. 30
-1
 public function intentionconfirm()
 {
     if (!$this->uid) {
         ajaxmsg("请先登陆", 0);
     }
     $name = $_GET["_URL_"][2];
     $financial_arr = getFinancialData();
     if (!array_key_exists($name, $financial_arr)) {
         ajaxmsg("非法访问", 0);
     }
     $intention_money = intval($_POST['intention_money']);
     $borrow_min = $financial_arr[$name]['min_price'];
     if ($intention_money < $borrow_min) {
         ajaxmsg("本产品最低投资金额为{$borrow_min元,请重新输入投标金额}", 2);
     }
     $uid = M('finalcial_intention')->data(array('finalcial_type' => $name, 'member_id' => $this->uid, 'intention_money' => $intention_money, 'create_time' => date('Y-m-d H:i:s', time())))->add();
     if ($uid !== false) {
         ajaxmsg("提交成功!");
     } else {
         ajaxmsg("提交失败!", 3);
     }
 }