/** * Page のAction. * * @return void */ public function action() { switch ($this->getMode()) { case 'confirm': // トークンを設定 $this->refusal_transactionid = $this->getRefusalToken(); $this->tpl_mainpage = 'mypage/refusal_confirm.tpl'; $this->tpl_subtitle = '退会手続き(確認ページ)'; break; case 'complete': // トークン入力チェック if (!$this->isValidRefusalToken()) { // エラー画面へ遷移する SC_Utils_Ex::sfDispSiteError(PAGE_ERROR, '', true); SC_Response_Ex::actionExit(); } $objCustomer = new SC_Customer_Ex(); $this->lfSendRefusalMail($objCustomer->getValue('customer_id')); $this->lfDeleteCustomer($objCustomer->getValue('customer_id')); $objCustomer->EndSession(); SC_Response_Ex::sendRedirect('refusal_complete.php'); break; default: if (SC_Display_Ex::detectDevice() == DEVICE_TYPE_MOBILE) { $this->refusal_transactionid = $this->getRefusalToken(); } break; } }
/** * Page のアクション. * * @return void */ public function action() { $objCustomer = new SC_Customer_Ex(); // クッキー管理クラス $objCookie = new SC_Cookie_Ex(); // ログイン判定 if ($objCustomer->isLoginSuccess()) { $this->tpl_login = true; $this->tpl_user_point = $objCustomer->getValue('point'); $this->tpl_name1 = $objCustomer->getValue('name01'); $this->tpl_name2 = $objCustomer->getValue('name02'); } else { // クッキー判定 $this->tpl_login_email = $objCookie->getCookie('login_email'); if ($this->tpl_login_email != '') { $this->tpl_login_memory = '1'; } // POSTされてきたIDがある場合は優先する。 if (isset($_POST['login_email']) && $_POST['login_email'] != '') { $this->tpl_login_email = $_POST['login_email']; } } $this->tpl_disable_logout = $this->lfCheckDisableLogout(); //スマートフォン版ログアウト処理で不正なページ移動エラーを防ぐ為、トークンをセット $this->transactionid = SC_Helper_Session_Ex::getToken(); }
/** * Page のプロセス. * * @return void */ public function process() { parent::process(); // ログインチェック $objCustomer = new SC_Customer_Ex(); // ログインしていない場合は必ずログインページを表示する if ($objCustomer->isLoginSuccess(true) === false) { // クッキー管理クラス $objCookie = new SC_Cookie_Ex(); // クッキー判定(メールアドレスをクッキーに保存しているか) $this->tpl_login_email = $objCookie->getCookie('login_email'); if ($this->tpl_login_email != '') { $this->tpl_login_memory = '1'; } // POSTされてきたIDがある場合は優先する。 if (isset($_POST['login_email']) && $_POST['login_email'] != '') { $this->tpl_login_email = $_POST['login_email']; } // 携帯端末IDが一致する会員が存在するかどうかをチェックする。 if (SC_Display_Ex::detectDevice() === DEVICE_TYPE_MOBILE) { $this->tpl_valid_phone_id = $objCustomer->checkMobilePhoneId(); } $this->tpl_title = 'MYページ(ログイン)'; $this->tpl_mainpage = 'mypage/login.tpl'; } else { //マイページ会員情報表示用共通処理 $this->tpl_login = true; $this->CustomerName1 = $objCustomer->getValue('name01'); $this->CustomerName2 = $objCustomer->getValue('name02'); $this->CustomerPoint = $objCustomer->getValue('point'); $this->action(); } $this->sendResponse(); }
/** * 受注を完了する. * * 下記のフローで受注を完了する. * * 1. トランザクションを開始する * 2. カートの内容を検証する. * 3. 受注一時テーブルから受注データを読み込む * 4. ユーザーがログインしている場合はその他の発送先へ登録する * 5. 受注データを受注テーブルへ登録する * 6. トランザクションをコミットする * * 実行中に, 何らかのエラーが発生した場合, 処理を中止しエラーページへ遷移する * * 決済モジュールを使用する場合は対応状況を「決済処理中」に設定し, * 決済完了後「新規受付」に変更すること * * @param integer $orderStatus 受注処理を完了する際に設定する対応状況 * @return void */ function completeOrder($orderStatus = ORDER_NEW) { $objQuery =& SC_Query_Ex::getSingletonInstance(); $objSiteSession = new SC_SiteSession_Ex(); $objCartSession = new SC_CartSession_Ex(); $objCustomer = new SC_Customer_Ex(); $customerId = $objCustomer->getValue('customer_id'); $objQuery->begin(); if (!$objSiteSession->isPrePage()) { SC_Utils_Ex::sfDispSiteError(PAGE_ERROR, $objSiteSession); } $uniqId = $objSiteSession->getUniqId(); $this->verifyChangeCart($uniqId, $objCartSession); $orderTemp = $this->getOrderTemp($uniqId); $orderTemp['status'] = $orderStatus; $cartkey = $objCartSession->getKey(); $order_id = $this->registerOrderComplete($orderTemp, $objCartSession, $cartkey); $isMultiple = SC_Helper_Purchase::isMultiple(); $shippingTemp =& $this->getShippingTemp($isMultiple); foreach ($shippingTemp as $shippingId => $val) { $this->registerShipmentItem($order_id, $shippingId, $val['shipment_item']); } $this->registerShipping($order_id, $shippingTemp); $objQuery->commit(); //会員情報の最終購入日、購入合計を更新 if ($customerId > 0) { SC_Customer_Ex::updateOrderSummary($customerId); } $this->cleanupSession($order_id, $objCartSession, $objCustomer, $cartkey); GC_Utils_Ex::gfPrintLog('order complete. order_id=' . $order_id); }
/** * Page のAction. * * @return void */ public function action() { //決済処理中ステータスのロールバック $objPurchase = new SC_Helper_Purchase_Ex(); $objPurchase->cancelPendingOrder(PENDING_ORDER_CANCEL_FLAG); $objCustomer = new SC_Customer_Ex(); $customer_id = $objCustomer->getValue('customer_id'); //ページ送り用 $this->objNavi = new SC_PageNavi_Ex($_REQUEST['pageno'], $this->lfGetOrderHistory($customer_id), SEARCH_PMAX, 'eccube.movePage', NAVI_PMAX, 'pageno=#page#', SC_Display_Ex::detectDevice() !== DEVICE_TYPE_MOBILE); $this->arrOrder = $this->lfGetOrderHistory($customer_id, $this->objNavi->start_row); switch ($this->getMode()) { case 'getList': echo SC_Utils_Ex::jsonEncode($this->arrOrder); SC_Response_Ex::actionExit(); break; default: break; } // 支払い方法の取得 $this->arrPayment = SC_Helper_Payment_Ex::getIDValueList(); // 1ページあたりの件数 $this->dispNumber = SEARCH_PMAX; $this->json_payment = SC_Utils::jsonEncode($this->arrPayment); $this->json_customer_order_status = SC_Utils::jsonEncode($this->arrCustomerOrderStatus); }
/** * Page のAction. * * @return void */ function action() { $objCustomer = new SC_Customer_Ex(); $objDb = new SC_Helper_DB_Ex(); $objPurchase = new SC_Helper_Purchase_Ex(); if (!SC_Utils_Ex::sfIsInt($_GET['order_id'])) { SC_Utils_Ex::sfDispSiteError(CUSTOMER_ERROR); } $order_id = $_GET['order_id']; //受注データの取得 $this->tpl_arrOrderData = $objPurchase->getOrder($order_id, $objCustomer->getValue('customer_id')); if (empty($this->tpl_arrOrderData)) { SC_Utils_Ex::sfDispSiteError(CUSTOMER_ERROR); } $this->arrShipping = $this->lfGetShippingDate($objPurchase, $order_id, $this->arrWDAY); $this->isMultiple = count($this->arrShipping) > 1; // 支払い方法の取得 $this->arrPayment = $objDb->sfGetIDValueList('dtb_payment', 'payment_id', 'payment_method'); // 受注商品明細の取得 $this->tpl_arrOrderDetail = $objPurchase->getOrderDetail($order_id); $this->tpl_arrOrderDetail = $this->setMainListImage($this->tpl_arrOrderDetail); $objPurchase->setDownloadableFlgTo($this->tpl_arrOrderDetail); // モバイルダウンロード対応処理 $this->lfSetAU($this->tpl_arrOrderDetail); // 受注メール送信履歴の取得 $this->tpl_arrMailHistory = $this->lfGetMailHistory($order_id); }
/** * Page のAction. * * @return void */ function action() { $objCustomer = new SC_Customer_Ex(); if (!SC_Utils_Ex::sfIsInt($_GET['send_id'])) { SC_Utils_Ex::sfDispSiteError(CUSTOMER_ERROR); } $arrMailView = $this->lfGetMailView($_GET['send_id'], $objCustomer->getValue('customer_id')); if (empty($arrMailView)) { SC_Utils_Ex::sfDispSiteError(CUSTOMER_ERROR); } $this->tpl_subject = $arrMailView[0]['subject']; $this->tpl_body = $arrMailView[0]['mail_body']; if (SC_Display_Ex::detectDevice() === DEVICE_TYPE_PC) { $this->setTemplate('mypage/mail_view.tpl'); } else { $this->tpl_title = 'メール履歴詳細'; $this->tpl_mainpage = 'mypage/mail_view.tpl'; } switch ($this->getMode()) { case 'getDetail': echo SC_Utils_Ex::jsonEncode($arrMailView); SC_Response_Ex::actionExit(); break; default: break; } }
/** * Page のAction. * * @return void */ public function action() { $objCustomer = new SC_Customer_Ex(); $customer_id = $objCustomer->getValue('customer_id'); switch ($this->getMode()) { case 'delete_favorite': // お気に入り削除 $this->lfDeleteFavoriteProduct($customer_id, intval($_POST['product_id'])); break; case 'getList': // スマートフォン版のもっと見るボタン用 // ページ送り用 if (isset($_POST['pageno'])) { $this->tpl_pageno = intval($_POST['pageno']); } $this->arrFavorite = $this->lfGetFavoriteProduct($customer_id, $this); SC_Product_Ex::setPriceTaxTo($this->arrFavorite); // 一覧メイン画像の指定が無い商品のための処理 foreach ($this->arrFavorite as $key => $val) { $this->arrFavorite[$key]['main_list_image'] = SC_Utils_Ex::sfNoImageMainList($val['main_list_image']); } echo SC_Utils_Ex::jsonEncode($this->arrFavorite); SC_Response_Ex::actionExit(); break; default: break; } // ページ送り用 if (isset($_POST['pageno'])) { $this->tpl_pageno = intval($_POST['pageno']); } $this->arrFavorite = $this->lfGetFavoriteProduct($customer_id, $this); // 1ページあたりの件数 $this->dispNumber = SEARCH_PMAX; }
/** * Page のAction. * * @return void */ function action() { $objProduct = new SC_Product_Ex(); $objCustomer = new SC_Customer_Ex(); $customer_id = $objCustomer->getValue('customer_id'); switch ($this->getMode()) { case 'delete_favorite': // お気に入り削除 $this->lfDeleteFavoriteProduct($customer_id, intval($_POST['product_id'])); break; case 'getList': // スマートフォン版のもっと見るボタン用 // ページ送り用 if (isset($_POST['pageno'])) { $this->tpl_pageno = intval($_POST['pageno']); } $this->arrFavorite = $this->lfGetFavoriteProduct($customer_id, $this); $this->arrFavorite = $objProduct->setPriceTaxTo($this->arrFavorite); echo SC_Utils_Ex::jsonEncode($this->arrFavorite); SC_Response_Ex::actionExit(); break; } // ページ送り用 if (isset($_POST['pageno'])) { $this->tpl_pageno = intval($_POST['pageno']); } $this->arrFavorite = $this->lfGetFavoriteProduct($customer_id, $this); // 1ページあたりの件数 $this->dispNumber = SEARCH_PMAX; }
/** * Page を初期化する. * * @return void */ function init() { parent::init(); $objCustomer = new SC_Customer_Ex(); // 画面更新毎に情報を更新する if ($objCustomer->isLoginSuccess()) { // 初回アクセス時に更新 $objCustomer->updateSession(); $this->tpl_login = true; $this->tpl_point = $objCustomer->getValue("point"); $this->tpl_customer_id = $objCustomer->getValue("customer_id"); $this->tpl_first_buy_date = $objCustomer->getValue("first_buy_date"); $this->tpl_carrier = $objCustomer->getValue("carrier"); } $objDB = new SC_Helper_DB_Ex(); $this->arrSiteInfo = $objDB->sfGetBasisData(); }
/** * Page のアクション. * * @return void */ public function action() { $objCustomer = new SC_Customer_Ex(); $objFormParam = new SC_FormParam_Ex(); $this->lfInitParam($objFormParam); $objFormParam->setParam($_POST); if ($_SERVER['REQUEST_METHOD'] == 'POST') { $this->arrErr = $this->lfCheckError($objFormParam); if (empty($this->arrErr)) { $email_mobile = $this->lfRegistEmailMobile(strtolower($objFormParam->getValue('email_mobile')), $objCustomer->getValue('customer_id')); $objCustomer->setValue('email_mobile', $email_mobile); $this->tpl_mainpage = 'entry/email_mobile_complete.tpl'; $this->tpl_title = '携帯メール登録完了'; } } $this->tpl_name = $objCustomer->getValue('name01'); $this->arrForm = $objFormParam->getFormParamList(); }
/** * Page のAction. * * @return void */ function action() { switch ($this->getMode()) { case 'confirm': $this->tpl_mainpage = 'mypage/refusal_confirm.tpl'; $this->tpl_subtitle = '退会手続き(確認ページ)'; break; case 'complete': $objCustomer = new SC_Customer_Ex(); $this->lfDeleteCustomer($objCustomer->getValue('customer_id')); $objCustomer->EndSession(); SC_Response_Ex::sendRedirect('refusal_complete.php'); } }
/** * Page を初期化する. * * @return void */ function init() { parent::init(); $objPagelayout = new SC_Helper_PageLayout_Ex(); $php_path_dir = HTML_REALDIR; $tpl_path_dir = $objPagelayout->getTemplatePath(SC_Display_Ex::$device) . BLOC_DIR; $this->arrPageLayout["HeadNavi"] = array(); $this->arrPageLayout["HeadNavi"][] = array("bloc_name" => "【全ページ】CSS設定", "tpl_path" => "{$tpl_path_dir}settings_css.tpl", "filename" => "settings_css", "php_path" => false ? $php_path_dir : ""); $this->arrPageLayout["BottomNavi"] = array(); $this->arrPageLayout["BottomNavi"][] = array("bloc_name" => "【全ページ】フッターナビ共通", "tpl_path" => "{$tpl_path_dir}navi_footer_common.tpl", "filename" => "navi_footer_common", "php_path" => false ? $php_path_dir : ""); // $objCustomer = new SC_Customer_Ex(); // 画面更新毎に情報を更新する if ($objCustomer->isLoginSuccess()) { // 初回アクセス時に更新 $objCustomer->updateSession(); $this->tpl_login = true; // ポイントだけは抑止 $this->tpl_point = $_SESSION["customer"]["point"]; $this->tpl_customer_id = $objCustomer->getValue("customer_id"); $this->tpl_first_buy_date = $objCustomer->getValue("first_buy_date"); $this->tpl_carrier = $objCustomer->getValue("carrier"); } }
function lfGetOrderDetail($order_id) { $objQuery = SC_Query_Ex::getSingletonInstance(); $objCustomer = new SC_Customer_Ex(); //customer_idを検証 $customer_id = $objCustomer->getValue('customer_id'); $order_count = $objQuery->count('dtb_order', 'order_id = ? and customer_id = ?', array($order_id, $customer_id)); if ($order_count != 1) { return array(); } $col = 'dtb_order_detail.product_class_id, quantity'; $table = 'dtb_order_detail LEFT JOIN dtb_products_class ON dtb_order_detail.product_class_id = dtb_products_class.product_class_id'; $where = 'order_id = ?'; $objQuery->setOrder('order_detail_id'); $arrOrderDetail = $objQuery->select($col, $table, $where, array($order_id)); return $arrOrderDetail; }
/** * Page のAction. * * @return void */ public function action() { $objCustomer = new SC_Customer_Ex(); $customer_id = $objCustomer->getValue('customer_id'); $objAddress = new SC_Helper_Address_Ex(); $objFormParam = new SC_FormParam_Ex(); $this->lfInitParam($objFormParam); $objFormParam->setParam($_POST); $objFormParam->convParam(); switch ($this->getMode()) { // お届け先の削除 case 'delete': if ($objFormParam->checkError()) { SC_Utils_Ex::sfDispSiteError(CUSTOMER_ERROR); SC_Response_Ex::actionExit(); } if (!$objAddress->deleteAddress($objFormParam->getValue('other_deliv_id'), $customer_id)) { SC_Utils_Ex::sfDispSiteError(FREE_ERROR_MSG, '', false, '別のお届け先を削除できませんでした。'); SC_Response_Ex::actionExit(); } break; // スマートフォン版のもっと見るボタン用 // スマートフォン版のもっと見るボタン用 case 'getList': $arrData = $objFormParam->getHashArray(); //別のお届け先情報 $arrOtherDeliv = $objAddress->getList($customer_id, ($arrData['pageno'] - 1) * SEARCH_PMAX); //県名をセット $arrOtherDeliv = $this->setPref($arrOtherDeliv, $this->arrPref); $arrOtherDeliv['delivCount'] = count($arrOtherDeliv); $this->arrOtherDeliv = $arrOtherDeliv; echo SC_Utils_Ex::jsonEncode($this->arrOtherDeliv); SC_Response_Ex::actionExit(); break; // お届け先の表示 // お届け先の表示 default: break; } //別のお届け先情報 $this->arrOtherDeliv = $objAddress->getList($customer_id); //お届け先登録数 $this->tpl_linemax = count($this->arrOtherDeliv); // 1ページあたりの件数 $this->dispNumber = SEARCH_PMAX; }
/** * Page のAction. * * @return void */ function action() { $objCustomer = new SC_Customer_Ex(); $customer_id = $objCustomer->getValue('customer_id'); $objFormParam = new SC_FormParam_Ex(); $this->lfInitParam($objFormParam); $objFormParam->setParam($_POST); $objFormParam->convParam(); switch ($this->getMode()) { // お届け先の削除 case 'delete': if ($objFormParam->checkError()) { SC_Utils_Ex::sfDispSiteError(CUSTOMER_ERROR); exit; } $this->deleteOtherDeliv($customer_id, $objFormParam->getValue('other_deliv_id')); break; // スマートフォン版のもっと見るボタン用 // スマートフォン版のもっと見るボタン用 case 'getList': $arrData = $objFormParam->getHashArray(); //別のお届け先情報 $arrOtherDeliv = $this->getOtherDeliv($customer_id, ($arrData['pageno'] - 1) * SEARCH_PMAX); //県名をセット $arrOtherDeliv = $this->setPref($arrOtherDeliv, $this->arrPref); $arrOtherDeliv['delivCount'] = count($arrOtherDeliv); $this->arrOtherDeliv = $arrOtherDeliv; echo SC_Utils_Ex::jsonEncode($this->arrOtherDeliv); exit; break; // お届け先の表示 // お届け先の表示 default: break; } //別のお届け先情報 $this->arrOtherDeliv = $this->getOtherDeliv($customer_id); //お届け先登録数 $this->tpl_linemax = count($this->arrOtherDeliv); // 1ページあたりの件数 $this->dispNumber = SEARCH_PMAX; }
/** * Page のAction. * * @return void */ public function action() { //決済処理中ステータスのロールバック $objPurchase = new SC_Helper_Purchase_Ex(); $objPurchase->cancelPendingOrder(PENDING_ORDER_CANCEL_FLAG); $objCustomer = new SC_Customer_Ex(); $objProduct = new SC_Product(); if (!SC_Utils_Ex::sfIsInt($_GET['order_id'])) { SC_Utils_Ex::sfDispSiteError(CUSTOMER_ERROR); } $order_id = $_GET['order_id']; $this->is_price_change = false; //受注データの取得 $this->tpl_arrOrderData = $objPurchase->getOrder($order_id, $objCustomer->getValue('customer_id')); if (empty($this->tpl_arrOrderData)) { SC_Utils_Ex::sfDispSiteError(CUSTOMER_ERROR); } $this->arrShipping = $this->lfGetShippingDate($objPurchase, $order_id, $this->arrWDAY); $this->isMultiple = count($this->arrShipping) > 1; // 支払い方法の取得 $this->arrPayment = SC_Helper_Payment_Ex::getIDValueList(); // 受注商品明細の取得 $this->tpl_arrOrderDetail = $objPurchase->getOrderDetail($order_id); foreach ($this->tpl_arrOrderDetail as $product_index => $arrOrderProductDetail) { //必要なのは商品の販売金額のみなので、遅い場合は、別途SQL作成した方が良い $arrTempProductDetail = $objProduct->getProductsClass($arrOrderProductDetail['product_class_id']); // 税計算 $this->tpl_arrOrderDetail[$product_index]['price_inctax'] = $this->tpl_arrOrderDetail[$product_index]['price'] + SC_Helper_TaxRule_Ex::calcTax($this->tpl_arrOrderDetail[$product_index]['price'], $this->tpl_arrOrderDetail[$product_index]['tax_rate'], $this->tpl_arrOrderDetail[$product_index]['tax_rule']); $arrTempProductDetail['price02_inctax'] = SC_Helper_TaxRule_Ex::sfCalcIncTax($arrTempProductDetail['price02'], $arrTempProductDetail['product_id'], $arrTempProductDetail['product_class_id']); if ($this->tpl_arrOrderDetail[$product_index]['price_inctax'] != $arrTempProductDetail['price02_inctax']) { $this->is_price_change = true; } $this->tpl_arrOrderDetail[$product_index]['product_price_inctax'] = $arrTempProductDetail['price02_inctax'] ? $arrTempProductDetail['price02_inctax'] : 0; } $this->tpl_arrOrderDetail = $this->setMainListImage($this->tpl_arrOrderDetail); $objPurchase->setDownloadableFlgTo($this->tpl_arrOrderDetail); // モバイルダウンロード対応処理 $this->lfSetAU($this->tpl_arrOrderDetail); // 受注メール送信履歴の取得 $this->tpl_arrMailHistory = $this->lfGetMailHistory($order_id); }
/** * Page のプロセス * @return void */ function action() { $objCustomer = new SC_Customer_Ex(); $customer_id = $objCustomer->getValue('customer_id'); // mobile用(戻るボタンでの遷移かどうかを判定) if (!empty($_POST['return'])) { $_POST['mode'] = 'return'; } // パラメーター管理クラス,パラメーター情報の初期化 $objFormParam = new SC_FormParam_Ex(); SC_Helper_Customer_Ex::sfCustomerMypageParam($objFormParam); $objFormParam->setParam($_POST); // POST値の取得 $this->arrForm = $objFormParam->getHashArray(); switch ($this->getMode()) { case 'confirm': //-- 確認 $this->arrErr = SC_Helper_Customer_Ex::sfCustomerMypageErrorCheck($objFormParam); // 入力エラーなし if (empty($this->arrErr)) { //パスワード表示 $this->passlen = SC_Utils_Ex::sfPassLen(strlen($this->arrForm['password'])); $this->tpl_mainpage = 'mypage/change_confirm.tpl'; $this->tpl_title = '会員登録(確認ページ)'; } break; case 'complete': //-- 会員登録と完了画面 // 会員情報の登録 $this->lfRegistCustomerData($objFormParam, $customer_id); // 完了ページに移動させる。 SC_Response_Ex::sendRedirect('change_complete.php'); break; case 'return': break; default: $this->arrForm = SC_Helper_Customer_Ex::sfGetCustomerData($customer_id); break; } }
/** * Page のアクション. * * @return void */ function action() { $objSiteSess = new SC_SiteSession_Ex(); $objCartSess = new SC_CartSession_Ex(); $objPurchase = new SC_Helper_Purchase_Ex(); $objCustomer = new SC_Customer_Ex(); $objFormParam = new SC_FormParam_Ex(); $this->is_multiple = $objPurchase->isMultiple(); // カートの情報を取得 $this->arrShipping = $objPurchase->getShippingTemp($this->is_multiple); $this->tpl_uniqid = $objSiteSess->getUniqId(); $cart_key = $objCartSess->getKey(); $this->cartKey = $cart_key; $objPurchase->verifyChangeCart($this->tpl_uniqid, $objCartSess); // 配送業者を取得 $this->arrDeliv = $objPurchase->getDeliv($cart_key); $this->is_single_deliv = $this->isSingleDeliv($this->arrDeliv); // 会員情報の取得 if ($objCustomer->isLoginSuccess(true)) { $this->tpl_login = '******'; $this->tpl_user_point = $objCustomer->getValue('point'); $this->name01 = $objCustomer->getValue('name01'); $this->name02 = $objCustomer->getValue('name02'); } // 戻り URL の設定 // @deprecated 2.12.0 テンプレート直書きに戻した $this->tpl_back_url = '?mode=return'; $arrOrderTemp = $objPurchase->getOrderTemp($this->tpl_uniqid); // 正常に受注情報が格納されていない場合はカート画面へ戻す if (SC_Utils_Ex::isBlank($arrOrderTemp)) { SC_Response_Ex::sendRedirect(CART_URLPATH); SC_Response_Ex::actionExit(); } // カート内商品の妥当性チェック $this->tpl_message = $objCartSess->checkProducts($cart_key); if (strlen($this->tpl_message) >= 1) { SC_Response_Ex::sendRedirect(CART_URLPATH); SC_Response_Ex::actionExit(); } /* * 購入金額の取得 * ここでは送料を加算しない */ $this->arrPrices = $objCartSess->calculate($cart_key, $objCustomer); // お届け日一覧の取得 $this->arrDelivDate = $objPurchase->getDelivDate($objCartSess, $cart_key); switch ($this->getMode()) { /* * 配送業者選択時のアクション * モバイル端末以外の場合は, JSON 形式のデータを出力し, ajax で取得する. */ case 'select_deliv': $this->setFormParams($objFormParam, $arrOrderTemp, true, $this->arrShipping); $objFormParam->setParam($_POST); $this->arrErr = $objFormParam->checkError(); if (SC_Utils_Ex::isBlank($this->arrErr)) { $deliv_id = $objFormParam->getValue('deliv_id'); $arrSelectedDeliv = $this->getSelectedDeliv($objPurchase, $objCartSess, $deliv_id); $arrSelectedDeliv['error'] = false; } else { $arrSelectedDeliv = array('error' => true); $this->tpl_mainpage = 'shopping/select_deliv.tpl'; // モバイル用 } if (SC_Display_Ex::detectDevice() != DEVICE_TYPE_MOBILE) { echo SC_Utils_Ex::jsonEncode($arrSelectedDeliv); SC_Response_Ex::actionExit(); } else { $this->arrPayment = $arrSelectedDeliv['arrPayment']; $this->arrDelivTime = $arrSelectedDeliv['arrDelivTime']; } break; // 登録処理 // 登録処理 case 'confirm': // パラメーター情報の初期化 $this->setFormParams($objFormParam, $_POST, false, $this->arrShipping); $deliv_id = $objFormParam->getValue('deliv_id'); $arrSelectedDeliv = $this->getSelectedDeliv($objPurchase, $objCartSess, $deliv_id); $this->arrPayment = $arrSelectedDeliv['arrPayment']; $this->arrDelivTime = $arrSelectedDeliv['arrDelivTime']; $this->img_show = $arrSelectedDeliv['img_show']; $this->arrErr = $this->lfCheckError($objFormParam, $this->arrPrices['subtotal'], $this->tpl_user_point); if (empty($this->arrErr)) { $this->saveShippings($objFormParam, $this->arrDelivTime); $this->lfRegistData($this->tpl_uniqid, $objFormParam->getDbArray(), $objPurchase, $this->arrPayment); // 正常に登録されたことを記録しておく $objSiteSess->setRegistFlag(); // 確認ページへ移動 SC_Response_Ex::sendRedirect(SHOPPING_CONFIRM_URLPATH); SC_Response_Ex::actionExit(); } break; // 前のページに戻る // 前のページに戻る case 'return': // 正常な推移であることを記録しておく $objSiteSess->setRegistFlag(); $url = null; if ($this->is_multiple) { $url = MULTIPLE_URLPATH . '?from=multiple'; } elseif ($objCustomer->isLoginSuccess(true)) { if ($product_type_id == PRODUCT_TYPE_DOWNLOAD) { $url = CART_URLPATH; } else { $url = DELIV_URLPATH; } } else { $url = SHOPPING_URL . '?from=nonmember'; } SC_Response_Ex::sendRedirect($url); SC_Response_Ex::actionExit(); break; default: // FIXME 前のページから戻ってきた場合は別パラメーター(mode)で処理分岐する必要があるのかもしれない $this->setFormParams($objFormParam, $arrOrderTemp, false, $this->arrShipping); if (!$this->is_single_deliv) { $deliv_id = $objFormParam->getValue('deliv_id'); } else { $deliv_id = $this->arrDeliv[0]['deliv_id']; } if (!SC_Utils_Ex::isBlank($deliv_id)) { $objFormParam->setValue('deliv_id', $deliv_id); $arrSelectedDeliv = $this->getSelectedDeliv($objPurchase, $objCartSess, $deliv_id); $this->arrPayment = $arrSelectedDeliv['arrPayment']; $this->arrDelivTime = $arrSelectedDeliv['arrDelivTime']; $this->img_show = $arrSelectedDeliv['img_show']; } break; } // モバイル用 ポストバック処理 if (SC_Display_Ex::detectDevice() == DEVICE_TYPE_MOBILE && SC_Utils_Ex::isBlank($this->arrErr)) { $this->tpl_mainpage = $this->getMobileMainpage($this->is_single_deliv, $this->getMode()); } $this->arrForm = $objFormParam->getFormParamList(); }
function sfSendOrderMail($order_id, $template_id, $subject = "", $header = "", $footer = "", $send = true) { $arrTplVar = new stdClass(); $arrInfo = SC_Helper_DB_Ex::sfGetBasisData(); $arrTplVar->arrInfo = $arrInfo; $objQuery = new SC_Query_Ex(); if ($subject == "" && $header == "" && $footer == "") { // メールテンプレート情報の取得 $where = "template_id = ?"; $arrRet = $objQuery->select("subject, header, footer", "dtb_mailtemplate", $where, array($template_id)); $arrTplVar->tpl_header = $arrRet[0]['header']; $arrTplVar->tpl_footer = $arrRet[0]['footer']; $tmp_subject = $arrRet[0]['subject']; } else { $arrTplVar->tpl_header = $header; $arrTplVar->tpl_footer = $footer; $tmp_subject = $subject; } // 受注情報の取得 $where = "order_id = ?"; $arrRet = $objQuery->select("*", "dtb_order", $where, array($order_id)); $arrOrder = $arrRet[0]; $objQuery->setOrder('order_detail_id'); $arrTplVar->arrOrderDetail = $objQuery->select("*", "dtb_order_detail", $where, array($order_id)); $objProduct = new SC_Product_Ex(); $objQuery->setOrder('shipping_id'); $arrRet = $objQuery->select("*", "dtb_shipping", "order_id = ?", array($order_id)); foreach (array_keys($arrRet) as $key) { $objQuery->setOrder('shipping_id'); $arrItems = $objQuery->select("*", "dtb_shipment_item", "order_id = ? AND shipping_id = ?", array($order_id, $arrRet[$key]['shipping_id'])); foreach ($arrItems as $itemKey => $arrDetail) { foreach ($arrDetail as $detailKey => $detailVal) { $arrRet[$key]['shipment_item'][$arrDetail['product_class_id']][$detailKey] = $detailVal; } $arrRet[$key]['shipment_item'][$arrDetail['product_class_id']]['productsClass'] =& $objProduct->getDetailAndProductsClass($arrDetail['product_class_id']); } } $arrTplVar->arrShipping = $arrRet; $arrTplVar->Message_tmp = $arrOrder['message']; // 会員情報の取得 $customer_id = $arrOrder['customer_id']; $objQuery->setOrder('customer_id'); $arrRet = $objQuery->select('point', "dtb_customer", "customer_id = ?", array($customer_id)); $arrCustomer = isset($arrRet[0]) ? $arrRet[0] : ""; $arrTplVar->arrCustomer = $arrCustomer; $arrTplVar->arrOrder = $arrOrder; //その他決済情報 if ($arrOrder['memo02'] != "") { $arrOther = unserialize($arrOrder['memo02']); foreach ($arrOther as $other_key => $other_val) { if (SC_Utils_Ex::sfTrim($other_val['value']) == "") { $arrOther[$other_key]['value'] = ""; } } $arrTplVar->arrOther = $arrOther; } // 都道府県変換 $arrTplVar->arrPref = $this->arrPref; $objCustomer = new SC_Customer_Ex(); $arrTplVar->tpl_user_point = $objCustomer->getValue('point'); if (Net_UserAgent_Mobile::isMobile() === true) { $objMailView = new SC_MobileView_Ex(); } else { $objMailView = new SC_SiteView_Ex(); } // メール本文の取得 $objMailView->assignobj($arrTplVar); $body = $objMailView->fetch($this->arrMAILTPLPATH[$template_id]); // メール送信処理 $objSendMail = new SC_SendMail_Ex(); $bcc = $arrInfo['email01']; $from = $arrInfo['email03']; $error = $arrInfo['email04']; $tosubject = $this->sfMakeSubject($tmp_subject, $objMailView); $objSendMail->setItem('', $tosubject, $body, $from, $arrInfo['shop_name'], $from, $error, $error, $bcc); $objSendMail->setTo($arrOrder["order_email"], $arrOrder["order_name01"] . " " . $arrOrder["order_name02"] . " 様"); // 送信フラグ:trueの場合は、送信する。 if ($send) { if ($objSendMail->sendMail()) { $this->sfSaveMailHistory($order_id, $template_id, $tosubject, $body); } } return $objSendMail; }
public function checkDbMyPendignOrder() { $objCustomer = new SC_Customer_Ex(); if ($objCustomer->isLoginSuccess(true)) { $customer_id = $objCustomer->getValue('customer_id'); $objQuery =& SC_Query_Ex::getSingletonInstance(); $arrVal = array($customer_id, ORDER_PENDING); $objQuery->setOrder('create_date desc'); $objQuery->begin(); $arrOrders = $objQuery->select('order_id,create_date', 'dtb_order', 'customer_id = ? and status = ? and del_flg = 0', $arrVal); if (!SC_Utils_Ex::isBlank($arrOrders)) { foreach ($arrOrders as $key => $arrOrder) { $order_id = $arrOrder['order_id']; if ($key == 0) { $objCartSess = new SC_CartSession_Ex(); $cartKeys = $objCartSess->getKeys(); $term = PENDING_ORDER_CANCEL_TIME + 60 * 60 * 12; // XXX +12 hours; if (preg_match("/^[0-9]+\$/", $term)) { $target_time = strtotime('-' . $term . ' sec'); $create_time = strtotime($arrOrder['create_date']); if (SC_Utils_Ex::isBlank($cartKeys) && $target_time < $create_time) { SC_Helper_Purchase_Ex::rollbackOrder($order_id, ORDER_CANCEL, true); GC_Utils_Ex::gfPrintLog('order rollback.(my pending) order_id=' . $order_id); } else { SC_Helper_Purchase_Ex::cancelOrder($order_id, ORDER_CANCEL, true); if ($target_time > $create_time) { GC_Utils_Ex::gfPrintLog('order cancel.(my pending and time expire) order_id=' . $order_id); } else { GC_Utils_Ex::gfPrintLog('order cancel.(my pending and set cart) order_id=' . $order_id); } } } } else { SC_Helper_Purchase_Ex::cancelOrder($order_id, ORDER_CANCEL, true); GC_Utils_Ex::gfPrintLog('order cancel.(my old pending) order_id=' . $order_id); } } } $objQuery->commit(); } }
/** * Page のプロセス * @return void */ function action() { $objCustomer = new SC_Customer_Ex(); $customer_id = $objCustomer->getValue('customer_id'); // mobile用(戻るボタンでの遷移かどうかを判定) if (!empty($_POST['return'])) { $_POST['mode'] = 'return'; } // パラメーター管理クラス,パラメーター情報の初期化 $objFormParam = new SC_FormParam_Ex(); SC_Helper_Customer_Ex::sfCustomerMypageParam($objFormParam); $objFormParam->setParam($_POST); // POST値の取得 switch ($this->getMode()) { // 確認 case 'confirm': if (isset($_POST['submit_address'])) { // 入力エラーチェック $this->arrErr = $this->lfCheckError($_POST); // 入力エラーの場合は終了 if (count($this->arrErr) == 0) { // 郵便番号検索文作成 $zipcode = $_POST['zip01'] . $_POST['zip02']; // 郵便番号検索 $arrAdsList = SC_Utils_Ex::sfGetAddress($zipcode); // 郵便番号が発見された場合 if (!empty($arrAdsList)) { $data['pref'] = $arrAdsList[0]['state']; $data['addr01'] = $arrAdsList[0]['city'] . $arrAdsList[0]['town']; $objFormParam->setParam($data); } else { $this->arrErr['zip01'] = '※該当する住所が見つかりませんでした。<br>'; } } $this->arrForm = $objFormParam->getHashArray(); break; } $this->arrErr = SC_Helper_Customer_Ex::sfCustomerMypageErrorCheck($objFormParam); $this->arrForm = $objFormParam->getHashArray(); // 入力エラーなし if (empty($this->arrErr)) { //パスワード表示 $this->passlen = SC_Utils_Ex::sfPassLen(strlen($this->arrForm['password'])); $this->tpl_mainpage = 'mypage/change_confirm.tpl'; $this->tpl_title = '会員登録(確認ページ)'; $this->tpl_subtitle = '会員登録内容変更(確認ページ)'; } break; // 会員登録と完了画面 // 会員登録と完了画面 case 'complete': $this->arrErr = SC_Helper_Customer_Ex::sfCustomerMypageErrorCheck($objFormParam); $this->arrForm = $objFormParam->getHashArray(); // 入力エラーなし if (empty($this->arrErr)) { // 会員情報の登録 $this->lfRegistCustomerData($objFormParam, $customer_id); //セッション情報を最新の状態に更新する $objCustomer->updateSession(); // 完了ページに移動させる。 SC_Response_Ex::sendRedirect('change_complete.php'); } break; // 確認ページからの戻り // 確認ページからの戻り case 'return': $this->arrForm = $objFormParam->getHashArray(); break; default: $this->arrForm = SC_Helper_Customer_Ex::sfGetCustomerData($customer_id); break; } }
function lfCheckError($mode, &$objFormParam, $tpl_classcat_find1 = null, $tpl_classcat_find2 = null) { switch ($mode) { case 'add_favorite_sphone': case 'add_favorite': $objCustomer = new SC_Customer_Ex(); $objErr = new SC_CheckError_Ex(); $customer_id = $objCustomer->getValue('customer_id'); if (SC_Helper_DB_Ex::sfDataExists('dtb_customer_favorite_products', 'customer_id = ? AND product_id = ?', array($customer_id, $favorite_product_id))) { $objErr->arrErr['add_favorite' . $favorite_product_id] = t('c_* This product has already been added to Favorites.<br />_01'); } break; default: // 入力データを渡す。 $arrRet = $objFormParam->getHashArray(); $objErr = new SC_CheckError_Ex($arrRet); $objErr->arrErr = $objFormParam->checkError(); // 複数項目チェック if ($tpl_classcat_find1) { $objErr->doFunc(array(t('c_Standard 1_01'), 'classcategory_id1'), array('EXIST_CHECK')); } if ($tpl_classcat_find2) { $objErr->doFunc(array(t('c_Standard 2_01'), 'classcategory_id2'), array('EXIST_CHECK')); } break; } return $objErr->arrErr; }
/** * Page のアクション. * * @return void */ function action() { // 会員管理クラス $objCustomer = new SC_Customer_Ex(); // クッキー管理クラス $objCookie = new SC_Cookie_Ex(); // パラメーター管理クラス $objFormParam = new SC_FormParam_Ex(); // パラメーター情報の初期化 $this->lfInitParam($objFormParam); // リクエスト値をフォームにセット $objFormParam->setParam($_POST); $url = htmlspecialchars($_POST['url'], ENT_QUOTES); // モードによって分岐 switch ($this->getMode()) { case 'login': // --- ログイン // 入力値のエラーチェック $objFormParam->trimParam(); $objFormParam->toLower('login_email'); $arrErr = $objFormParam->checkError(); // エラーの場合はエラー画面に遷移 if (count($arrErr) > 0) { if (SC_Display_Ex::detectDevice() === DEVICE_TYPE_SMARTPHONE) { echo $this->lfGetErrorMessage(TEMP_LOGIN_ERROR); SC_Response_Ex::actionExit(); } else { SC_Utils_Ex::sfDispSiteError(TEMP_LOGIN_ERROR); SC_Response_Ex::actionExit(); } } // 入力チェック後の値を取得 $arrForm = $objFormParam->getHashArray(); // クッキー保存判定 if ($arrForm['login_memory'] == '1' && $arrForm['login_email'] != '') { $objCookie->setCookie('login_email', $arrForm['login_email']); } else { $objCookie->setCookie('login_email', ''); } // 遷移先の制御 if (count($arrErr) == 0) { // ログイン処理 if ($objCustomer->doLogin($arrForm['login_email'], $arrForm['login_pass'])) { if (SC_Display_Ex::detectDevice() === DEVICE_TYPE_MOBILE) { // ログインが成功した場合は携帯端末IDを保存する。 $objCustomer->updateMobilePhoneId(); /* * email がモバイルドメインでは無く, * 携帯メールアドレスが登録されていない場合 */ $objMobile = new SC_Helper_Mobile_Ex(); if (!$objMobile->gfIsMobileMailAddress($objCustomer->getValue('email'))) { if (!$objCustomer->hasValue('email_mobile')) { SC_Response_Ex::sendRedirectFromUrlPath('entry/email_mobile.php'); SC_Response_Ex::actionExit(); } } } // --- ログインに成功した場合 if (SC_Display_Ex::detectDevice() === DEVICE_TYPE_SMARTPHONE) { echo SC_Utils_Ex::jsonEncode(array('success' => $url)); } else { SC_Response_Ex::sendRedirect($url); } SC_Response_Ex::actionExit(); } else { // --- ログインに失敗した場合 // ブルートフォースアタック対策 // ログイン失敗時に遅延させる sleep(LOGIN_RETRY_INTERVAL); $arrForm['login_email'] = strtolower($arrForm['login_email']); $objQuery = SC_Query_Ex::getSingletonInstance(); $where = '(email = ? OR email_mobile = ?) AND status = 1 AND del_flg = 0'; $exists = $objQuery->exists('dtb_customer', $where, array($arrForm['login_email'], $arrForm['login_email'])); // ログインエラー表示 TODO リファクタリング if ($exists) { if (SC_Display_Ex::detectDevice() === DEVICE_TYPE_SMARTPHONE) { echo $this->lfGetErrorMessage(TEMP_LOGIN_ERROR); SC_Response_Ex::actionExit(); } else { SC_Utils_Ex::sfDispSiteError(TEMP_LOGIN_ERROR); SC_Response_Ex::actionExit(); } } else { if (SC_Display_Ex::detectDevice() === DEVICE_TYPE_SMARTPHONE) { echo $this->lfGetErrorMessage(SITE_LOGIN_ERROR); SC_Response_Ex::actionExit(); } else { SC_Utils_Ex::sfDispSiteError(SITE_LOGIN_ERROR); SC_Response_Ex::actionExit(); } } } } else { // XXX 到達しない? // 入力エラーの場合、元のアドレスに戻す。 SC_Response_Ex::sendRedirect($url); SC_Response_Ex::actionExit(); } break; case 'logout': // --- ログアウト // ログイン情報の解放 $objCustomer->EndSession(); // 画面遷移の制御 $mypage_url_search = strpos('.' . $url, 'mypage'); if ($mypage_url_search == 2) { // マイページログイン中はログイン画面へ移行 SC_Response_Ex::sendRedirectFromUrlPath('mypage/login.php'); } else { // 上記以外の場合、トップへ遷移 SC_Response_Ex::sendRedirect(HTTP_URL); } SC_Response_Ex::actionExit(); break; default: break; } }
public function lfRegistRecommendData(&$objFormParam) { $objQuery =& SC_Query_Ex::getSingletonInstance(); $objCustomer = new SC_Customer_Ex(); $arrRegist = $objFormParam->getDbArray(); $arrRegist['create_date'] = 'CURRENT_TIMESTAMP'; $arrRegist['update_date'] = 'CURRENT_TIMESTAMP'; $arrRegist['creator_id'] = '0'; if ($objCustomer->isLoginSuccess(true)) { $arrRegist['customer_id'] = $objCustomer->getValue('customer_id'); } //-- 登録実行 $objQuery->begin(); $arrRegist['review_id'] = $objQuery->nextVal('dtb_review_review_id'); $objQuery->insert('dtb_review', $arrRegist); $objQuery->commit(); }
function lfCheckError($mode, &$objFormParam, $tpl_classcat_find1 = null, $tpl_classcat_find2 = null) { switch ($mode) { case 'add_favorite_sphone': case 'add_favorite': $objCustomer = new SC_Customer_Ex(); $objErr = new SC_CheckError_Ex(); $customer_id = $objCustomer->getValue('customer_id'); if (SC_Helper_DB_Ex::sfDataExists('dtb_customer_favorite_products', 'customer_id = ? AND product_id = ?', array($customer_id, $favorite_product_id))) { $objErr->arrErr['add_favorite' . $favorite_product_id] = "※ この商品は既にお気に入りに追加されています。<br />"; } break; default: // 入力データを渡す。 $arrRet = $objFormParam->getHashArray(); $objErr = new SC_CheckError_Ex($arrRet); $objErr->arrErr = $objFormParam->checkError(); // 複数項目チェック if ($tpl_classcat_find1) { $objErr->doFunc(array("規格1", "classcategory_id1"), array("EXIST_CHECK")); } if ($tpl_classcat_find2) { $objErr->doFunc(array("規格2", "classcategory_id2"), array("EXIST_CHECK")); } break; } return $objErr->arrErr; }
function setLoginInfo(&$customer) { $objCustomer = new SC_Customer_Ex(); $customer["status"] = 2; $customer["carrier"] = 2; $customer["last_login_useragent"] = $_SERVER["HTTP_USER_AGENT"]; $customer["last_login_date"] = "CURRENT_TIMESTAMP"; $customer["secret_key"] = SC_Helper_Customer_Ex::sfGetUniqSecretKey(); GC_Utils_Ex::gfPrintLog(print_r($customer, true), DEBUG_LOG_REALFILE); SC_Helper_Customer_Ex::sfEditCustomerData($customer, $customer["customer_id"]); $objCustomer->setLogin($customer["email"]); if ($objCustomer->isLoginSuccess()) { $this->tpl_login = true; $this->tpl_point = $objCustomer->getValue("point"); $this->tpl_customer_id = $objCustomer->getValue("customer_id"); $this->tpl_first_buy_date = $objCustomer->getValue("first_buy_date"); $this->tpl_carrier = $objCustomer->getValue("carrier"); } $this->sendRedirectPage(); }
/** * Page のAction. * * @return void */ public function action() { $objCustomer = new SC_Customer_Ex(); $objAddress = new SC_Helper_Address_Ex(); $ParentPage = MYPAGE_DELIVADDR_URLPATH; // GETでページを指定されている場合には指定ページに戻す if (isset($_GET['page'])) { $ParentPage = htmlspecialchars($_GET['page'], ENT_QUOTES); } elseif (isset($_POST['ParentPage'])) { $ParentPage = htmlspecialchars($_POST['ParentPage'], ENT_QUOTES); } // 正しい遷移かをチェック $arrParentPageList = array(DELIV_URLPATH, MYPAGE_DELIVADDR_URLPATH, MULTIPLE_URLPATH); if (!SC_Utils_Ex::isBlank($ParentPage) && !in_array($ParentPage, $arrParentPageList)) { // 遷移が正しくない場合、デフォルトであるマイページの配送先追加の画面を設定する $ParentPage = MYPAGE_DELIVADDR_URLPATH; } $this->ParentPage = $ParentPage; /* * ログイン判定 及び 退会判定 * 未ログインでも, 複数配送設定ページからのアクセスの場合は表示する * * TODO 購入遷移とMyPageで別クラスにすべき */ if (!$objCustomer->isLoginSuccess(true) && $ParentPage != MULTIPLE_URLPATH) { $this->tpl_onload = "eccube.changeParentUrl('" . $ParentPage . "'); window.close();"; } // other_deliv_id のあるなしで追加か編集か判定しているらしい $_SESSION['other_deliv_id'] = $_REQUEST['other_deliv_id']; // パラメーター管理クラス,パラメーター情報の初期化 $objFormParam = new SC_FormParam_Ex(); $objAddress->setFormParam($objFormParam); $objFormParam->setParam($_POST); switch ($this->getMode()) { // 入力は必ずedit case 'edit': $this->arrErr = $objAddress->errorCheck($objFormParam); // 入力エラーなし if (empty($this->arrErr)) { // TODO ここでやるべきではない if (in_array($_POST['ParentPage'], $this->validUrl)) { $this->tpl_onload = "eccube.changeParentUrl('" . $this->getLocation($_POST['ParentPage']) . "'); window.close();"; } else { SC_Utils_Ex::sfDispSiteError(CUSTOMER_ERROR); } if ($objCustomer->isLoginSuccess(true)) { $this->lfRegistData($objAddress, $objFormParam, $objCustomer->getValue('customer_id')); } else { $this->lfRegistDataNonMember($objFormParam); } if (SC_Display_Ex::detectDevice() === DEVICE_TYPE_MOBILE) { // モバイルの場合、元のページに遷移 SC_Response_Ex::sendRedirect($this->getLocation($_POST['ParentPage'])); SC_Response_Ex::actionExit(); } } break; case 'multiple': // 複数配送先用 break; default: if ($_GET['other_deliv_id'] != '') { $arrOtherDeliv = $objAddress->getAddress($_SESSION['other_deliv_id'], $objCustomer->getValue('customer_id')); //不正アクセス判定 if (!$objCustomer->isLoginSuccess(true) || !$arrOtherDeliv) { SC_Utils_Ex::sfDispSiteError(CUSTOMER_ERROR); } //別のお届け先情報取得 $objFormParam->setParam($arrOtherDeliv); } break; } $this->arrForm = $objFormParam->getFormParamList(); if (SC_Display_Ex::detectDevice() === DEVICE_TYPE_MOBILE) { $this->tpl_mainpage = 'mypage/delivery_addr.tpl'; } else { $this->setTemplate('mypage/delivery_addr.tpl'); } }
/** * 会員登録エラーチェック * @param SC_FormParam $objFormParam SC_FormParam インスタンス * @access public * @return array エラーの配列 */ public function sfCustomerEntryErrorCheck(&$objFormParam) { $objErr = SC_Helper_Customer_Ex::sfCustomerCommonErrorCheck($objFormParam); $objErr = SC_Helper_Customer_Ex::sfCustomerRegisterErrorCheck($objErr); /* * sfCustomerRegisterErrorCheck() では, ログイン中の場合は重複チェック * されないので, 再度チェックを行う */ $objCustomer = new SC_Customer_Ex(); if ($objCustomer->isLoginSuccess(true) && SC_Helper_Customer_Ex::sfCustomerEmailDuplicationCheck($objCustomer->getValue('customer_id'), $objFormParam->getValue('email'))) { $objErr->arrErr['email'] .= '※ すでに会員登録で使用されているメールアドレスです。<br />'; } if ($objCustomer->isLoginSuccess(true) && SC_Helper_Customer_Ex::sfCustomerEmailDuplicationCheck($objCustomer->getValue('customer_id'), $objFormParam->getValue('email_mobile'))) { $objErr->arrErr['email_mobile'] .= '※ すでに会員登録で使用されているメールアドレスです。<br />'; } return $objErr->arrErr; }
function doCheckBuyAndDownload($config) { $objFormParam = new SC_FormParam(); $this->lfInitParam($objFormParam); $objFormParam->setParam($_REQUEST); $objCustomer = new SC_Customer_Ex(); $objQuery = SC_Query::getSingletonInstance(); $detect = new Mobile_Detect(); $version = $detect->version("iOS", Mobile_Detect::VERSION_TYPE_FLOAT); $contentid = $this->arrProduct["product_code_min"]; $curl = $this->curl_init(KISEKAE_TOUCH_IPHONE_API01); $post = $this->getPost($config, array("contentid" => $contentid, "device" => $objFormParam->getValue("device_name", "iPhone6"), "version" => floor($version), "apiversion" => null, "operator" => "au", "lang" => "ja")); $this->getDs($post, $config); curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($post)); GC_Utils_Ex::gfPrintLog(print_r($post, TRUE), DEBUG_LOG_REALFILE); $result = curl_exec($curl); $status = SC_XML::xpath($result, "//status/@value"); $vid = SC_XML::xpath($result, "//validation/@id"); switch ($status) { default: SC_Utils_Ex::sfDispSiteError(PAGE_ERROR); case "000": GC_Utils_Ex::gfDebugLog($result); $_COOKIE["product_ktc_vid"] = $vid; break; } // API2 $openid = $objCustomer->getValue("au_open_id"); $curl = $this->curl_init(KISEKAE_TOUCH_IPHONE_API02); $post = $this->getPost($config, array("contentid" => $contentid, "userid" => $openid, "vid" => $vid)); $this->getDs($post, $config); curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($post)); GC_Utils_Ex::gfPrintLog(print_r($post, TRUE), DEBUG_LOG_REALFILE); $result = curl_exec($curl); $status = SC_XML::xpath($result, "//status/@value"); switch ($status) { default: SC_Utils_Ex::sfDispSiteError(PAGE_ERROR); break; case "000": case "010": // TEST // /ios/products/detail.php?mode=check_buy_and_download&product_id=13&classcategory_id1=0&classcategory_id2=0&quantity=1&admin=&favorite_product_id=&product_class_id=&device_name=iPhone6Plus&device_height=736&device_width=414&device_rate=3&device_lang=ja&ignore_redownload=1 if ($_GET["ignore_redownload"] == "1") { $status = "000"; } break; } if ($status == "000") { // FIXME 課金処理 // API03 $curl = $this->curl_init(KISEKAE_TOUCH_IPHONE_API03); if ($objCustomer->getValue("buy_to_nopoint") == "1") { $price = $this->arrProduct["price02_min"]; $settlementtype = "998"; $redownloaddate = date("Ymd"); } else { $price = $this->arrProduct["price02_min"]; $settlementtype = "001"; $redownloaddate = date("Ymd", strtotime($this->downloadable_days2)); } $post = $this->getPost($config, array("contentid" => $contentid, "price" => $price, "redownloaddate" => $redownloaddate, "userid" => $openid, "vid" => $vid, "settlementtype" => $settlementtype)); $this->getDs($post, $config); curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($post)); GC_Utils_Ex::gfPrintLog(print_r($post, TRUE), DEBUG_LOG_REALFILE); $result = curl_exec($curl); $authentication_id = SC_XML::xpath($result, "//authentication/@id"); $objFormParam = new SC_FormParam(); $this->setOrderParam($objFormParam, $vid, $authentication_id); $objFormParam->convParam(); $message = ''; $arrValBef = array(); $objPurchase = new SC_Helper_Purchase_Ex(); $objPurchase->saveShippingTemp(array()); $order_id = $this->doRegister("", $objPurchase, $objFormParam, $message, $arrValBef); $customer_id = $objCustomer->getValue("customer_id"); $this->addPointHistory($order_id, $customer_id, $objFormParam, $objQuery); } else { $authentication_id = SC_XML::xpath($result, "//authentication/@id"); } $netUrl = new Net_URL(KISEKAE_TOUCH_IPHONE_CST02); $netUrl->addQueryString("aid", $authentication_id); $netUrl->addQueryString("cpid", $config["cpid"]); $netUrl->addQueryString("siteid", $config["siteid"]); $netUrl->addQueryString("contentid", $contentid); $netUrl->addQueryString("ts", date("YmdHis")); $post2 = $netUrl->querystring; $this->getDs($post2, $config); $netUrl->addRawQueryString(http_build_query($post2)); GC_Utils_Ex::gfPrintLog(print_r($post2, TRUE), DEBUG_LOG_REALFILE); header("Location: " . $netUrl->getURL()); }