Esempio n. 1
0
 /**
  * Page のアクション.
  *
  * @return void
  */
 public function action()
 {
     // パラメーター管理クラス
     $objFormParam = new SC_FormParam_Ex();
     switch ($this->getMode()) {
         case 'login':
             //ログイン処理
             $this->lfInitParam($objFormParam);
             $objFormParam->setParam($_POST);
             $this->arrErr = $this->lfCheckError($objFormParam);
             if (SC_Utils_Ex::isBlank($this->arrErr)) {
                 $this->lfDoLogin($objFormParam->getValue('login_id'));
                 SC_Response_Ex::sendRedirect(ADMIN_HOME_URLPATH);
             } else {
                 // ブルートフォースアタック対策
                 // ログイン失敗時に遅延させる
                 sleep(LOGIN_RETRY_INTERVAL);
                 SC_Utils_Ex::sfDispError(LOGIN_ERROR);
             }
             break;
         default:
             break;
     }
     // 管理者ログインテンプレートフレームの設定
     $this->setTemplate(LOGIN_FRAME);
 }
 /**
  * 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->tpl_uniqid = $objSiteSess->getUniqId();
     $this->addrs = $this->getDelivAddrs($objCustomer, $objPurchase, $this->tpl_uniqid);
     $this->tpl_addrmax = count($this->addrs);
     $this->lfInitParam($objFormParam);
     $objPurchase->verifyChangeCart($this->tpl_uniqid, $objCartSess);
     switch ($this->getMode()) {
         case 'confirm':
             $objFormParam->setParam($_POST);
             $this->arrErr = $this->lfCheckError($objFormParam);
             if (SC_Utils_Ex::isBlank($this->arrErr)) {
                 // フォームの情報を一時保存しておく
                 $_SESSION['multiple_temp'] = $objFormParam->getHashArray();
                 $this->saveMultipleShippings($this->tpl_uniqid, $objFormParam, $objCustomer, $objPurchase, $objCartSess);
                 $objSiteSess->setRegistFlag();
                 SC_Response_Ex::sendRedirect("payment.php");
                 exit;
             }
             break;
         default:
             $this->setParamToSplitItems($objFormParam, $objCartSess);
     }
     // 前のページから戻ってきた場合
     if ($_GET['from'] == 'multiple') {
         $objFormParam->setParam($_SESSION['multiple_temp']);
     }
     $this->arrForm = $objFormParam->getFormParamList();
 }
Esempio n. 3
0
 /**
  * Page を初期化する.
  *
  * @return void
  */
 function init()
 {
     $this->template = MAIN_FRAME;
     //IP制限チェック
     $allow_hosts = unserialize(ADMIN_ALLOW_HOSTS);
     if (is_array($allow_hosts) && count($allow_hosts) > 0) {
         if (array_search($_SERVER['REMOTE_ADDR'], $allow_hosts) === FALSE) {
             SC_Utils_Ex::sfDispError(AUTH_ERROR);
         }
     }
     //SSL制限チェック
     if (ADMIN_FORCE_SSL == TRUE) {
         if (SC_Utils_Ex::sfIsHTTPS() === false) {
             SC_Response_Ex::sendRedirect($_SERVER['REQUEST_URI'], $_GET, FALSE, TRUE);
         }
     }
     $this->tpl_authority = $_SESSION['authority'];
     // ディスプレイクラス生成
     $this->objDisplay = new SC_Display_Ex();
     // スーパーフックポイントを実行.
     $objPlugin = SC_Helper_Plugin_Ex::getSingletonInstance($this->plugin_activate_flg);
     $objPlugin->doAction('LC_Page_preProcess', array($this));
     // トランザクショントークンの検証と生成
     $this->doValidToken(true);
     $this->setTokenTo();
     // ローカルフックポイントを実行
     $parent_class_name = get_parent_class($this);
     $objPlugin->doAction($parent_class_name . '_action_before', array($this));
     $class_name = get_class($this);
     if ($class_name != $parent_class_name) {
         $objPlugin->doAction($class_name . '_action_before', array($this));
     }
 }
Esempio n. 4
0
 /**
  * Page のAction.
  *
  * @return void
  */
 public function action()
 {
     //決済処理中ステータスのロールバック
     $objPurchase = new SC_Helper_Purchase_Ex();
     $objPurchase->cancelPendingOrder(PENDING_ORDER_CANCEL_FLAG);
     SC_Response_Ex::sendRedirect(DIR_INDEX_PATH);
 }
 /**
  * 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;
     }
 }
Esempio n. 6
0
 /**
  * Page を初期化する.
  *
  * @return void
  */
 function init()
 {
     $this->template = MAIN_FRAME;
     //IP制限チェック
     $allow_hosts = unserialize(ADMIN_ALLOW_HOSTS);
     if (is_array($allow_hosts) && count($allow_hosts) > 0) {
         if (array_search($_SERVER["REMOTE_ADDR"], $allow_hosts) === FALSE) {
             SC_Utils_Ex::sfDispError(AUTH_ERROR);
         }
     }
     //SSL制限チェック
     if (ADMIN_FORCE_SSL == TRUE) {
         if (SC_Utils_Ex::sfIsHTTPS() === false) {
             SC_Response_Ex::sendRedirect($_SERVER["REQUEST_URI"], $_GET, FALSE, TRUE);
         }
     }
     $this->tpl_authority = $_SESSION['authority'];
     // ディスプレイクラス生成
     $this->objDisplay = new SC_Display_Ex();
     // プラグインクラス生成
     $this->objPlagin = new SC_Helper_Plugin_Ex();
     $this->objPlagin->preProcess($this);
     // トランザクショントークンの検証と生成
     $this->doValidToken(true);
     $this->setTokenTo();
 }
 /**
  * Page のAction.
  *
  * @return void
  */
 function action()
 {
     //受注詳細データの取得
     $arrOrderDetail = $this->lfGetOrderDetail($_POST['order_id']);
     //ログインしていない、またはDBに情報が無い場合
     if (empty($arrOrderDetail)) {
         SC_Utils_Ex::sfDispSiteError(CUSTOMER_ERROR);
     }
     $this->lfAddCartProducts($arrOrderDetail);
     SC_Response_Ex::sendRedirect(CART_URLPATH);
 }
 /**
  * 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()
 {
     //決済処理中ステータスのロールバック
     $objPurchase = new SC_Helper_Purchase_Ex();
     $objPurchase->cancelPendingOrder(PENDING_ORDER_CANCEL_FLAG);
     //受注詳細データの取得
     $arrOrderDetail = $this->lfGetOrderDetail($_POST['order_id']);
     //ログインしていない、またはDBに情報が無い場合
     if (empty($arrOrderDetail)) {
         SC_Utils_Ex::sfDispSiteError(CUSTOMER_ERROR);
     }
     $this->lfAddCartProducts($arrOrderDetail);
     SC_Response_Ex::sendRedirect(CART_URL);
 }
 /**
  * Page のアクション.
  *
  * @return void
  */
 function action()
 {
     $objFormParam = new SC_FormParam_Ex();
     // パラメーターの初期化
     $this->initParam($objFormParam, $_GET);
     // パラメーターの検証
     if ($objFormParam->checkError() || !SC_Utils_ex::sfIsInt($id = $objFormParam->getValue('id'))) {
         GC_Utils_Ex::gfPrintLog("error id={$id}");
         SC_Utils_Ex::sfDispError(INVALID_MOVE_ERRORR);
     }
     $id = $objFormParam->getValue('id');
     // レコードの削除
     $this->deleteMember($id);
     // リダイレクト
     $url = $this->getLocation(ADMIN_SYSTEM_URLPATH) . '?pageno=' . $objFormParam->getValue('pageno');
     SC_Response_Ex::sendRedirect($url);
 }
Esempio n. 11
0
 /**
  * Page のAction.
  *
  * @return void
  */
 public function action()
 {
     switch ($this->getMode()) {
         case 'regist':
             //-- 本登録完了のためにメールから接続した場合
             //-- 入力チェック
             $this->arrErr = $this->lfCheckError($_GET);
             if ($this->arrErr) {
                 SC_Utils_Ex::sfDispSiteError(FREE_ERROR_MSG, '', true, $this->arrErr['id']);
             }
             $registSecretKey = $this->lfRegistData($_GET);
             //本会員登録(フラグ変更)
             $this->lfSendRegistMail($registSecretKey);
             //本会員登録完了メール送信
             SC_Response_Ex::sendRedirect('complete.php', array('ci' => SC_Helper_Customer_Ex::sfGetCustomerId($registSecretKey)));
             break;
             //-- それ以外のアクセスは無効とする
         //-- それ以外のアクセスは無効とする
         default:
             SC_Utils_Ex::sfDispSiteError(FREE_ERROR_MSG, '', true, '無効なアクセスです。');
             break;
     }
 }
 /**
  * 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');
     }
 }
 /**
  * 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();
 }
 /**
  * Page のアクション.
  *
  * @return void
  */
 function action()
 {
     $objDb = new SC_Helper_DB_Ex();
     $objFormParam = new SC_FormParam_Ex();
     $this->arrData = isset($_SESSION['customer']) ? $_SESSION['customer'] : '';
     switch ($this->getMode()) {
         case 'confirm':
             // エラーチェック
             $this->lfInitParam($objFormParam);
             $objFormParam->setParam($_POST);
             $objFormParam->convParam();
             $objFormParam->toLower('email');
             $objFormParam->toLower('email02');
             $this->arrErr = $this->lfCheckError($objFormParam);
             // 入力値の取得
             $this->arrForm = $objFormParam->getFormParamList();
             if (SC_Utils_Ex::isBlank($this->arrErr)) {
                 // エラー無しで完了画面
                 $this->tpl_mainpage = 'contact/confirm.tpl';
                 $this->tpl_title = 'お問い合わせ(確認ページ)';
             }
             break;
         case 'return':
             $this->lfInitParam($objFormParam);
             $objFormParam->setParam($_POST);
             $this->arrForm = $objFormParam->getFormParamList();
             break;
         case 'complete':
             $this->lfInitParam($objFormParam);
             $objFormParam->setParam($_POST);
             $this->arrErr = $objFormParam->checkError();
             $this->arrForm = $objFormParam->getFormParamList();
             if (SC_Utils_Ex::isBlank($this->arrErr)) {
                 $this->lfSendMail($this);
                 // 完了ページへ移動する
                 SC_Response_Ex::sendRedirect('complete.php');
                 SC_Response_Ex::actionExit();
             } else {
                 SC_Utils_Ex::sfDispSiteError(CUSTOMER_ERROR);
                 SC_Response_Ex::actionExit();
             }
             break;
         default:
             break;
     }
 }
 /**
  * カートに変化が無いか検証する.
  *
  * ユニークIDとセッションのユニークIDを比較し, 異なる場合は
  * エラー画面を表示する.
  *
  * カートが空の場合, 購入ボタン押下後にカートが変更された場合は
  * カート画面へ遷移する.
  *
  * @param  string         $uniqId         ユニークID
  * @param  SC_CartSession $objCartSession
  * @return void
  */
 public function verifyChangeCart($uniqId, &$objCartSession)
 {
     $cartKey = $objCartSession->getKey();
     // カート内が空でないか
     if (SC_Utils_Ex::isBlank($cartKey)) {
         SC_Response_Ex::sendRedirect(CART_URL);
         exit;
     }
     // 初回のみカートの内容を保存
     $objCartSession->saveCurrentCart($uniqId, $cartKey);
     /*
      * POSTのユニークIDとセッションのユニークIDを比較
      *(ユニークIDがPOSTされていない場合はスルー)
      */
     if (!SC_SiteSession_Ex::checkUniqId()) {
         SC_Utils_Ex::sfDispSiteError(CANCEL_PURCHASE);
         exit;
     }
     // 購入ボタンを押してから変化がないか
     $quantity = $objCartSession->getTotalQuantity($cartKey);
     if ($objCartSession->checkChangeCart($cartKey) || !($quantity > 0)) {
         SC_Response_Ex::sendRedirect(CART_URL);
         exit;
     }
 }
 /**
  * Page のAction.
  *
  * @return void
  */
 function action()
 {
     // 会員クラス
     $objCustomer = new SC_Customer_Ex();
     // パラメーター管理クラス
     $this->objFormParam = new SC_FormParam_Ex();
     // パラメーター情報の初期化
     $this->arrForm = $this->lfInitParam($this->objFormParam);
     // ファイル管理クラス
     $this->objUpFile = new SC_UploadFile_Ex(IMAGE_TEMP_REALDIR, IMAGE_SAVE_REALDIR);
     // ファイル情報の初期化
     $this->objUpFile = $this->lfInitFile($this->objUpFile);
     // プロダクトIDの正当性チェック
     $product_id = $this->lfCheckProductId($this->objFormParam->getValue('admin'), $this->objFormParam->getValue('product_id'));
     $this->mode = $this->getMode();
     $objProduct = new SC_Product_Ex();
     $objProduct->setProductsClassByProductIds(array($product_id));
     // 規格1クラス名
     $this->tpl_class_name1 = $objProduct->className1[$product_id];
     // 規格2クラス名
     $this->tpl_class_name2 = $objProduct->className2[$product_id];
     // 規格1
     $this->arrClassCat1 = $objProduct->classCats1[$product_id];
     // 規格1が設定されている
     $this->tpl_classcat_find1 = $objProduct->classCat1_find[$product_id];
     // 規格2が設定されている
     $this->tpl_classcat_find2 = $objProduct->classCat2_find[$product_id];
     $this->tpl_stock_find = $objProduct->stock_find[$product_id];
     $this->tpl_product_class_id = $objProduct->classCategories[$product_id]['__unselected']['__unselected']['product_class_id'];
     $this->tpl_product_type = $objProduct->classCategories[$product_id]['__unselected']['__unselected']['product_type'];
     // 在庫が無い場合は、OnLoadしない。(javascriptエラー防止)
     if ($this->tpl_stock_find) {
         // 規格選択セレクトボックスの作成
         $this->js_lnOnload .= $this->lfMakeSelect();
     }
     $this->tpl_javascript .= 'classCategories = ' . SC_Utils_Ex::jsonEncode($objProduct->classCategories[$product_id]) . ';';
     $this->tpl_javascript .= 'function lnOnLoad(){' . $this->js_lnOnload . '}';
     $this->tpl_onload .= 'lnOnLoad();';
     // モバイル用 規格選択セレクトボックスの作成
     if (SC_Display_Ex::detectDevice() == DEVICE_TYPE_MOBILE) {
         $this->lfMakeSelectMobile($this, $product_id, $this->objFormParam->getValue('classcategory_id1'));
     }
     // 商品IDをFORM内に保持する
     $this->tpl_product_id = $product_id;
     switch ($this->mode) {
         case 'cart':
             $this->arrErr = $this->lfCheckError($this->mode, $this->objFormParam, $this->tpl_classcat_find1, $this->tpl_classcat_find2);
             if (count($this->arrErr) == 0) {
                 $objCartSess = new SC_CartSession_Ex();
                 $product_class_id = $this->objFormParam->getValue('product_class_id');
                 $objCartSess->addProduct($product_class_id, $this->objFormParam->getValue('quantity'));
                 SC_Response_Ex::sendRedirect(CART_URLPATH);
                 SC_Response_Ex::actionExit();
             }
             break;
         case 'add_favorite':
             // ログイン中のユーザが商品をお気に入りにいれる処理
             if ($objCustomer->isLoginSuccess() === true && $this->objFormParam->getValue('favorite_product_id') > 0) {
                 $this->arrErr = $this->lfCheckError($this->mode, $this->objFormParam);
                 if (count($this->arrErr) == 0) {
                     if (!$this->lfRegistFavoriteProduct($this->objFormParam->getValue('favorite_product_id'), $objCustomer->getValue('customer_id'))) {
                         $objPlugin = SC_Helper_Plugin_Ex::getSingletonInstance($this->plugin_activate_flg);
                         $objPlugin->doAction('LC_Page_Products_Detail_action_add_favorite', array($this));
                         SC_Response_Ex::actionExit();
                     }
                 }
             }
             break;
         case 'add_favorite_sphone':
             // ログイン中のユーザが商品をお気に入りにいれる処理(スマートフォン用)
             if ($objCustomer->isLoginSuccess() === true && $this->objFormParam->getValue('favorite_product_id') > 0) {
                 $this->arrErr = $this->lfCheckError($this->mode, $this->objFormParam);
                 if (count($this->arrErr) == 0) {
                     if ($this->lfRegistFavoriteProduct($this->objFormParam->getValue('favorite_product_id'), $objCustomer->getValue('customer_id'))) {
                         $objPlugin = SC_Helper_Plugin_Ex::getSingletonInstance($this->plugin_activate_flg);
                         $objPlugin->doAction('LC_Page_Products_Detail_action_add_favorite_sphone', array($this));
                         print 'true';
                         SC_Response_Ex::actionExit();
                     }
                 }
                 print 'error';
                 SC_Response_Ex::actionExit();
             }
             break;
         case 'select':
         case 'select2':
         case 'selectItem':
             /**
              * モバイルの数量指定・規格選択の際に、
              * $_SESSION['cart_referer_url'] を上書きさせないために、
              * 何もせずbreakする。
              */
             break;
         default:
             // カート「戻るボタン」用に保持
             $netURL = new Net_URL();
             $_SESSION['cart_referer_url'] = $netURL->getURL();
             break;
     }
     // モバイル用 ポストバック処理
     if (SC_Display_Ex::detectDevice() == DEVICE_TYPE_MOBILE) {
         switch ($this->mode) {
             case 'select':
                 // 規格1が設定されている場合
                 if ($this->tpl_classcat_find1) {
                     // templateの変更
                     $this->tpl_mainpage = 'products/select_find1.tpl';
                     break;
                 }
                 // 数量の入力を行う
                 $this->tpl_mainpage = 'products/select_item.tpl';
                 break;
             case 'select2':
                 $this->arrErr = $this->lfCheckError($this->mode, $this->objFormParam, $this->tpl_classcat_find1, $this->tpl_classcat_find2);
                 // 規格1が設定されていて、エラーを検出した場合
                 if ($this->tpl_classcat_find1 and $this->arrErr['classcategory_id1']) {
                     // templateの変更
                     $this->tpl_mainpage = 'products/select_find1.tpl';
                     break;
                 }
                 // 規格2が設定されている場合
                 if ($this->tpl_classcat_find2) {
                     $this->arrErr = array();
                     $this->tpl_mainpage = 'products/select_find2.tpl';
                     break;
                 }
             case 'selectItem':
                 $this->arrErr = $this->lfCheckError($this->mode, $this->objFormParam, $this->tpl_classcat_find1, $this->tpl_classcat_find2);
                 // 規格2が設定されていて、エラーを検出した場合
                 if ($this->tpl_classcat_find2 and $this->arrErr['classcategory_id2']) {
                     // templateの変更
                     $this->tpl_mainpage = 'products/select_find2.tpl';
                     break;
                 }
                 $value1 = $this->objFormParam->getValue('classcategory_id1');
                 // 規格2が設定されている場合.
                 if (SC_Utils_Ex::isBlank($this->objFormParam->getValue('classcategory_id2')) == false) {
                     $value2 = '#' . $this->objFormParam->getValue('classcategory_id2');
                 } else {
                     $value2 = '#0';
                 }
                 if (strlen($value1) === 0) {
                     $value1 = '__unselected';
                 }
                 $this->tpl_product_class_id = $objProduct->classCategories[$product_id][$value1][$value2]['product_class_id'];
                 // この段階では、数量の入力チェックエラーを出させない。
                 unset($this->arrErr['quantity']);
                 // 数量の入力を行う
                 $this->tpl_mainpage = 'products/select_item.tpl';
                 break;
             case 'cart':
                 // この段階でエラーが出る場合は、数量の入力エラーのはず
                 if (count($this->arrErr)) {
                     // 数量の入力を行う
                     $this->tpl_mainpage = 'products/select_item.tpl';
                 }
                 break;
             default:
                 $this->tpl_mainpage = 'products/detail.tpl';
                 break;
         }
     }
     // 商品詳細を取得
     $this->arrProduct = $objProduct->getDetail($product_id);
     // サブタイトルを取得
     $this->tpl_subtitle = $this->arrProduct['name'];
     // 関連カテゴリを取得
     $this->arrRelativeCat = SC_Helper_DB_Ex::sfGetMultiCatTree($product_id);
     // 商品ステータスを取得
     $this->productStatus = $objProduct->getProductStatus($product_id);
     // 画像ファイル指定がない場合の置換処理
     $this->arrProduct['main_image'] = SC_Utils_Ex::sfNoImageMain($this->arrProduct['main_image']);
     $this->subImageFlag = $this->lfSetFile($this->objUpFile, $this->arrProduct, $this->arrFile);
     //レビュー情報の取得
     $this->arrReview = $this->lfGetReviewData($product_id);
     //関連商品情報表示
     $this->arrRecommend = $this->lfPreGetRecommendProducts($product_id);
     // ログイン判定
     if ($objCustomer->isLoginSuccess() === true) {
         //お気に入りボタン表示
         $this->tpl_login = true;
         $this->is_favorite = SC_Helper_DB_Ex::sfDataExists('dtb_customer_favorite_products', 'customer_id = ? AND product_id = ?', array($objCustomer->getValue('customer_id'), $product_id));
     }
 }
 /**
  * Page のアクション.
  *
  * @return void
  */
 public function action()
 {
     $post = $_POST;
     //一括送信用の処理
     if (array_key_exists('mail_order_id', $post) and $post['mode'] == 'mail_select') {
         $post['order_id_array'] = implode(',', $post['mail_order_id']);
     } elseif (!array_key_exists('order_id_array', $post)) {
         $post['order_id_array'] = $post['order_id'];
     }
     //一括送信処理変数チェック(ここですべきかは課題)
     if (preg_match("/^[0-9|\\,]*\$/", $post['order_id_array'])) {
         $this->order_id_array = $post['order_id_array'];
     } else {
         //エラーで元に戻す
         SC_Response_Ex::sendRedirect(ADMIN_ORDER_URLPATH);
         SC_Response_Ex::actionExit();
     }
     //メール本文の確認例は初めの1受注とする
     if (!SC_Utils_Ex::isBlank($this->order_id_array)) {
         $order_id_array = split(',', $this->order_id_array);
         $post['order_id'] = intval($order_id_array[0]);
         $this->order_id_count = count($order_id_array);
     }
     // パラメーター管理クラス
     $objFormParam = new SC_FormParam_Ex();
     // パラメーター情報の初期化
     $this->lfInitParam($objFormParam);
     // POST値の取得
     $objFormParam->setParam($post);
     $objFormParam->convParam();
     $this->tpl_order_id = $objFormParam->getValue('order_id');
     // 検索パラメーターの引き継ぎ
     $this->arrSearchHidden = $objFormParam->getSearchArray();
     // 履歴を読み込むか
     $load_history = SC_Utils_Ex::sfIsInt($this->tpl_order_id);
     switch ($this->getMode()) {
         case 'confirm':
             $status = $this->confirm($objFormParam);
             if ($status === true) {
                 $load_history = false;
             } else {
                 $this->arrErr = $status;
             }
             break;
         case 'send':
             $sendStatus = $this->doSend($objFormParam);
             if ($sendStatus === true) {
                 SC_Response_Ex::sendRedirect(ADMIN_ORDER_URLPATH);
                 SC_Response_Ex::actionExit();
             }
             $this->arrErr = $sendStatus;
             break;
         case 'change':
             $objFormParam = $this->changeData($objFormParam);
             break;
         case 'pre_edit':
         case 'mail_select':
         case 'return':
         default:
             break;
     }
     // 入力内容の引き継ぎ
     $this->arrForm = $objFormParam->getFormParamList();
     if ($load_history) {
         $this->arrMailHistory = $this->getMailHistory($this->tpl_order_id);
     }
 }
 /**
  * Page のアクション.
  *
  * @return void
  */
 function action()
 {
     $objCartSess = new SC_CartSession_Ex();
     $objSiteSess = new SC_SiteSession_Ex();
     $objCustomer = new SC_Customer_Ex();
     $objFormParam = $this->lfInitParam($_POST);
     $this->mode = $this->getMode();
     // モバイル対応
     if (SC_Display_Ex::detectDevice() == DEVICE_TYPE_MOBILE) {
         if (isset($_GET['cart_no'])) {
             $objFormParam->setValue('cart_no', $_GET['cart_no']);
         }
         if (isset($_GET['cartKey'])) {
             $objFormParam->setValue('cartKey', $_GET['cartKey']);
         }
     }
     $this->cartKeys = $objCartSess->getKeys();
     foreach ($this->cartKeys as $key) {
         // 商品購入中にカート内容が変更された。
         if ($objCartSess->getCancelPurchase($key)) {
             $this->tpl_message .= "商品購入中にカート内容が変更されましたので、お手数ですが購入手続きをやり直して下さい。\n";
         }
     }
     $cart_no = $objFormParam->getValue('cart_no');
     $cartKey = $objFormParam->getValue('cartKey');
     // エラーチェック
     $arrError = $objFormParam->checkError();
     if (isset($arrError) && !empty($arrError)) {
         SC_Utils_Ex::sfDispSiteError(CART_NOT_FOUND);
         SC_Response_Ex::actionExit();
     }
     switch ($this->mode) {
         case 'confirm':
             // カート内情報の取得
             $cartList = $objCartSess->getCartList($cartKey);
             // カート商品が1件以上存在する場合
             if (count($cartList) > 0) {
                 // カートを購入モードに設定
                 $this->lfSetCurrentCart($objSiteSess, $objCartSess, $cartKey);
                 // 購入ページへ
                 SC_Response_Ex::sendRedirect(SHOPPING_URL);
                 SC_Response_Ex::actionExit();
             }
             break;
         case 'up':
             //1個追加
             $objCartSess->upQuantity($cart_no, $cartKey);
             SC_Response_Ex::reload(array('category_id' => $objFormParam->getValue('category_id')), true);
             SC_Response_Ex::actionExit();
             break;
         case 'down':
             //1個減らす
             $objCartSess->downQuantity($cart_no, $cartKey);
             SC_Response_Ex::reload(array('category_id' => $objFormParam->getValue('category_id')), true);
             SC_Response_Ex::actionExit();
             break;
         case 'setQuantity':
             //数量変更
             $objCartSess->setQuantity($objFormParam->getValue('quantity'), $cart_no, $cartKey);
             SC_Response_Ex::reload(array('category_id' => $objFormParam->getValue('category_id')), true);
             SC_Response_Ex::actionExit();
             break;
         case 'delete':
             //カートから削除
             $objCartSess->delProduct($cart_no, $cartKey);
             SC_Response_Ex::reload(array('category_id' => $objFormParam->getValue('category_id')), true);
             SC_Response_Ex::actionExit();
             break;
         default:
             break;
     }
     $this->arrInfo = SC_Helper_DB_Ex::sfGetBasisData();
     $totalIncTax = 0;
     foreach ($this->cartKeys as $key) {
         // カート集計処理
         $this->tpl_message .= $objCartSess->checkProducts($key);
         $this->tpl_total_inctax[$key] = $objCartSess->getAllProductsTotal($key);
         $totalIncTax += $this->tpl_total_inctax[$key];
         $this->tpl_total_tax[$key] = $objCartSess->getAllProductsTax($key);
         // ポイント合計
         $this->tpl_total_point[$key] = $objCartSess->getAllProductsPoint($key);
         $this->arrData[$key] = $objCartSess->calculate($key, $objCustomer);
         // 送料無料チェック
         $this->arrData[$key]['is_deliv_free'] = $objCartSess->isDelivFree($key);
         // 送料無料までの金額を計算
         $this->tpl_deliv_free[$key] = $this->arrInfo['free_rule'] - $this->tpl_total_inctax[$key];
     }
     //商品の合計金額をセット
     $this->tpl_all_total_inctax = $totalIncTax;
     $this->tpl_category_id = $objFormParam->getValue('category_id');
     // ログイン判定
     if ($objCustomer->isLoginSuccess(true)) {
         $this->tpl_login = true;
         $this->tpl_user_point = $objCustomer->getValue('point');
         $this->tpl_name = $objCustomer->getValue('name01');
     }
     // 前頁のURLを取得
     // TODO: SC_CartSession::setPrevURL()利用不可。
     $this->lfGetCartPrevUrl($_SESSION, $_SERVER['HTTP_REFERER']);
     $this->tpl_prev_url = isset($_SESSION['cart_prev_url']) ? $_SESSION['cart_prev_url'] : '';
     // すべてのカートの内容を取得する
     $this->cartItems = $objCartSess->getAllCartList();
 }
Esempio n. 19
0
 /**
  * Page のAction.
  *
  * @return void
  */
 function action()
 {
     SC_Response_Ex::sendRedirect(DIR_INDEX_PATH);
 }
 /**
  * Add product(s) into the cart.
  * 
  * @return void 
  */
 function doCart()
 {
     $this->arrErr = $this->lfCheckError($this->mode, $this->objFormParam, $this->tpl_classcat_find1, $this->tpl_classcat_find2);
     if (count($this->arrErr) == 0) {
         $objCartSess = new SC_CartSession_Ex();
         $product_class_id = $this->objFormParam->getValue('product_class_id');
         $objCartSess->addProduct($product_class_id, $this->objFormParam->getValue('quantity'));
         SC_Response_Ex::sendRedirect(CART_URLPATH);
         SC_Response_Ex::actionExit();
     }
 }
 /**
  * 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;
     }
 }
 /**
  * Page のプロセス.
  *
  * @return void
  */
 public function action()
 {
     //決済処理中ステータスのロールバック
     $objPurchase = new SC_Helper_Purchase_Ex();
     $objPurchase->cancelPendingOrder(PENDING_ORDER_CANCEL_FLAG);
     $objSiteSess = new SC_SiteSession_Ex();
     $objCartSess = new SC_CartSession_Ex();
     $objCustomer = new SC_Customer_Ex();
     $objFormParam = new SC_FormParam_Ex();
     $objAddress = new SC_Helper_Address_Ex();
     // 複数配送先指定が無効な場合はエラー
     if (USE_MULTIPLE_SHIPPING === false) {
         SC_Utils_Ex::sfDispSiteError(PAGE_ERROR, '', true);
         SC_Response_Ex::actionExit();
     }
     $this->tpl_uniqid = $objSiteSess->getUniqId();
     $this->addrs = $this->getDelivAddrs($objCustomer, $objPurchase, $objAddress);
     $this->tpl_addrmax = count($this->addrs) - 2;
     // 「選択してください」と会員の住所をカウントしない
     $this->lfInitParam($objFormParam);
     $objPurchase->verifyChangeCart($this->tpl_uniqid, $objCartSess);
     switch ($this->getMode()) {
         case 'confirm':
             $objFormParam->setParam($_POST);
             $this->arrErr = $this->lfCheckError($objFormParam);
             if (SC_Utils_Ex::isBlank($this->arrErr)) {
                 // フォームの情報を一時保存しておく
                 $_SESSION['multiple_temp'] = $objFormParam->getHashArray();
                 $this->saveMultipleShippings($this->tpl_uniqid, $objFormParam, $objCustomer, $objPurchase, $objAddress);
                 $objSiteSess->setRegistFlag();
                 SC_Response_Ex::sendRedirect('payment.php');
                 SC_Response_Ex::actionExit();
             }
             break;
         default:
             $this->setParamToSplitItems($objFormParam, $objCartSess);
     }
     // 前のページから戻ってきた場合
     if ($_GET['from'] == 'multiple') {
         $objFormParam->setParam($_SESSION['multiple_temp']);
     }
     $this->arrForm = $objFormParam->getFormParamList();
 }
 /**
  * Page のAction.
  *
  * @return void
  */
 function action()
 {
     $objFormParam = new SC_FormParam_Ex();
     $this->lfInitParam($objFormParam);
     $objFormParam->setParam($_POST);
     $objFormParam->convParam();
     switch ($this->getMode()) {
         case 'confirm':
             $this->arrErr = $this->lfCheckError($objFormParam);
             //エラーチェック
             if (empty($this->arrErr)) {
                 //重複タイトルでない
                 $this->tpl_mainpage = 'products/review_confirm.tpl';
             }
             break;
         case 'return':
             break;
         case 'complete':
             $this->arrErr = $this->lfCheckError($objFormParam);
             //エラーチェック
             if (empty($this->arrErr)) {
                 //登録実行
                 $this->lfRegistRecommendData($objFormParam);
                 //レビュー書き込み完了ページへ
                 SC_Response_Ex::sendRedirect('review_complete.php');
                 SC_Response_Ex::actionExit();
             }
             break;
         default:
             // 最初のproduct_idは、$_GETで渡ってくる。
             $objFormParam->setParam($_GET);
             break;
     }
     $this->arrForm = $objFormParam->getHashArray();
     //商品名の取得
     $this->arrForm['name'] = $this->lfGetProductName($this->arrForm['product_id']);
     if (empty($this->arrForm['name'])) {
         SC_Utils_Ex::sfDispSiteError(PAGE_ERROR);
     }
     $this->setTemplate($this->tpl_mainpage);
 }
 /**
  * Page のアクション.
  *
  * @return void
  */
 function action()
 {
     $objCartSess = new SC_CartSession_Ex();
     $objSiteSess = new SC_SiteSession_Ex();
     $objCustomer = new SC_Customer_Ex();
     $objPurchase = new SC_Helper_Purchase_Ex();
     $objHelperMail = new SC_Helper_Mail_Ex();
     $this->is_multiple = $objPurchase->isMultiple();
     // 前のページで正しく登録手続きが行われた記録があるか判定
     if (!$objSiteSess->isPrePage()) {
         SC_Utils_Ex::sfDispSiteError(PAGE_ERROR, $objSiteSess);
     }
     // ユーザユニークIDの取得と購入状態の正当性をチェック
     $this->tpl_uniqid = $objSiteSess->getUniqId();
     $objPurchase->verifyChangeCart($this->tpl_uniqid, $objCartSess);
     $this->cartKey = $objCartSess->getKey();
     // カート内商品のチェック
     $this->tpl_message = $objCartSess->checkProducts($this->cartKey);
     if (!SC_Utils_Ex::isBlank($this->tpl_message)) {
         SC_Response_Ex::sendRedirect(CART_URLPATH);
         SC_Response_Ex::actionExit();
     }
     // カートの商品を取得
     $this->arrShipping = $objPurchase->getShippingTemp($this->is_multiple);
     $this->arrCartItems = $objCartSess->getCartList($this->cartKey);
     // 合計金額
     $this->tpl_total_inctax[$this->cartKey] = $objCartSess->getAllProductsTotal($this->cartKey);
     // 税額
     $this->tpl_total_tax[$this->cartKey] = $objCartSess->getAllProductsTax($this->cartKey);
     // ポイント合計
     $this->tpl_total_point[$this->cartKey] = $objCartSess->getAllProductsPoint($this->cartKey);
     // 一時受注テーブルの読込
     $arrOrderTemp = $objPurchase->getOrderTemp($this->tpl_uniqid);
     // カート集計を元に最終計算
     $arrCalcResults = $objCartSess->calculate($this->cartKey, $objCustomer, $arrOrderTemp['use_point'], $objPurchase->getShippingPref($this->is_multiple), $arrOrderTemp['charge'], $arrOrderTemp['discount'], $arrOrderTemp['deliv_id']);
     $this->arrForm = array_merge($arrOrderTemp, $arrCalcResults);
     // 会員ログインチェック
     if ($objCustomer->isLoginSuccess(true)) {
         $this->tpl_login = '******';
         $this->tpl_user_point = $objCustomer->getValue('point');
     }
     // 決済モジュールを使用するかどうか
     $this->use_module = SC_Helper_Payment_Ex::useModule($this->arrForm['payment_id']);
     switch ($this->getMode()) {
         // 前のページに戻る
         case 'return':
             // 正常な推移であることを記録しておく
             $objSiteSess->setRegistFlag();
             SC_Response_Ex::sendRedirect(SHOPPING_PAYMENT_URLPATH);
             SC_Response_Ex::actionExit();
             break;
         case 'confirm':
             /*
              * 決済モジュールで必要なため, 受注番号を取得
              */
             $this->arrForm['order_id'] = $objPurchase->getNextOrderID();
             $_SESSION['order_id'] = $this->arrForm['order_id'];
             // 集計結果を受注一時テーブルに反映
             $objPurchase->saveOrderTemp($this->tpl_uniqid, $this->arrForm, $objCustomer);
             // 正常に登録されたことを記録しておく
             $objSiteSess->setRegistFlag();
             // 決済モジュールを使用する場合
             if ($this->use_module) {
                 $objPurchase->completeOrder(ORDER_PENDING);
                 SC_Response_Ex::sendRedirect(SHOPPING_MODULE_URLPATH);
             } else {
                 $objPurchase->completeOrder(ORDER_NEW);
                 $template_id = SC_Display_Ex::detectDevice() == DEVICE_TYPE_MOBILE ? 2 : 1;
                 $objHelperMail->sfSendOrderMail($this->arrForm['order_id'], $template_id);
                 SC_Response_Ex::sendRedirect(SHOPPING_COMPLETE_URLPATH);
             }
             SC_Response_Ex::actionExit();
             break;
         default:
             break;
     }
 }
Esempio n. 25
0
 /**
  * @static
  */
 function reload($arrQueryString = array(), $removeQueryString = false)
 {
     // 現在の URL を取得
     $netUrl = new Net_URL($_SERVER['REQUEST_URI']);
     if (!$removeQueryString) {
         $arrQueryString = array_merge($netUrl->querystring, $arrQueryString);
     }
     $netUrl->querystring = array();
     SC_Response_Ex::sendRedirect($netUrl->getURL(), $arrQueryString);
 }
 /**
  * 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;
     }
 }
 /**
  * ファイル内容を表示する
  *
  * @return void
  */
 public function execFileView($objFormParam)
 {
     $file = $objFormParam->getValue('file');
     // ソースとして表示するファイルを定義(直接実行しないファイル)
     $arrViewFile = array('html', 'htm', 'tpl', 'php', 'css', 'js');
     $extension = pathinfo($file, PATHINFO_EXTENSION);
     if (in_array($extension, $arrViewFile)) {
         $objFileManager = new SC_Helper_FileManager_Ex();
         // ファイルを読み込んで表示
         header("Content-type: text/plain\n\n");
         echo $objFileManager->sfReadFile(USER_REALDIR . $file);
     } else {
         SC_Response_Ex::sendRedirect(USER_URL . $file);
     }
 }
 /**
  * Page のアクション.
  *
  * @return void
  */
 function action()
 {
     $objLayout = new SC_Helper_PageLayout_Ex();
     $objFormParam = new SC_FormParam_Ex();
     $this->lfInitParam($objFormParam, intval($_REQUEST['bloc_cnt']));
     $objFormParam->setParam($_REQUEST);
     $this->device_type_id = $objFormParam->getValue('device_type_id', DEVICE_TYPE_PC);
     $this->page_id = $objFormParam->getValue('page_id', 1);
     switch ($this->getMode()) {
         // 新規ブロック作成
         case 'new_bloc':
             SC_Response_Ex::sendRedirect('bloc.php', array('device_type_id' => $this->device_type_id));
             SC_Response_Ex::actionExit();
             break;
             // 新規ページ作成
         // 新規ページ作成
         case 'new_page':
             SC_Response_Ex::sendRedirect('main_edit.php', array('device_type_id' => $this->device_type_id));
             SC_Response_Ex::actionExit();
             break;
             // プレビュー
         // プレビュー
         case 'preview':
             $this->placingBlocs($objFormParam, true);
             $filename = $this->savePreviewData($this->page_id, $objLayout);
             $_SESSION['preview'] = 'ON';
             SC_Response_Ex::sendRedirectFromUrlPath('preview/' . DIR_INDEX_PATH, array('filename' => $filename));
             SC_Response_Ex::actionExit();
             // 編集実行
         // 編集実行
         case 'confirm':
             $this->placingBlocs($objFormParam);
             $arrQueryString = array('device_type_id' => $this->device_type_id, 'page_id' => $this->page_id, 'msg' => 'on');
             SC_Response_Ex::reload($arrQueryString, true);
             SC_Response_Ex::actionExit();
             break;
             // データ削除処理
         // データ削除処理
         case 'delete':
             //ベースデータでなければファイルを削除
             if ($objLayout->isEditablePage($this->device_type_id, $this->page_id)) {
                 $objLayout->lfDelPageData($this->page_id, $this->device_type_id);
                 SC_Response_Ex::reload(array('device_type_id' => $this->device_type_id), true);
                 SC_Response_Ex::actionExit();
             }
             break;
         default:
             // 完了メッセージ表示
             if (isset($_GET['msg']) && $_GET['msg'] == 'on') {
                 $this->tpl_onload = "alert('登録が完了しました。');";
             }
             break;
     }
     $this->arrBlocs = $this->getLayout($this->device_type_id, $this->page_id, $objLayout);
     $this->bloc_cnt = count($this->arrBlocs);
     // 編集中のページ
     $this->arrPageData = $objLayout->getPageProperties($this->device_type_id, $this->page_id);
     // 編集可能ページ一覧
     $this->arrEditPage = $objLayout->getPageProperties($this->device_type_id, null);
     //サブタイトルを取得
     $this->tpl_subtitle = $this->arrDeviceType[$this->device_type_id] . '>' . $this->tpl_subtitle;
 }
 /**
  * Page のアクション.
  *
  * @return void
  */
 function action()
 {
     // パラメーター管理クラス
     $objFormParam = new SC_FormParam_Ex();
     $this->lfInitParamSearchCustomer($objFormParam);
     $objFormParam->setParam($_POST);
     // パラメーター読み込み
     $this->arrHidden = $objFormParam->getSearchArray();
     // 入力パラメーターチェック
     $this->arrErr = SC_Helper_Customer_Ex::sfCheckErrorSearchParam($objFormParam);
     $this->arrForm = $objFormParam->getFormParamList();
     if (!SC_Utils_Ex::isBlank($this->arrErr)) {
         return;
     }
     // モードによる処理切り替え
     switch ($this->getMode()) {
         // 配信先検索
         case 'search':
         case 'back':
             list($this->tpl_linemax, $this->arrResults, $this->objNavi) = SC_Helper_Customer_Ex::sfGetSearchData($objFormParam->getHashArray());
             $this->arrPagenavi = $this->objNavi->arrPagenavi;
             break;
             // input:検索結果画面「配信内容を設定する」押下後
         // input:検索結果画面「配信内容を設定する」押下後
         case 'input':
             $this->tpl_mainpage = 'mail/input.tpl';
             break;
             // template:テンプレート選択時
         // template:テンプレート選択時
         case 'template':
         case 'regist_back':
             $this->tpl_mainpage = 'mail/input.tpl';
             if (SC_Utils_Ex::sfIsInt($_POST['template_id']) === true) {
                 $this->lfAddParamSelectTemplate($objFormParam);
                 $this->lfGetTemplateData($objFormParam, $_POST['template_id']);
                 // regist_back時、subject,bodyにはテンプレートを読み込むのではなく、入力内容で上書き
                 if ($this->getMode() == 'regist_back') {
                     $objFormParam->setParam($_POST);
                 }
             }
             break;
         case 'regist_confirm':
             $this->tpl_mainpage = 'mail/input.tpl';
             $this->lfAddParamSelectTemplate($objFormParam);
             $objFormParam->setParam($_POST);
             $this->arrErr = $objFormParam->checkError();
             if (SC_Utils_Ex::isBlank($this->arrErr)) {
                 $this->tpl_mainpage = 'mail/input_confirm.tpl';
             }
             break;
         case 'regist_complete':
             $this->tpl_mainpage = 'mail/input.tpl';
             $this->lfAddParamSelectTemplate($objFormParam);
             $objFormParam->setParam($_POST);
             $this->arrErr = $objFormParam->checkError();
             if (SC_Utils_Ex::isBlank($this->arrErr)) {
                 $this->tpl_mainpage = 'mail/index.tpl';
                 SC_Helper_Mail_Ex::sfSendMailmagazine($this->lfRegisterData($objFormParam));
                 // DB登録・送信
                 SC_Response_Ex::sendRedirect('./history.php');
             }
             break;
             // query:配信履歴から「確認」
         // query:配信履歴から「確認」
         case 'query':
             if (SC_Utils_Ex::sfIsInt($_GET['send_id'])) {
                 $this->arrSearchData = $this->lfGetMailQuery();
             }
             $this->setTemplate('mail/query.tpl');
             break;
             // query:配信履歴から「再送信」
         // query:配信履歴から「再送信」
         case 'retry':
             if (SC_Utils_Ex::sfIsInt($_GET['send_id'])) {
                 SC_Helper_Mail_Ex::sfSendMailmagazine($_GET['send_id']);
                 // DB登録・送信
                 SC_Response_Ex::sendRedirect('./history.php');
             } else {
                 $this->tpl_onload = "window.alert('メール送信IDが正しくありません');";
             }
             break;
         default:
             break;
     }
     $this->arrForm = $objFormParam->getFormParamList();
 }
 /**
  * Page のアクション.
  *
  * @return void
  */
 function action()
 {
     // チェック後のデータを格納
     $arrClean = array();
     // $_GET['move'] が想定値かどうかチェック
     switch ($_GET['move']) {
         case 'up':
         case 'down':
             $arrClean['move'] = $_GET['move'];
             break;
         default:
             $arrClean['move'] = "";
             break;
     }
     // 正当な数値であればOK
     if (SC_Utils_Ex::sfIsInt($_GET['id'])) {
         $arrClean['id'] = $_GET['id'];
         switch ($arrClean['move']) {
             case 'up':
                 $this->lfRunkUp($arrClean['id']);
                 break;
             case 'down':
                 $this->lfRunkDown($arrClean['id']);
                 break;
             default:
                 break;
         }
     } else {
         GC_Utils_Ex::gfPrintLog("error id=" . $_GET['id']);
     }
     // ページの表示
     SC_Response_Ex::sendRedirect(ADMIN_SYSTEM_URLPATH);
 }