コード例 #1
0
ファイル: InputZip.php プロジェクト: ChigusaYasoda/ec-cube
 /**
  * Page のプロセス.
  *
  * @return void
  */
 public function process()
 {
     // 入力エラーチェック
     $arrErr = $this->fnErrorCheck($_GET);
     // 入力エラーの場合は終了
     if (count($arrErr) > 0) {
         $tpl_message = '';
         foreach ($arrErr as $val) {
             $tpl_message .= preg_replace("/<br \\/>/", "\n", $val);
         }
         echo $tpl_message;
         // エラー無し
     } else {
         // 郵便番号検索文作成
         $zipcode = $_GET['zip1'] . $_GET['zip2'];
         // 郵便番号検索
         $arrAdsList = Utils::sfGetAddress($zipcode);
         // 郵便番号が発見された場合
         if (!empty($arrAdsList)) {
             $data = $arrAdsList[0]['state'] . '|' . $arrAdsList[0]['city'] . '|' . $arrAdsList[0]['town'];
             echo $data;
             // 該当無し
         } else {
             echo '該当する住所が見つかりませんでした。';
         }
     }
 }
コード例 #2
0
ファイル: AddrFromZip.php プロジェクト: ChigusaYasoda/ec-cube
 public function doAction($arrParam)
 {
     $arrRequest = $this->doInitParam($arrParam);
     if (!$this->isParamError()) {
         $zipcode = $arrRequest['zip1'] . $arrRequest['zip2'];
         $arrAddrList = Utils::sfGetAddress($zipcode);
         if (!Utils::isBlank($arrAddrList)) {
             $this->setResponse('Address', array('State' => $arrAddrList[0]['state'], 'City' => $arrAddrList[0]['city'], 'Town' => $arrAddrList[0]['town']));
             return true;
         }
     }
     return false;
 }
コード例 #3
0
ファイル: Change.php プロジェクト: ChigusaYasoda/ec-cube
 /**
  * Page のプロセス
  * @return void
  */
 public function action()
 {
     /* @var $objCustomer Customer */
     $objCustomer = Application::alias('eccube.customer');
     $customer_id = $objCustomer->getValue('customer_id');
     // mobile用(戻るボタンでの遷移かどうかを判定)
     if (!empty($_POST['return'])) {
         $_REQUEST['mode'] = 'return';
     }
     // パラメーター管理クラス,パラメーター情報の初期化
     $objFormParam = Application::alias('eccube.form_param');
     Application::alias('eccube.helper.customer')->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 = Utils::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>';
                     }
                 }
                 break;
             }
             $this->arrErr = Application::alias('eccube.helper.customer')->sfCustomerMypageErrorCheck($objFormParam);
             // 入力エラーなし
             if (empty($this->arrErr)) {
                 //パスワード表示
                 $this->passlen = Utils::sfPassLen(strlen($objFormParam->getValue('password')));
                 $this->tpl_mainpage = 'mypage/change_confirm.tpl';
                 $this->tpl_title = '会員登録(確認ページ)';
                 $this->tpl_subtitle = '会員登録内容変更(確認ページ)';
             }
             break;
             // 会員登録と完了画面
         // 会員登録と完了画面
         case 'complete':
             $this->arrErr = Application::alias('eccube.helper.customer')->sfCustomerMypageErrorCheck($objFormParam);
             // 入力エラーなし
             if (empty($this->arrErr)) {
                 // 会員情報の登録
                 $this->lfRegistCustomerData($objFormParam, $customer_id);
                 //セッション情報を最新の状態に更新する
                 $objCustomer->updateSession();
                 // 完了ページに移動させる。
                 Application::alias('eccube.response')->sendRedirect('change_complete.php');
             }
             break;
             // 確認ページからの戻り
         // 確認ページからの戻り
         case 'return':
             // quiet.
             break;
         default:
             $objFormParam->setParam(Application::alias('eccube.helper.customer')->sfGetCustomerData($customer_id));
             break;
     }
     $this->arrForm = $objFormParam->getFormParamList();
 }
コード例 #4
0
ファイル: Index.php プロジェクト: ChigusaYasoda/ec-cube
 /**
  * Page のプロセス
  * @return void
  */
 public function action()
 {
     //決済処理中ステータスのロールバック
     /* @var $objPurchase PurchaseHelper */
     $objPurchase = Application::alias('eccube.helper.purchase');
     $objPurchase->cancelPendingOrder(PENDING_ORDER_CANCEL_FLAG);
     $objFormParam = Application::alias('eccube.form_param');
     // PC時は規約ページからの遷移でなければエラー画面へ遷移する
     if ($this->lfCheckReferer() === false) {
         Utils::sfDispSiteError(PAGE_ERROR, '', true);
     }
     Application::alias('eccube.helper.customer')->sfCustomerEntryParam($objFormParam);
     $objFormParam->setParam($_POST);
     // mobile用(戻るボタンでの遷移かどうかを判定)
     if (!empty($_POST['return'])) {
         $_REQUEST['mode'] = 'return';
     }
     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 = Utils::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>';
                     }
                 }
                 break;
             }
             //-- 確認
             $this->arrErr = Application::alias('eccube.helper.customer')->sfCustomerEntryErrorCheck($objFormParam);
             // 入力エラーなし
             if (empty($this->arrErr)) {
                 //パスワード表示
                 $this->passlen = Utils::sfPassLen(strlen($objFormParam->getValue('password')));
                 $this->tpl_mainpage = 'entry/confirm.tpl';
                 $this->tpl_title = '会員登録(確認ページ)';
             }
             break;
         case 'complete':
             //-- 会員登録と完了画面
             $this->arrErr = Application::alias('eccube.helper.customer')->sfCustomerEntryErrorCheck($objFormParam);
             if (empty($this->arrErr)) {
                 $uniqid = $this->lfRegistCustomerData($this->lfMakeSqlVal($objFormParam));
                 $this->lfSendMail($uniqid, $objFormParam->getHashArray());
                 // 仮会員が無効の場合
                 if (CUSTOMER_CONFIRM_MAIL == false) {
                     // ログイン状態にする
                     /* @var $objCustomer Customer */
                     $objCustomer = Application::alias('eccube.customer');
                     $objCustomer->setLogin($objFormParam->getValue('email'));
                 }
                 // 完了ページに移動させる。
                 Application::alias('eccube.response')->sendRedirect('complete.php', array('ci' => Application::alias('eccube.helper.customer')->sfGetCustomerId($uniqid)));
             }
             break;
         case 'return':
             // quiet.
             break;
         default:
             break;
     }
     $this->arrForm = $objFormParam->getFormParamList();
 }