/** * 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; } }
/** * 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; } }
/** * フォーム入力パラメーターエラーチェック * * @param array $objFormParam フォームパラメータークラス * @return array エラー配列 */ public function lfCheckError(&$objFormParam) { $arrErr = SC_Helper_Customer_Ex::sfCustomerMypageErrorCheck($objFormParam, true); // メアド重複チェック(共通ルーチンは使えない) $objQuery =& SC_Query_Ex::getSingletonInstance(); $col = 'email, email_mobile, customer_id'; $table = 'dtb_customer'; $where = 'del_flg <> 1 AND (email Like ? OR email_mobile Like ?)'; $arrVal = array($objFormParam->getValue('email'), $objFormParam->getValue('email_mobile')); if ($objFormParam->getValue('customer_id')) { $where .= ' AND customer_id <> ?'; $arrVal[] = $objFormParam->getValue('customer_id'); } $arrData = $objQuery->getRow($col, $table, $where, $arrVal); if (!SC_Utils_Ex::isBlank($arrData['email'])) { if ($arrData['email'] == $objFormParam->getValue('email')) { $arrErr['email'] = '※ すでに他の会員(ID:' . $arrData['customer_id'] . ')が使用しているアドレスです。'; } elseif ($arrData['email'] == $objFormParam->getValue('email_mobile')) { $arrErr['email_mobile'] = '※ すでに他の会員(ID:' . $arrData['customer_id'] . ')が使用しているアドレスです。'; } } if (!SC_Utils_Ex::isBlank($arrData['email_mobile'])) { if ($arrData['email_mobile'] == $objFormParam->getValue('email_mobile')) { $arrErr['email_mobile'] = '※ すでに他の会員(ID:' . $arrData['customer_id'] . ')が使用している携帯アドレスです。'; } elseif ($arrData['email_mobile'] == $objFormParam->getValue('email')) { if ($arrErr['email'] == '') { $arrErr['email'] = '※ すでに他の会員(ID:' . $arrData['customer_id'] . ')が使用している携帯アドレスです。'; } } } return $arrErr; }
/** * フォーム入力パラメーターエラーチェック * * @param array $objFormParam フォームパラメータークラス * @return array エラー配列 */ function lfCheckError(&$objFormParam) { $arrErr = SC_Helper_Customer_Ex::sfCustomerMypageErrorCheck($objFormParam, true); // メアド重複チェック(共通ルーチンは使えない) $objQuery =& SC_Query_Ex::getSingletonInstance(); $col = 'email, email_mobile, customer_id'; $table = 'dtb_customer'; $where = 'del_flg <> 1 AND (email Like ? OR email_mobile Like ?)'; $arrVal = array($objFormParam->getValue('email'), $objFormParam->getValue('email_mobile')); if ($objFormParam->getValue('customer_id')) { $where .= ' AND customer_id <> ?'; $arrVal[] = $objFormParam->getValue('customer_id'); } $arrData = $objQuery->getRow($col, $table, $where, $arrVal); if (!SC_Utils_Ex::isBlank($arrData['email'])) { if ($arrData['email'] == $objFormParam->getValue('email')) { $arrErr['email'] = t('c_* This address is already used by another member (ID:T_ARG1)._01', array('T_ARG1' => $arrData['customer_id'])); } else { if ($arrData['email'] == $objFormParam->getValue('email_mobile')) { $arrErr['email_mobile'] = t('c_* This address is already used by another member (ID:T_ARG1)._01', array('T_ARG1' => $arrData['customer_id'])); } } } if (!SC_Utils_Ex::isBlank($arrData['email_mobile'])) { if ($arrData['email_mobile'] == $objFormParam->getValue('email_mobile')) { $arrErr['email_mobile'] = t('c_* This mobile address is already used by another member (ID:T_ARG1)._01', array('T_ARG1' => $arrData['customer_id'])); } else { if ($arrData['email_mobile'] == $objFormParam->getValue('email')) { if ($arrErr['email'] == '') { $arrErr['email'] = t('c_* This mobile address is already used by another member (ID:T_ARG1)._01', array('T_ARG1' => $arrData['customer_id'])); } } } } return $arrErr; }