/** * 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 */ 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 */ 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 の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 */ 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 */ 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->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 の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 のアクション. * * @return void */ public function action() { //決済処理中ステータスのロールバック $objPurchase = new SC_Helper_Purchase_Ex(); $objPurchase->cancelPendingOrder(PENDING_ORDER_CANCEL_FLAG); $this->tpl_title = ''; $objCustomer = new SC_Customer_Ex(); $this->isLogin = $objCustomer->isLoginSuccess(true); }
/** * Page のアクション. * * @return void */ function action() { $this->tpl_title = ''; $objCustomer = new SC_Customer_Ex(); $this->isLogin = $objCustomer->isLoginSuccess(true); $objCart = new SC_CartSession_Ex(); $this->isMultiple = $objCart->isMultiple(); $this->hasDownload = $objCart->hasProductType(PRODUCT_TYPE_DOWNLOAD); // 旧仕様との互換のため、不自然なセットとなっている $this->arrCartList = array(0 => $this->lfGetCartData($objCart)); }
/** * 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 の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; }
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 */ function action() { // ログインチェック $objCustomer = new SC_Customer_Ex(); if (!$objCustomer->isLoginSuccess(true)) { SC_Utils_Ex::sfDispSiteError(DOWNFILE_NOT_FOUND, '', true); } // パラメーターチェック $objFormParam = new SC_FormParam_Ex(); $this->lfInitParam($objFormParam); // GET、SESSION['customer']値の取得 $objFormParam->setParam($_SESSION['customer']); $objFormParam->setParam($_GET); $this->arrErr = $this->lfCheckError($objFormParam); if (count($this->arrErr) != 0) { SC_Utils_Ex::sfDispSiteError(DOWNFILE_NOT_FOUND, '', true); } }
/** * 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() { $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 */ function action() { $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, 'fnNaviPage', 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_DB_Ex::sfGetIDValueList('dtb_payment', 'payment_id', 'payment_method'); // 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 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 = t('c_MY page (login)_01'); $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(); }
/** * 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; } }
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 = "product_class_id, quantity"; $table = "dtb_order_detail LEFT JOIN dtb_products_class USING(product_class_id)"; $where = "order_id = ?"; $objQuery->setOrder("order_detail_id"); $arrOrderDetail = $objQuery->select($col, $table, $where, array($order_id)); return $arrOrderDetail; }
/** * 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 */ 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"); } }
/** * 会員登録エラーチェック * @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; }
/** * 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 string $registSecretKey * @access private * @return void */ public function lfSendRegistMail($registSecretKey) { $objQuery = SC_Query_Ex::getSingletonInstance(); $objCustomer = new SC_Customer_Ex(); $objHelperMail = new SC_Helper_Mail_Ex(); $objHelperMail->setPage($this); $CONF = SC_Helper_DB_Ex::sfGetBasisData(); //-- 会員データを取得 $arrCustomer = $objQuery->select('*', 'dtb_customer', 'secret_key = ?', array($registSecretKey)); $data = $arrCustomer[0]; $objCustomer->setLogin($data['email']); //-- メール送信 $objMailText = new SC_SiteView_Ex(); $objMailText->setPage($this); $objMailText->assign('CONF', $CONF); $objMailText->assign('name01', $data['name01']); $objMailText->assign('name02', $data['name02']); $toCustomerMail = $objMailText->fetch('mail_templates/customer_regist_mail.tpl'); $subject = $objHelperMail->sfMakesubject('会員登録が完了しました。'); $objMail = new SC_SendMail_Ex(); $objMail->setItem('', $subject, $toCustomerMail, $CONF['email03'], $CONF['shop_name'], $CONF['email03'], $CONF['email04'], $CONF['email04']); // 宛先の設定 $name = $data['name01'] . $data['name02'] . ' 様'; $objMail->setTo($data['email'], $name); $objMail->sendMail(); }
/** * 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 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; }
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; } }