- Timestamp:
- 2011/02/07 11:54:44 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/version-2_5-dev/data/class/pages/entry/LC_Page_Entry_EmailMobile.php
r20087 r20106 45 45 parent::init(); 46 46 47 $this->objFormParam = new SC_FormParam(); 48 $this->lfInitParam(); 47 49 48 } 50 49 … … 66 65 function action() { 67 66 $objCustomer = new SC_Customer; 67 $objFormParam = new SC_FormParam(); 68 69 $this->lfInitParam($objFormParam); 70 $objFormParam->setParam($_POST); 68 71 69 72 if ($_SERVER['REQUEST_METHOD'] == 'POST') { 70 $this->objFormParam->setParam($_POST); 71 $this->objFormParam->convParam(); 72 $this->arrErr = $this->lfCheckError($objCustomer); 73 $this->arrErr = $this->lfCheckError($objFormParam); 73 74 74 75 if (empty($this->arrErr)) { 75 $this->lfRegister($objCustomer); 76 $this->lfRegistEmailMobile(strtolower($objFormParam->getValue('email_mobile')), 77 $objCustomer->getValue('customer_id')); 76 78 $this->tpl_mainpage = 'entry/email_mobile_complete.tpl'; 77 79 $this->tpl_title = '携帯メール登録完了'; … … 80 82 81 83 $this->tpl_name = $objCustomer->getValue('name01'); 82 $this->arrForm = $ this->objFormParam->getFormParamList();84 $this->arrForm = $objFormParam->getFormParamList(); 83 85 } 84 86 … … 98 100 * @return void 99 101 */ 100 function lfInitParam( ) {101 $ this->objFormParam->addParam('メールアドレス', 'email_mobile', MTEXT_LEN, 'a',102 function lfInitParam(&$objFormParam) { 103 $objFormParam->addParam('メールアドレス', 'email_mobile', MTEXT_LEN, 'a', 102 104 array('NO_SPTAB', 'EXIST_CHECK', 'MAX_LENGTH_CHECK', 'CHANGE_LOWER', 'EMAIL_CHAR_CHECK', 'EMAIL_CHECK', 'MOBILE_EMAIL_CHECK')); 103 105 } 104 106 105 107 /** 106 * lfCheckError108 * エラーチェックする 107 109 * 110 * @param mixed $objFormParam 108 111 * @param mixed $objCustomer 109 * @access p ublic110 * @return void112 * @access private 113 * @return array エラー情報の配列 111 114 */ 112 function lfCheckError(&$obj Customer) {113 $ arrRet = $this->objFormParam->getHashArray();114 $objErr = new SC_CheckError( $arrRet);115 $objErr->arrErr = $ this->objFormParam->checkError();115 function lfCheckError(&$objFormParam) { 116 $objFormParam->convParam(); 117 $objErr = new SC_CheckError(); 118 $objErr->arrErr = $objFormParam->checkError(); 116 119 117 120 $objErr->doFunc(array("メールアドレス", "email_mobile"), array("CHECK_REGIST_CUSTOMER_EMAIL")); … … 121 124 122 125 /** 123 * lfRegister124 126 * 127 * 携帯メールアドレスが登録されていないユーザーに携帯アドレスを登録する 128 * 129 * 登録完了後にsessionのemail_mobileを更新する 130 * 131 * @param mixed $objFormParam 125 132 * @param mixed $objCustomer 126 * @access p ublic133 * @access private 127 134 * @return void 128 135 */ 129 function lfRegister(&$objCustomer) { 130 $customer_id = $objCustomer->getValue('customer_id'); 131 $email_mobile = strtolower($this->objFormParam->getValue('email_mobile')); 132 133 $objQuery = new SC_Query(); 134 $objQuery->update('dtb_customer', array('email_mobile' => $email_mobile), 'customer_id = ?', array($customer_id)); 136 function lfRegistEmailMobile($email_mobile, $customer_id) { 137 $objQuery = SC_Query::getSingletonInstance(); 138 $objQuery->update('dtb_customer', 139 array('email_mobile' => $email_mobile), 140 'customer_id = ?', array($customer_id)); 135 141 136 142 $objCustomer->setValue('email_mobile', $email_mobile);
Note: See TracChangeset
for help on using the changeset viewer.