Ignore:
Timestamp:
2011/01/28 16:19:40 (13 years ago)
Author:
eccuore
Message:

#642(共通ロジックの機能向上) mode 取得用の関数を利用するように修正(switchリファクタリングは未対応)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/version-2_5-dev/data/class/pages/mypage/LC_Page_Mypage_Change.php

    r20025 r20041  
    5858        $this->arrSex = $masterData->getMasterData("mtb_sex"); 
    5959        $this->httpCacheControl('nocache'); 
    60          
     60 
    6161        // 生年月日選択肢の取得 
    6262        $objDate = new SC_Date(START_BIRTH_YEAR, date("Y",strtotime("now"))); 
     
    6464        $this->arrMonth = $objDate->getMonth(true); 
    6565        $this->arrDay = $objDate->getDay(true); 
    66          
     66 
    6767        $this->isMobile = Net_UserAgent_Mobile::isMobile(); 
    6868    } 
     
    7777        $this->sendResponse(); 
    7878    } 
    79      
     79 
    8080    /** 
    8181     * Page のプロセス 
     
    8585        $objDb = new SC_Helper_DB_Ex(); 
    8686        $CONF = $objDb->sfGetBasisData(); 
    87          
     87 
    8888        $objQuery = new SC_Query(); 
    8989        $objCustomer = new SC_Customer(); 
    90          
     90 
    9191        // ログインチェック 
    9292        if (!$objCustomer->isLoginSuccess(true)){ 
     
    9999            $this->CustomerPoint = $objCustomer->getvalue('point'); 
    100100        } 
    101          
     101 
    102102        // mobile用(戻るボタンでの遷移かどうかを判定) 
    103103        if (!empty($_POST["return"])) { 
    104104            $_POST["mode"] = "return"; 
    105105        } 
    106          
     106 
    107107        // パラメータ管理クラス,パラメータ情報の初期化 
    108108        $this->objFormParam = new SC_FormParam(); 
    109109        $this->lfInitParam(); 
    110110        $this->objFormParam->setParam($_POST);    // POST値の取得 
    111          
    112         
     111 
     112 
    113113        if ($_SERVER["REQUEST_METHOD"] == "POST") { 
    114              
     114 
    115115            //CSRF対策 
    116116            /* 
     
    119119            } 
    120120            */ 
    121                          
     121 
    122122            $this->objFormParam->convParam(); 
    123123            $this->objFormParam->toLower('email'); 
     
    126126            $this->objFormParam->toLower('email_mobile02'); 
    127127            $this->arrForm = $this->objFormParam->getHashArray(); 
    128                   
     128 
    129129            //-- 確認 
    130             if ($_POST["mode"] == "confirm") { 
     130            if ($this->getMode() == "confirm") { 
    131131 
    132132                $this->arrErr = $this->lfErrorCheck(); 
    133                  
     133 
    134134                // 入力エラーなし 
    135135                if(count($this->arrErr) == 0) { 
    136                      
     136 
    137137                    $this->list_data = $this->objFormParam->getHashArray(); 
    138                  
     138 
    139139                    //パスワード表示 
    140140                    $passlen = strlen($this->arrForm['password']); 
    141141                    $this->passlen = SC_Utils_Ex::lfPassLen($passlen); 
    142      
     142 
    143143                    $this->tpl_mainpage = 'mypage/change_confirm.tpl'; 
    144144                    $this->tpl_title = '会員登録(確認ページ)'; 
    145145                } 
    146146 
    147             } elseif ($_POST["mode"] == "complete") { 
     147            } elseif ($this->getMode() == "complete") { 
    148148                //-- 会員登録と完了画面 
    149             
     149 
    150150                // 会員情報の登録 
    151151                $this->CONF = $CONF; 
    152152                $this->lfRegistData(); 
    153                  
     153 
    154154                // 完了ページに移動させる。 
    155155                SC_Response_Ex::sendRedirect('change_complete.php'); 
    156156                exit; 
    157                  
     157 
    158158            } 
    159159        } else { 
     
    177177    /* パラメータ情報の初期化 */ 
    178178    function lfInitParam() { 
    179                           
     179 
    180180        $this->objFormParam->addParam("お名前(姓)", 'name01', STEXT_LEN, "aKV", array("EXIST_CHECK", "NO_SPTAB", "SPTAB_CHECK" ,"MAX_LENGTH_CHECK")); 
    181181        $this->objFormParam->addParam("お名前(名)", 'name02', STEXT_LEN, "aKV", array("EXIST_CHECK", "NO_SPTAB", "SPTAB_CHECK" , "MAX_LENGTH_CHECK")); 
     
    199199        $this->objFormParam->addParam("日", "day", INT_LEN, "n", array("MAX_LENGTH_CHECK"), "", false); 
    200200        $this->objFormParam->addParam("メールマガジン", "mailmaga_flg", INT_LEN, "n", array("EXIST_CHECK", "NUM_CHECK")); 
    201          
     201 
    202202        if ($this->isMobile === false){ 
    203203            $this->objFormParam->addParam("FAX番号1", 'fax01', TEL_ITEM_LEN, "n", array("SPTAB_CHECK")); 
     
    228228            unset($objErr->arrErr['reminder_answer']); 
    229229        } 
    230                          
     230 
    231231        $objErr->doFunc(array("お電話番号", "tel01", "tel02", "tel03"),array("TEL_CHECK")); 
    232232        $objErr->doFunc(array("郵便番号", "zip01", "zip02"), array("ALL_EXIST_CHECK")); 
     
    239239            $objErr->doFunc(array("FAX番号", "fax01", "fax02", "fax03") ,array("TEL_CHECK")); 
    240240        } 
    241                  
     241 
    242242        // 現会員の判定 → 現会員もしくは仮登録中は、メアド一意が前提になってるので同じメアドで登録不可 
    243243        $register_user_flg = SC_Helper_Customer_Ex::sfCheckRegisterUserFromEmail($arrRet["email"]); 
     
    254254        return $objErr->arrErr; 
    255255    } 
    256      
     256 
    257257    function lfRegistData() { 
    258                  
     258 
    259259        $objQuery = new SC_Query(); 
    260260        $objCustomer = new SC_Customer(); 
    261          
     261 
    262262        $arrRet = $this->objFormParam->getHashArray(); 
    263          
     263 
    264264        // 登録データの作成 
    265265        $sqlval = $this->objFormParam->getDbArray(); 
    266266        $sqlval['birth'] = SC_Utils_Ex::sfGetTimestamp($arrRet['year'], $arrRet['month'], $arrRet['day']); 
    267                         
     267 
    268268        $objQuery->begin(); 
    269         SC_Helper_Customer_Ex::sfEditCustomerData($sqlval, $objCustomer->getValue('customer_id'));         
     269        SC_Helper_Customer_Ex::sfEditCustomerData($sqlval, $objCustomer->getValue('customer_id')); 
    270270        $objQuery->commit(); 
    271271    } 
    272      
     272 
    273273    /** 
    274274     * 顧客情報の取得 
     
    279279        $objQuery = new SC_Query(); 
    280280        $objCustomer = new SC_Customer(); 
    281          
     281 
    282282        // 顧客情報DB取得 
    283283        $ret = $objQuery->select("*","dtb_customer","customer_id=?", array($objCustomer->getValue('customer_id'))); 
     
    310310        } 
    311311    } 
    312      
     312 
    313313} 
    314314?> 
Note: See TracChangeset for help on using the changeset viewer.