Example #1
0
 public function qiantai()
 {
     sleep(2);
     $out_trade_no = $_GET['out_trade_no'];
     //商户订单号
     $dingdaninfo = $this->db->GetOne("select * from `@#_member_addmoney_record` where `code` = '{$out_trade_no}'");
     if (!$dingdaninfo || $dingdaninfo['status'] == '未付款') {
         $agent = $_SERVER['HTTP_USER_AGENT'];
         if (strpos($agent, "comFront") || strpos($agent, "iPhone") || strpos($agent, "MIDP-2.0") || strpos($agent, "Opera Mini") || strpos($agent, "UCWEB") || strpos($agent, "Android") || strpos($agent, "Windows CE") || strpos($agent, "SymbianOS")) {
             _messagemobile("支付失败!", WEB_PATH . "/member/mobile");
         } else {
             _message("支付失败!", WEB_PATH . "/member/cart/paysuccess");
         }
     } else {
         if (empty($dingdaninfo['scookies'])) {
             _message("充值成功!", WEB_PATH . "/member/home/userbalance");
         } else {
             if ($dingdaninfo['scookies'] == '1') {
                 $agent = $_SERVER['HTTP_USER_AGENT'];
                 if (strpos($agent, "comFront") || strpos($agent, "iPhone") || strpos($agent, "MIDP-2.0") || strpos($agent, "Opera Mini") || strpos($agent, "UCWEB") || strpos($agent, "Android") || strpos($agent, "Windows CE") || strpos($agent, "SymbianOS")) {
                     _messagemobile("支付成功!", WEB_PATH . "/member/mobile");
                 } else {
                     _message("支付成功!", WEB_PATH . "/member/cart/paysuccess");
                 }
             } else {
                 $agent = $_SERVER['HTTP_USER_AGENT'];
                 if (strpos($agent, "comFront") || strpos($agent, "iPhone") || strpos($agent, "MIDP-2.0") || strpos($agent, "Opera Mini") || strpos($agent, "UCWEB") || strpos($agent, "Android") || strpos($agent, "Windows CE") || strpos($agent, "SymbianOS")) {
                     _messagemobile("商品还未购买,请重新购买商品!", WEB_PATH . "/member/mobile");
                 } else {
                     _message("商品还未购买,请重新购买商品!", WEB_PATH . "/member/cart/paysuccess");
                 }
             }
         }
     }
 }
Example #2
0
 private function return_meg($content = '', $title = '', $type = "")
 {
     if (_is_mobile()) {
         _messagemobile($content, $title, $type);
     } else {
         _message($content);
     }
 }
Example #3
0
 function wx_callback()
 {
     session_start();
     if ($_GET["state"] != $_SESSION["wxState"]) {
         _messagemobile("登录验证失败!", "" . $wx_set['back'] . "/?/mobile/user/login");
     }
     $this->db = System::load_sys_class('model');
     $wx_set = $this->db->GetOne("SELECT * from `@#_wxset` ");
     $code = $_GET["code"];
     $procode = $this->segment(4);
     file_put_contents('t.txt', "\n\r\r\n-----procode:" . $procode, FILE_APPEND);
     $response = file_get_contents("https://api.weixin.qq.com/sns/oauth2/access_token?appid=" . $wx_set['appid'] . "&secret=" . $wx_set['secret'] . "&code={$code}&grant_type=authorization_code");
     $jsondecode = json_decode($response, true);
     $wx_openid = $jsondecode["openid"];
     if (empty($wx_openid)) {
         _messagemobile("绑定出错,请联系管理员。");
         die;
     }
     $access_token = $jsondecode["access_token"];
     $response = file_get_contents("https://api.weixin.qq.com/sns/userinfo?access_token={$access_token}&openid={$wx_openid}");
     $jsondecode = json_decode($response, true);
     $nickname = $jsondecode["nickname"];
     $go_user_info = $this->db->GetOne("select * from `@#_member_band` where `b_code` = '{$wx_openid}' and `b_type` = 'weixin' LIMIT 1");
     if (!$go_user_info) {
         $userpass = md5("123456");
         $go_user_img = 'photo/member.jpg';
         $go_user_time = time();
         $q1 = $this->db->Query("INSERT INTO `@#_member` (`username`,`password`,`img`,`band`,`time`,`money`,`first`,code) VALUES ('{$nickname}','{$userpass}','{$go_user_img}','weixin','{$go_user_time}',0,1,'{$procode}')");
         $uid = $this->db->insert_id();
         $this->db->Query("INSERT INTO `@#_member_band` (`b_uid`, `b_type`, `b_code`, `b_time`) VALUES ('{$uid}', 'weixin', '{$wx_openid}', '{$go_user_time}')");
         $member = $this->db->GetOne("select uid,password,mobile,email from `@#_member` where `uid` = '{$uid}' LIMIT 1");
         $se1 = _setcookie("uid", _encrypt($member['uid']), 60 * 60 * 24 * 7);
         $se2 = _setcookie("ushell", _encrypt(md5($member['uid'] . $member['password'] . $member['mobile'] . $member['email'])), 60 * 60 * 24 * 7);
         $callback_url = WEB_PATH . "/mobile/home/mobilebind";
         header("Location:{$callback_url}");
     } else {
         $uid = $go_user_info["b_uid"];
         $member = $this->db->GetOne("select uid,password,mobile,email from `@#_member` where `uid` = '{$uid}' LIMIT 1");
         $se1 = _setcookie("uid", _encrypt($member['uid']), 60 * 60 * 24 * 7);
         $se2 = _setcookie("ushell", _encrypt(md5($member['uid'] . $member['password'] . $member['mobile'] . $member['email'])), 60 * 60 * 24 * 7);
         if (!$member['mobile']) {
             $callback_url = WEB_PATH . "/mobile/home/mobilebind";
             header("Location:{$callback_url}");
         } else {
             $callback_url = WEB_PATH . "/mobile/activity/";
             header("Location:{$callback_url}");
         }
     }
 }
Example #4
0
 public function payinfo()
 {
     $msg = $this->segment(4);
     if ($msg == "cancel") {
         $msg = '交易取消!';
     } else {
         if ($msg == "fail") {
             $msg = '交易失败!';
         } else {
             if ($msg == "nowechat") {
                 $msg = '请关注微信公众号在微信中登录后进行支付操作!';
             } else {
                 $msg = '交易错误:' . urldecode($msg);
             }
         }
     }
     _messagemobile($msg);
 }
Example #5
0
 private function qiantai()
 {
     sleep(2);
     $out_trade_no = $this->out_trade_no;
     $dingdaninfo = $this->db->GetOne("select * from `@#_member_addmoney_record` where `code` = '{$out_trade_no}'");
     $ua = strtolower($_SERVER['HTTP_USER_AGENT']);
     $uachar = "/(nokia|sony|ericsson|mot|samsung|sgh|lg|philips|panasonic|alcatel|lenovo|cldc|midp|mobile)/i";
     if (($ua == '' || preg_match($uachar, $ua)) && !strpos(strtolower($_SERVER['REQUEST_URI']), 'wap')) {
         if (!$dingdaninfo || $dingdaninfo['status'] == '未付款') {
             _messagemobile("支付失败");
         } else {
             if (empty($dingdaninfo['scookies'])) {
                 _messagemobile("充值成功!<a href=" . WEB_PATH . "/mobile/home/userbalance>查看账户明细</a>");
             } else {
                 if ($dingdaninfo['scookies'] == '1') {
                     header("location: " . WEB_PATH . "/mobile/cart/paysuccess");
                 } else {
                     _messagemobile("商品还未购买,请!<a href=" . WEB_PATH . "/member/cart/cartlist>返回购物车</a>重新购买商品");
                 }
             }
         }
     } else {
         if (!$dingdaninfo || $dingdaninfo['status'] == '未付款') {
             _message("支付失败");
         } else {
             if (empty($dingdaninfo['scookies'])) {
                 _message("充值成功!", WEB_PATH . "/member/home/userbalance");
             } else {
                 if ($dingdaninfo['scookies'] == '1') {
                     _message("支付成功!", WEB_PATH . "/member/cart/paysuccess");
                 } else {
                     _message("商品还未购买,请重新购买商品!", WEB_PATH . "/member/cart/cartlist");
                 }
             }
         }
     }
 }
Example #6
0
 public function goodspost_jf()
 {
     $webname = $this->_cfg['web_name'];
     $key = "晒单评论";
     $itemid = intval($this->segment(4));
     $shoplist = $this->db->GetList("select * from `@#_jf_shoplist` where `sid`='{$itemid}'");
     if (!$shoplist) {
         _messagemobile('页面错误!');
     }
     $shop = '';
     foreach ($shoplist as $list) {
         $shop .= $list['id'] . ',';
     }
     $id = trim($shop, ',');
     if ($id) {
         $shaidan = $this->db->GetList("select * from `@#_shaidan` where `sd_shopid` IN ({$id}) order by `sd_id` DESC");
         $sum = 0;
         foreach ($shaidan as $sd) {
             $shaidan_hueifu = $this->db->GetList("select * from `@#_shaidan_hueifu` where `sdhf_id`='{$sd['sd_id']}'");
             $sum = $sum + count($shaidan_hueifu);
         }
     } else {
         $shaidan = 0;
         $sum = 0;
     }
     include templates("mobile/index", "goodspost");
 }
Example #7
0
 function x__message($a, $b = null, $c = 2)
 {
     _messagemobile($a, $b, $c);
 }
Example #8
0
 public function addmoney()
 {
     parent::__construct();
     $webname = $this->_cfg['web_name'];
     $money = $this->segment(4);
     // 获取充值金额
     $pay_id = $this->segment(5);
     // 获取选择的支付方式
     if (!$this->userinfo) {
         header("location: " . WEB_PATH . "/mobile/user/login");
         exit;
     }
     $payment = $this->db->GetOne("select * from `@#_pay` where `pay_id` = " . $pay_id);
     if (!$payment) {
         _messagemobile("对不起,没有您所选择的支付方式!");
     }
     if (!empty($payment)) {
         $pay_type_bank = $payment['pay_class'];
     }
     $pay_type_id = $pay_id;
     // 		$pay_type_bank=isset($_POST['pay_bank']) ? $_POST['pay_bank'] : false;
     // 		$pay_type_id=isset($_POST['account']) ? $_POST['account'] : false;
     // 		$money=intval($_POST['money']);
     $uid = $this->userinfo['uid'];
     $pay = System::load_app_class('pay', 'pay');
     $pay->pay_type_bank = $pay_type_bank;
     $ok = $pay->init($uid, $pay_type_id, 'addmoney_record', $money);
     if ($ok === 'not_pay') {
         _messagemobile("未选择支付平台");
     }
 }
Example #9
0
 public function resetpassword()
 {
     if (isset($_POST['submit'])) {
         $key = $_POST["hidKey"];
         $password = md5($_POST["userpassword"]);
         $checkcode = explode("|", _encrypt($key, "DECODE"));
         if (count($checkcode) != 3) {
             _messagemobile("未知错误", NULL, 3);
         }
         $emailurl = explode("@", $checkcode[0]);
         if ($emailurl[1]) {
             $sql = "select * from `@#_member` where `email`='{$checkcode['0']}' AND `passcode`= '{$checkcode['1']}|{$checkcode['2']}' LIMIT 1";
         } else {
             $sql = "select * from `@#_member` where `mobile`='{$checkcode['0']}' AND `passcode`= '{$checkcode['1']}|{$checkcode['2']}' LIMIT 1";
         }
         $member = $this->DB()->GetOne($sql);
         if (!$member) {
             _messagemobile("未知错误!");
         }
         $this->DB()->Query("UPDATE `@#_member` SET `password`='{$password}',`passcode`='-1' where `uid`='{$member['uid']}'");
         _messagemobile("密码重置成功", WEB_PATH . "/mobile/user/login");
     }
 }
Example #10
0
 private function qq_set_member($uid = null, $type = 'bind_add_login')
 {
     $member_db = System::load_app_class('base', 'member');
     $memberone = $member_db->get_user_info();
     if ($memberone) {
         _messagemobile("该QQ号已经被其他用户所绑定!", WEB_PATH . '/login');
     }
     $member = $this->db->GetOne("select uid,password,mobile,email from `@#_member` where `uid` = '{$uid}' LIMIT 1");
     $_COOKIE['uid'] = null;
     $_COOKIE['ushell'] = null;
     $_COOKIE['UID'] = null;
     $_COOKIE['USHELL'] = null;
     $time = time();
     $user_ip = _get_ip_dizhi();
     $this->db->GetOne("UPDATE `@#_member` SET `user_ip` = '{$user_ip}',`login_time` = '{$time}' where `uid` = '{$uid}'");
     $s1 = _setcookie("uid", _encrypt($member['uid']), 60 * 60 * 24 * 7);
     $s2 = _setcookie("ushell", _encrypt(md5($member['uid'] . $member['password'] . $member['mobile'] . $member['email'])), 60 * 60 * 24 * 7);
     $domain = System::load_sys_config('domain');
     if (isset($domain[$_SERVER['HTTP_HOST']])) {
         if ($domain[$_SERVER['HTTP_HOST']]['m'] == 'mobile') {
             $callback_url = WEB_PATH . "/mobile/home";
         } else {
             $callback_url = WEB_PATH . "/member/home";
         }
     } else {
         $callback_url = WEB_PATH . "/member/home";
     }
     if ($s1 && $s2) {
         if (!$member['email'] || !$member['mobile']) {
             _messagemobile("登录成功,请绑定邮箱或手机号和及时修改默认密码!", $callback_url);
         }
         _messagemobile("登录成功!", $callback_url);
     } else {
         _messagemobile("登录失败请检查cookie!", G_WEB_PATH);
     }
 }
Example #11
0
 public function addmoney()
 {
     parent::__construct();
     $webname = $this->_cfg['web_name'];
     $money = $this->segment(4);
     //获取充值金额
     $banktype = $this->segment(5);
     //获取选择的银行 CMBCHINA  ICBC CCB
     if (!$this->userinfo) {
         header("location: " . WEB_PATH . "/mobile/user/login");
         exit;
     }
     $zhifutype = $this->db->GetOne("select * from `@#_pay` where `pay_class` = 'yeepay'");
     if (!$zhifutype) {
         _messagemobile("手机支付只支持易宝,请联系站长开通!");
     }
     if (!empty($zhifutype)) {
         $pay_type_bank = $zhifutype['pay_class'];
     }
     $pay_type_id = $banktype;
     //$pay_type_bank=isset($_POST['pay_bank']) ? $_POST['pay_bank'] : false;
     //$pay_type_id=isset($_POST['account']) ? $_POST['account'] : false;
     //$money=intval($_POST['money']);
     $uid = $this->userinfo['uid'];
     $pay = System::load_app_class('pay', 'pay');
     $pay->pay_type_bank = $pay_type_bank;
     $pay->init($uid, $pay_type_id, 'addmoney_record', $money);
 }