/**
  * function description
  *
  * @param
  * @return void
  */
 public function execute($request)
 {
     if ($request->format == 'json') {
         $arrary = array();
         $id = $request->id;
         if (!is_numeric($id) || $id < 1) {
             return array('status' => '-5', 'msg' => '参数错误');
         }
         $pageConfig = $_POST['pageConfig'];
         $pageItem = $_POST['pageItem'];
         $letter = array();
         $letter['pageConfig'] = $pageConfig;
         $letter['pageItem'] = $pageItem;
         Sp_Letter_Letter::save($id, $letter);
         return array('status' => 0, 'msg' => '保存成功');
     } else {
         $id = $request->id;
         if (!is_numeric($id) || $id < 1) {
             $this->show404();
         }
         $letter = Sp_Letter_Letter::getLetterById($id);
         if (empty($letter)) {
             $this->show404();
         }
         $active = Sp_Active_Active::getActiveById($letter['active_id'], $user->id);
         if (empty($active)) {
             $this->show404();
         }
         $view = new Sp_View();
         $view->assign("id", $id);
         $view->assign("active", $active);
         $view->display("active/lettereditor.html");
     }
 }
Ejemplo n.º 2
0
 /**
  * function description
  *
  * @param
  * @return void
  */
 public function execute($request)
 {
     $id = $request->id;
     if (empty($id)) {
         header("Location: " . SP_URL_HOME);
         exit;
     }
     $data = Sp_Account_Attendee::getAttendeeBySn($id);
     if (empty($data)) {
         header("Location: " . SP_URL_HOME);
         exit;
     }
     if ($request->type == 'code') {
         include LIB_ROOT . 'third/phpqrcode/qrlib.php';
         $errorCorrectionLevel = "L";
         $matrixPointSize = "6";
         QRcode::png($id, false, $errorCorrectionLevel, $matrixPointSize);
     } else {
         $active = Sp_Active_Active::getActiveById($data['activeId']);
         if (empty($active)) {
             $this->show404();
         }
         $data['sn'] = $this->formatSn($data['signId']);
         $view = new Sp_View();
         $view->assign('data', $data);
         $view->assign('active', $active);
         $view->display("attendee/code.html");
     }
 }
Ejemplo n.º 3
0
 /**
  * function description
  *
  * @param
  * @return void
  */
 public function execute($request)
 {
     if ($request->format == 'json') {
         $user = Sp_Account_User::current();
         $aid = $request->id;
         if (!is_numeric($aid)) {
             $data = array();
             $data['status'] = '-1';
             $data['msg'] = '提交数据有误';
             return $data;
         }
         // 当前页数
         $nowPage = $request->page;
         empty($nowPage) && ($nowPage = 1);
         $limitRow = ($nowPage - 1) * self::PAGE_SIZE;
         // 分页数据
         $array = Sp_Letter_Letter::getListByUser($user->id, $aid, $limitRow, self::PAGE_SIZE);
         $total = Sp_Letter_Letter::getTotalByUser($user->id, $aid);
         if (is_array($array) && count($array)) {
             $cry = new Util_Crypt3Des();
             foreach ($array as $key => $value) {
                 $id = $cry->encrypt($value['id']);
                 $id = base64_encode($id);
                 $array[$key]['sid'] = $id;
             }
         }
         // 分页
         $pager = new Util_Pager($total, $nowPage, self::PAGE_SIZE);
         $pageString = $pager->renderNav(true);
         $data = array();
         if (is_array($array)) {
             $data['status'] = '0';
             $data['data'] = $array;
             $data['msg'] = '';
             $data['pageString'] = $pageString;
             $data['nowtime'] = time();
         } else {
             $data['status'] = '-1';
             $data['data'] = array();
             $data['msg'] = '';
         }
         return $data;
     } else {
         $aid = $request->id;
         if (!is_numeric($aid)) {
             $this->show404();
         }
         $user = Sp_Account_User::current();
         $active = Sp_Active_Active::getActiveById($aid, $user->id);
         if (empty($active)) {
             $this->show404();
         }
         $view = new Sp_View();
         $view->assign('active', $active);
         $view->assign('select', 'letter');
         $view->display("letter/index.html");
     }
 }
Ejemplo n.º 4
0
 /**
  * function description
  *
  * @param
  * @return void
  */
 public function execute($request)
 {
     if ($request->format == 'json') {
         $arrary = array();
         return $array;
     } else {
         $view = new Sp_View();
         $view->display("active/index.html");
     }
 }
 /**
  * function description
  *
  * @param
  * @return void
  */
 public function execute($request)
 {
     global $priv;
     if ($request->format == 'json') {
     } else {
         $view = new Sp_View();
         $view->assign("action", $priv);
         $view->display("account/emailSuccess.html");
     }
 }
Ejemplo n.º 6
0
 public function execute($request)
 {
     global $priv;
     $user = Sp_Account_User::current();
     $user = Sp_Account_User::getUser($user->id, array('name', 'face', 'gender', 'province', 'city', 'area'));
     $uploadInfo = Util_FileUpload::getUpfileKey('huitong');
     $view = new Sp_View();
     $view->assign('user', $user);
     $view->assign('action', $priv);
     $view->assign('uploadInfo', $uploadInfo);
     $view->display("account/password.html");
 }
Ejemplo n.º 7
0
 /**
  * function description
  *
  * @param
  * @return void
  */
 public function execute($request)
 {
     global $priv;
     if ($request->format == 'json') {
         $arrary = array();
         return $array;
     } else {
         $view = new Sp_View();
         $view->assign("action", $priv);
         $view->display("account/emailAuth.html");
     }
 }
Ejemplo n.º 8
0
 /**
  * function description
  *
  * @param
  * @return void
  */
 public function execute($request)
 {
     //echo "导出参会人";
     $this->getTemplate();
     exit;
     if ($request->format == 'json') {
         $arrary = array();
         return $array;
     } else {
         $view = new Sp_View();
         $view->display("active/index.html");
     }
 }
Ejemplo n.º 9
0
 /**
  * function description
  *
  * @param
  * @return void
  */
 public function execute($request)
 {
     if ($request->format == 'json') {
         $activeId = $_POST['activeId'];
         unset($_POST['activeId']);
         $data = $this->dataFormat($_POST, $activeId);
         $model = new Sp_Account_Attendee();
         if ($model->setTableHeader($data)) {
             $return = array('status' => 1, 'msg' => '表头设置成功');
         } else {
             $return = array('status' => 0, 'msg' => '表头设置失败');
         }
         return $return;
     } else {
         $view = new Sp_View();
         $view->display("active/index.html");
     }
 }
 /**
  * function description
  *
  * @param
  * @return void
  */
 public function execute($request)
 {
     if ($request->format == 'json') {
         return array();
     } else {
         $id = $request->id;
         if (!is_numeric($id) || $id < 1) {
             $this->show404();
         }
         $letter = Sp_Letter_Letter::getLetterById($id);
         if (empty($letter)) {
             $this->show404();
         }
         $view = new Sp_View();
         $view->assign("letter", $letter);
         $view->display("letter/createsuccess.html");
     }
 }
Ejemplo n.º 11
0
 /**
  * function description
  *
  * @param
  * @return void
  */
 public function execute($request)
 {
     global $priv;
     if ($request->format == 'json') {
         if ($request->action == 'sendCode') {
             return $this->sendCode($request->mobile);
         } else {
             if ($request->action == 'authCode') {
                 return $this->authCode($request->mobile, $request->code);
             }
         }
         return array('status' => 123, 'msg' => '参数错误');
     } else {
         $view = new Sp_View();
         $view->assign("action", $priv);
         $view->display("account/phoneAuth.html");
     }
 }
Ejemplo n.º 12
0
 /**
  * function description
  *
  * @param
  * @return void
  */
 public function execute($request)
 {
     if ($request->format == 'json') {
         $id = $request->id;
         if (!is_numeric($id)) {
             return array('status' => '-1', 'msg' => '参数错误');
         }
         $letter = Sp_Letter_Letter::getLetterById($id);
         if (is_array($letter) && count($letter) > 0) {
             $letter['pageConfig'] = json_decode($letter['pageConfig'], TRUE);
             $letter['pageItem'] = json_decode($letter['pageItem'], TRUE);
         }
         if (!empty($letter)) {
             $active = Sp_Active_Active::getActiveById($letter['active_id']);
             if (empty($active)) {
                 return array('status' => '-1', 'msg' => '数据有误');
             }
         }
         return array('status' => '0', 'msg' => '获取成功', 'data' => $letter);
     } else {
         $jssdk = new Util_Jssdk("wx91f7f41fce0885bc", "YjlcfXNkdBYjlcfXNkdBYjlcfXNkdBYj");
         $signPackage = $jssdk->GetSignPackage();
         $id = $request->id;
         $id = base64_decode($id);
         $cry = new Util_Crypt3Des();
         $id = $cry->decrypt($id);
         if (!is_numeric($id)) {
             $this->show404();
         }
         $letter = Sp_Letter_Letter::getLetterById($id);
         if (empty($letter)) {
             $this->show404();
         }
         $active = Sp_Active_Active::getActiveById($letter['active_id']);
         if (empty($active)) {
             $this->show404();
         }
         $view = new Sp_View();
         $view->assign("letter", $letter);
         $view->assign('active', $active);
         $view->assign('signPackage', $signPackage);
         $view->display("letter/show.html");
     }
 }
Ejemplo n.º 13
0
 /**
  * function description
  *
  * @param
  * @return void
  */
 public function execute($request)
 {
     /*$total = 90;
     $page = 8;
     $size = 10; 
     $pager = new Util_Pager($total, $page, $size, "?page=%d&activeId=19");
     $offset = $pager->getOffset();
     $pager->setTotal($total);
     echo $pager->renderNav();*/
     $model = new Sp_Account_Attendee();
     $activeId = $request->activeId;
     $header = $model->GetTableHeaderByActiveId($activeId);
     if (false == $header) {
         $showHeader = $this->headers;
     } else {
         $showHeader = $this->getShowHeader($header);
         $showHeader = $model->getColumnFormArr($showHeader, 'title', 'field');
     }
     $columns = array_keys($showHeader);
     array_push($columns, 'id');
     $columns[] = 'status';
     $columns[] = 'checkStatus';
     $dataProvide = $model->AttendeeList($activeId, $columns);
     if ($request->format == 'json') {
         $arrary = array();
         return $array;
     } else {
         /*$user = Sp_Account_User::current();
         		$user = Sp_Account_User::load($user->id);*/
         $aid = $request->activeId;
         if (!is_numeric($aid)) {
             $this->show404();
         }
         $user = Sp_Account_User::current();
         $active = Sp_Active_Active::getActiveById($aid, $user->id);
         if (empty($active)) {
             $this->show404();
         }
         $view = new Sp_View();
         $view->assign('active', $active);
         $view->assign('data', $dataProvide[1]);
         $view->assign('page', $dataProvide[0]);
         $view->assign('header', $showHeader);
         $view->assign('headerSet', json_encode($header));
         $view->assign('activeId', $activeId);
         $view->assign('uploadInfo', $uploadInfo);
         $view->display("attendee/index.html");
     }
 }
 /**
  * function description
  *
  * @param
  * @return void
  */
 public function execute($request)
 {
     if ($request->format == 'json') {
         return array();
     } else {
         $id = $request->id;
         if (empty($id) || !is_numeric($id)) {
             $this->show404();
         }
         $user = Sp_Account_User::current();
         $active = Sp_Active_Active::getActiveById($id, $user->id);
         if (empty($active)) {
             $this->show404();
         }
         $view = new Sp_View();
         $view->assign("active", $active);
         $view->display("active/createsuccess.html");
     }
 }
Ejemplo n.º 15
0
 /**
  * function description
  *
  * @param
  * @return void
  */
 public function execute($request)
 {
     $url = $request->url;
     if (!empty($url)) {
         // $cry = new Util_Crypt3Des();
         // $id = $cry->encrypt($id);
         // $id = base64_encode($id);
         //
         // include LIB_ROOT."third/phpqrcode/phpqrcode.php";
         //
         // // 纠错级别:L、M、Q、H
         // $level = 'L';
         // // 点的大小:1到10,用于手机端4就可以了
         // $size = 4;
         // // 下面注释了把二维码图片保存到本地的代码,如果要保存图片,用$fileName替换第二个参数fal
         // QRcode::png($url, false, $level, $size);
         $view = new Sp_View();
         $view->display("letter/demo.html");
     } else {
         $this->show404();
     }
 }
Ejemplo n.º 16
0
 public function execute($request)
 {
     $view = new Sp_View();
     $request = Request::current();
     $order_sn = $request->c_order;
     $order_id = $request->c_orderid;
     $order_amount = $request->c_orderamount;
     $the_order = Sp_Shopping_Order::load($order_sn, 'odrcode');
     if (!$the_order->ID or $the_order->ID != $order_id) {
         $view->assign('error_message', "错误的订单编号");
         $view->out_404();
         return;
     }
     $TruePr = $the_order["TruePr"];
     $ComePr = $the_order["ComePr"];
     $BackPr = $the_order["BackPr"];
     $the_order['order_amount'] = round($TruePr - $ComePr + $BackPr, 2);
     $Payment = Sp_Payment::factory("alipay");
     $params = array('order_id' => $order_id, 'order_sn' => $order_sn, 'order_amount' => $the_order['order_amount']);
     $link = $Payment->prepare($params);
     echo $link;
 }
Ejemplo n.º 17
0
 function __construct()
 {
     parent::__construct();
     $tpl_dir = isset($_SERVER["DOCUMENT_ROOT"]) ? $_SERVER["DOCUMENT_ROOT"] . '/templates/' : '';
     if (!empty($tpl_dir) && is_dir($tpl_dir)) {
         $this->template_dir = $tpl_dir;
     }
     $this->assign('tpl_header', $this->template_dir . 'header.html');
     $this->assign('tpl_footer', $this->template_dir . 'footer.html');
     $this->assign('user', Sp_Admin_User::getUser());
     $request = Request::current();
     $this->assign('ancient_browser', preg_match("#MSIE [1-8]\\.#", $request->getAgent()));
 }
Ejemplo n.º 18
0
 /**
  * function description
  *
  * @param
  * @return void
  */
 public function execute($request)
 {
     if ($request->format == 'json') {
         $action = $request->action;
         if ($action == 'add') {
             return $this->addAttendee();
         } else {
             if ($action == 'signIn') {
                 return $this->signIn($_POST['dataId']);
             } else {
                 if ($action == 'signOut') {
                     return $this->signOut($_POST['dataId']);
                 } else {
                     if ($action == 'delete') {
                         return $this->attendeeDelete($_POST['dataId']);
                     }
                 }
             }
         }
     } else {
         $view = new Sp_View();
         $view->display("active/index.html");
     }
 }
Ejemplo n.º 19
0
 public function execute($request)
 {
     global $priv;
     $user = Sp_Account_User::current();
     $uploadInfo = Util_FileUpload::getUpfileKey('huitong');
     $province = Sp_City_City::getProvince();
     $view = new Sp_View();
     $userInfo = Sp_Account_User::getUser($user->id, array('name', 'face', 'gender', 'province', 'city', 'area', 'mobile_status', 'email_status'));
     $auth = array('mobile_status' => $userInfo['mobile_status'], 'email_status' => $userInfo['email_status']);
     $view->assign('province', $province);
     $view->assign('action', $priv);
     $view->assign('auth', $auth);
     if (!empty($userInfo['province'])) {
         $city = Sp_City_City::getChlidById($userInfo['province']);
         $view->assign('city', $city);
     }
     if (!empty($userInfo['city'])) {
         $arrea = Sp_City_City::getChlidById($userInfo['city']);
         $view->assign('arrea', $arrea);
     }
     $view->assign('uploadInfo', $uploadInfo);
     $view->display("account/index.html");
 }
Ejemplo n.º 20
0
 /**
  * 支付完成后返回处理
  * 
  * @param array params
  * @return void
  */
 public function complete($params)
 {
     $view = new Sp_View();
     #	解析返回参数.
     $return = Sp_Payment_Yeepay_Common::getCallBackValue($r0_Cmd, $r1_Code, $r2_TrxId, $r3_Amt, $r4_Cur, $r5_Pid, $r6_Order, $r7_Uid, $r8_MP, $r9_BType, $hmac);
     #	判断返回签名是否正确(True/False)
     $bRet = Sp_Payment_Yeepay_Common::CheckHmac($r0_Cmd, $r1_Code, $r2_TrxId, $r3_Amt, $r4_Cur, $r5_Pid, $r6_Order, $r7_Uid, $r8_MP, $r9_BType, $hmac);
     #	以上代码和变量不需要修改.
     #	校验码正确.
     if ($bRet) {
         if ($r1_Code == "1") {
             #	需要比较返回的金额与商家数据库中订单的金额是否相等,只有相等的情况下才认为是交易成功.
             #	并且需要对返回的处理进行事务控制,进行记录的排它性处理,在接收到支付结果通知后,判断是否进行过业务逻辑处理,不要重复进行业务逻辑处理,防止对同一条交易重复发货的情况发生.
             $user_id = $r8_MP;
             //用户id
             $sn = trim($r6_Order);
             //订单号
             $amount = floatval($r3_Amt);
             //金额
             $recharge_info = Sp_Trade_Recharge::getBySn($sn);
             if (floatval($recharge_info['amount']) == $amount and $recharge_info['user_id'] == $user_id) {
                 if ($r9_BType == "1") {
                     #交易成功 在线支付页面返回
                     $request = Request::current();
                     if ($request->isMobile()) {
                         Loader::redirect(SP_URL_WAP . 'moneyrecord.html');
                     } else {
                         Loader::redirect(SP_URL_USER . 'moneyrecord.html');
                     }
                     /*
                     						$ret = false;
                     						if($recharge_info['status'] < 1) {
                     							$param = array(
                     								'id' => $recharge_info['id'],
                     								'user_id' => $user_id,
                     								'sn' => $sn,
                     								'amount' => $amount,
                     								'bank_sn' => $_REQUEST['ro_BankOrderId'],
                     								'trd_sn' => $_REQUEST['r2_TrxId'],
                     								'remark' => json_encode($_REQUEST)
                     							);
                     							$ret = Sp_Trade_Tradeprocess::recharge($param);
                     						}
                     						if($ret) {//处理成功
                     							$user = Sp_Account_User::getUserBase($user_id); //用户信息
                     							$data = array(
                     								'user_id' => $user_id,
                     								'account' => $amount,
                     								'user_name' => $user->data["username"],
                     								'email' => $user->data['email'],
                     								'realname' => $user->data["username"],
                     								'phone' => $user->data['phone'],
                     							);
                     							Sp_Message::send('recharge', $data);//发送消息
                     							Loader::redirect(SP_URL_USER.'moneyrecord.html');
                     						}elseif($recharge_info['status'] < 1) {//失败
                     							echo '资金流处理失败!';
                     							$body = print_r($_REQUEST,true);
                     							Sp_Admin_Mail::send('*****@*****.**', '资金流处理失败!', $body);
                     						}else{
                     							$request = Request::current();
                     							if($request->isMobile()) {
                     								Loader::redirect(SP_URL_WAP.'moneyrecord.html');
                     							}else{
                     								Loader::redirect(SP_URL_USER.'moneyrecord.html');
                     							}
                     						}*/
                 } elseif ($r9_BType == "2") {
                     #如果需要应答机制则必须回写流,以success开头,大小写不敏感.
                     $ret = false;
                     if ($recharge_info['status'] == 1) {
                         echo "success";
                     } elseif ($recharge_info['status'] < 1) {
                         $param = array('id' => $recharge_info['id'], 'user_id' => $user_id, 'sn' => $sn, 'amount' => $amount, 'bank_sn' => $_REQUEST['ro_BankOrderId'], 'trd_sn' => $_REQUEST['r2_TrxId'], 'remark' => json_encode($_REQUEST));
                         $amount_num = Sp_Trade_Recharge::getUserRechargeReport('WHERE status = 1 AND user_id=' . $user_id);
                         $ret = Sp_Trade_Tradeprocess::recharge($param);
                         if ($ret) {
                             //处理成功
                             //首冲奖励
                             if ($amount_num == 0) {
                                 $active_send_info = array('uid' => $user_id, 'type' => 'first_recharge');
                                 $client_active = MQClient::factory('active');
                                 $client_active->send('activePrizeReset_new_register', $active_send_info);
                             }
                             $user = Sp_Account_User::getUserBase($user_id);
                             //用户信息
                             $data = array('user_id' => $user_id, 'account' => $amount, 'user_name' => $user->data["username"], 'email' => $user->data['email'], 'realname' => $user->data["username"], 'phone' => $user->data['phone']);
                             Sp_Message::send('recharge', $data);
                             //发送消息
                         } else {
                             echo '资金流处理失败!';
                             $body = print_r($_REQUEST, true);
                             Sp_Admin_Mail::send('*****@*****.**', '资金流处理失败!', $body);
                         }
                     }
                 }
             }
         }
     } else {
         $body = print_r($_REQUEST, true);
         Sp_Admin_Mail::send('*****@*****.**', '易宝支付失败(签名验证失败)', $body);
         $view->assign('error_message', "抱歉,您的支付没有成功,请重新支付,谢谢");
         $view->out_404();
         return;
     }
 }
Ejemplo n.º 21
0
 /**
  * function description
  *
  * @param
  * @return void
  */
 public function execute($request)
 {
     if ($request->format == 'json') {
         $id = $request->id;
         $activit_end = $request->activit_end;
         //活动结束时间
         $activit_start = $request->activit_start;
         //活动开始时间
         $address = $request->address;
         //详细地址
         $arrea = $request->arrea;
         //区域
         $city = $request->city;
         //城市
         $enroll_end = $request->enroll_end;
         $enroll_start = $request->enroll_start;
         $is_audit = $request->is_audit;
         $is_enroll = $request->is_enroll;
         //是否需要审核
         $province = $request->province;
         //省份
         $title = $request->title;
         //标题
         $thumbnail = $request->thumbnail;
         $enroll_num = $request->enroll_num;
         if (!is_numeric($id) || empty($title) || empty($activit_end) || empty($activit_end) || empty($address) || empty($province) || empty($city)) {
             return array('status' => '-5', 'msg' => '参数错误');
         }
         if (!empty($is_enroll) && (empty($is_audit) || empty($enroll_start) || empty($enroll_end))) {
             return array('status' => '-5', 'msg' => '完善活动时间选项');
         }
         if (strtotime($activit_end) < strtotime($activit_start)) {
             return array('status' => '-5', 'msg' => '举办结束日期不能小于开始日期');
         }
         $user = Sp_Account_User::current();
         $active = array();
         $active['activit_end'] = strtotime($activit_end);
         $active['activit_start'] = strtotime($activit_start);
         $active['address'] = $address;
         $active['arrea'] = empty($arrea) ? 0 : $arrea;
         $active['city'] = $city;
         $active['province'] = $province;
         $active['title'] = $title;
         $active['user_id'] = $user->id;
         $active['thumbnail'] = $thumbnail;
         if (!empty($is_audit)) {
             if (strtotime($enroll_end) < strtotime($enroll_start)) {
                 return array('status' => '-5', 'msg' => '报名结束日期不能小于开始日期');
             }
             if (!is_numeric($enroll_num)) {
                 return array('status' => '-5', 'msg' => '人数不能为空');
             }
             $active['is_audit'] = 1;
             $active['is_enroll'] = 1;
             $active['enroll_start'] = strtotime($enroll_start);
             $active['enroll_end'] = strtotime($enroll_end);
             $active['enroll_num'] = $enroll_num;
         } else {
             $active['is_audit'] = 0;
             $active['is_enroll'] = 0;
             $active['enroll_start'] = 0;
             $active['enroll_end'] = 0;
             $active['enroll_num'] = 0;
         }
         $user = Sp_Account_User::current();
         $ret = Sp_Active_Active::updateById($id, $active, $user->id);
         return array('status' => '0', 'msg' => '修改成功');
         // if($ret){
         //
         // }else{
         // return array('status'=>'-1','msg'=>'修改失败');
         // }
     } else {
         $aid = $request->id;
         if (!is_numeric($aid)) {
             $this->show404();
         }
         $user = Sp_Account_User::current();
         $active = Sp_Active_Active::getActiveById($aid, $user->id);
         if (empty($active)) {
             $this->show404();
         }
         $province = Sp_City_City::getProvince();
         $city = Sp_City_City::getChlidById($active['province']);
         $arrea = Sp_City_City::getChlidById($active['city']);
         $view = new Sp_View();
         $uploadInfo = Util_FileUpload::getUpfileKey('huitong');
         $view->assign('province', $province);
         $view->assign('city', $city);
         $view->assign('arrea', $arrea);
         $view->assign('uploadInfo', $uploadInfo);
         $view->assign('option', 'edit');
         $view->assign('active', $active);
         $view->display("active/create.html");
     }
 }
Ejemplo n.º 22
0
<?php

include_once "init.php";
include_once LIB_ROOT . "Sp/View.php";
include_once LIB_ROOT . "Sp/Taobao/Goods.php";
include_once LIB_ROOT . "Sp/Taobao/Shop.php";
include_once LIB_ROOT . "Sp/Taobao/Taobaoke.php";
$sp_view = new Sp_View('utf-8');
$nick = isset($_GET['nick']) ? $_GET['nick'] : $sp_view->out_404(true);
//静态编码网址转码
if (Config::get('special.static') == '1') {
    $nick = htmlspecialchars(url_base64_decode($nick));
}
//$goods = Sp_Taobao_Shop::getCategoes($nick,0,1,10);
//print_r($goods);
//商铺信息
$shop_info = Sp_Taobao_Shop::getShopinfo($nick);
if (isset($shop_info['shop'])) {
    $info = Sp_Taobao_Taobaoke::getShopsConvert($shop_info['shop']['sid'], Config::get('taoke.pid_short'));
    $click_url = $info['taobaoke_shops']['taobaoke_shop']['click_url'];
    $shop_info['shop']['click_url'] = $click_url;
}
//商店商品分类信息
$goods = Sp_Taobao_Goods::getShopItems($nick, null, 1, 1);
//按分类产品数量倒序
$category = $goods['item_search']['item_categories']['item_category'];
$category = array_sort($category, 'count', 'desc');
//最多取8个分类的商品,并且每个分类下的产品数量要大于4
$step = count($category) < 8 ? count($category) : 8;
$category = array_slice($category, 0, $step);
$catids = "";
Ejemplo n.º 23
0
$a['sales'] = Config::get('huodongarray');
print_r($a);
//$new_file = DATA_CURRENT . 'index_temp.php';
$new_file = DATA_CURRENT . 'index_hot_sales.php';
file_put_contents($new_file, '<?php return ' . var_export($a, true) . ';');

die();
*/
//装载页面数据
Config::load(DATA_CURRENT . 'index_hot_categores.php');
Config::load(DATA_CURRENT . 'index_hot_focus.php');
Config::load(DATA_CURRENT . 'index_hot_brands.php');
Config::load(DATA_CURRENT . 'index_hot_sales.php');
Config::load(DATA_CURRENT . 'index_categores.php');
//TODO 改为从数据文件中读取默认值
foreach (Config::get('index_categores') as $key => $category) {
    $goods = Sp_Taobao_Goods::getCategoryItems($category['catid'], 40, Config::get('taoke.pid_short'));
    //从40个商品中随机取8个
    shuffle($goods['taobaoke_items']['taobaoke_item']);
    $goods['taobaoke_items']['taobaoke_item'] = array_slice($goods['taobaoke_items']['taobaoke_item'], 0, 8);
    $category = array_merge($category, $goods);
    Config::set('index_categores.' . $key, $category);
}
$sp_view = new Sp_View('utf-8');
$sp_view->addStyle('index.css');
//$sp_view->setTitle("测试");
$sp_view->setConfig(Config::get());
$sp_view->display("index.html");
//$url = "http://more.handlino.com/sentences.json?n=10&corpus=";
//$result = file_get_contents($url);
//print_r(json_decode($result));
Ejemplo n.º 24
0
 /**
  * function description
  *
  * @param
  * @return void
  */
 public function execute($request)
 {
     $view = new Sp_View();
     $view->out_404();
 }
Ejemplo n.º 25
0
<?php

include_once "init.php";
include_once LIB_ROOT . "Sp/View.php";
include_once LIB_ROOT . "Sp/Pager.php";
include_once LIB_ROOT . "Sp/Taobao/Goods.php";
include_once LIB_ROOT . "Sp/Taobao/Shop.php";
//list-1801-0-1-10000-w!bEpA-2.html
$cache_id = 'list|' . md5(var_export($_GET, true));
$sp_view = new Sp_View('utf-8');
if (!$sp_view->isCached('list.html', $cache_id)) {
    $cid = isset($_GET['catid']) ? $_GET['catid'] : 0;
    $sort = isset($_GET['sort']) ? $_GET['sort'] : 1;
    $start_price = isset($_GET['sp']) ? $_GET['sp'] : Config::get('special.start_price');
    $end_price = isset($_GET['ep']) ? $_GET['ep'] : Config::get('special.end_price');
    $keyword = isset($_GET['sq']) ? $_GET['sq'] : '';
    $page_no = isset($_GET['page']) ? $_GET['page'] : 1;
    $page_size = 36;
    //静态编码网址转码
    if (Config::get('special.static') == '1') {
        $keyword = htmlspecialchars(url_base64_decode($keyword));
        if ($keyword != '') {
            $encode_keyword = url_base64_encode($keyword);
            $url_format = "list-{$cid}-{$sort}-{$start_price}-{$end_price}-{$encode_keyword}-%d.html";
        } else {
            $url_format = "list-{$cid}-{$sort}-{$start_price}-{$end_price}-%d.html";
        }
        //$url_format = "?catid=$cid&page=%d&sq=$keyword":"?catid=$cid&page=%d";
    } else {
        if ($keyword != '') {
            $url_format = "list.php?catid={$cid}&sortnum={$sort}&sp={$start_price}&ep={$end_price}&sq={$keyword}&page=%d";
Ejemplo n.º 26
0
<?php

include_once "init.php";
include_once LIB_ROOT . "Sp/View.php";
include_once LIB_ROOT . "Sp/Taobao/Goods.php";
include_once LIB_ROOT . "Sp/Taobao/Shop.php";
include_once LIB_ROOT . "Sp/Taobao/Taobaoke.php";
$sp_view = new Sp_View('utf-8');
$cache_id = 'goods|' . md5(var_export($_GET, true));
if (!$sp_view->isCached('goods.html', $cache_id)) {
    $num_iid = isset($_GET['iid']) ? $_GET['iid'] : $sp_view->out_404(true);
    /*
    $categores = Sp_Taobao_Shop::getCategoes('康美健食品专营店');
    print_r($categores);
    die();
    */
    //取商品详情
    $goods_detail = Sp_Taobao_Goods::getItemDetail($num_iid);
    //淘宝客点击url
    $url = Sp_Taobao_Taobaoke::getItemConvert($num_iid, Config::get('taoke.pid_short'));
    $cid = $goods_detail["item"]['cid'];
    $props = $goods_detail["item"]['props'];
    //商品属性
    $props = Sp_Taobao_Goods::getItemPropValues($cid, $props);
    //商品分类信息
    $catgory = Sp_Taobao_Goods::getItemcats($cid);
    //当前分类的推荐商品
    $cat_goods = Sp_Taobao_Goods::getCategoryItems($cid, 40, Config::get('taoke.pid_short'));
    //从40个商品中随机取8个
    shuffle($cat_goods['taobaoke_items']['taobaoke_item']);
    $cat_goods['taobaoke_items']['taobaoke_item'] = array_slice($cat_goods['taobaoke_items']['taobaoke_item'], 0, 8);
Ejemplo n.º 27
0
 /**
  * 接收支付平台通知(同步)
  * 
  * @param array params
  * @return void
  */
 public function complete($params)
 {
     $view = new Sp_View();
     #	解析返回参数.
     $version = $params["version"];
     $charset = $params["charset"];
     $language = $params["language"];
     $signType = $params["signType"];
     $tranCode = $params["tranCode"];
     $merchantID = $params["merchantID"];
     $merOrderNum = $params["merOrderNum"];
     $tranAmt = $params["tranAmt"];
     $feeAmt = $params["feeAmt"];
     $frontMerUrl = $params["frontMerUrl"];
     $backgroundMerUrl = $params["backgroundMerUrl"];
     $tranDateTime = $params["tranDateTime"];
     $tranIP = $params["tranIP"];
     $respCode = $params["respCode"];
     $msgExt = $params["msgExt"];
     $orderId = $params["orderId"];
     $gopayOutOrderId = $params["gopayOutOrderId"];
     $bankCode = $params["bankCode"];
     $tranFinishTime = $params["tranFinishTime"];
     $merRemark1 = $params["merRemark1"];
     $merRemark2 = $params["merRemark2"];
     $signValue = $params["signValue"];
     #	判断返回签名是否正确(True/False)
     $bRet = Sp_Payment_Gopay_HttpClient::CheckHmac($version, $tranCode, $merchantID, $merOrderNum, $tranAmt, $feeAmt, $tranDateTime, $frontMerUrl, $backgroundMerUrl, $orderId, $gopayOutOrderId, $tranIP, $respCode, '', self::$verficationCode, $signValue);
     if ($bRet) {
         if ($respCode == '0000') {
             $sn = trim($merOrderNum);
             //订单号
             $amount = floatval($tranAmt);
             //金额
             $recharge_info = Sp_Trade_Recharge::getBySn($sn);
             if (floatval($recharge_info['amount']) == $amount) {
                 $ret = false;
                 $amount_num = 1;
                 if ($recharge_info['status'] == 1) {
                     $ret = true;
                 } elseif ($recharge_info['status'] < 1) {
                     $amount_num = Sp_Trade_Recharge::getUserRechargeReport('WHERE status = 1 AND user_id=' . $recharge_info['user_id']);
                     $param = array('id' => $recharge_info['id'], 'user_id' => $recharge_info['user_id'], 'sn' => $sn, 'amount' => $amount, 'bank_sn' => $_REQUEST['gopayOutOrderId'], 'trd_sn' => $_REQUEST['orderId'], 'remark' => json_encode($_REQUEST));
                     $ret = Sp_Trade_Tradeprocess::recharge($param);
                 }
                 if ($ret) {
                     //处理成功
                     //首冲奖励
                     if ($amount_num == 0) {
                         $active_send_info = array('uid' => $recharge_info['user_id'], 'type' => 'first_recharge');
                         $client_active = MQClient::factory('active');
                         $client_active->send('activePrizeReset_new_register', $active_send_info);
                     }
                     $user = Sp_Account_User::getUserBase($recharge_info['user_id']);
                     //用户信息
                     $data = array('user_id' => $recharge_info['user_id'], 'account' => $amount, 'user_name' => $user->data["username"], 'email' => $user->data['email'], 'realname' => $user->data["username"], 'phone' => $user->data['phone']);
                     Sp_Message::send('recharge', $data);
                     //发送消息
                     $request = Request::current();
                     if ($request->isMobile()) {
                         Loader::redirect(SP_URL_WAP . 'moneyrecord.html');
                     } else {
                         Loader::redirect(SP_URL_USER . 'moneyrecord.html');
                     }
                 } else {
                     echo 'RespCode=9999|JumpURL=';
                     $body = print_r($_REQUEST, true);
                     Sp_Admin_Mail::send('*****@*****.**', '国付宝支付失败(数据库操作失败)', $body);
                 }
             }
         } else {
             echo 'RespCode=9999|JumpURL=';
             $body = print_r($_REQUEST, true);
             Sp_Admin_Mail::send('*****@*****.**', '国付宝支付失败(国付宝操作失败)', $body);
         }
     } else {
         $body = print_r($_REQUEST, true);
         Sp_Admin_Mail::send('*****@*****.**', '国付宝支付失败(签名验证失败)', $body);
         $view->assign('error_message', "抱歉,您的支付没有成功,请重新支付,谢谢");
         $view->out_404();
         return;
     }
 }