[16070] | 1 | <?php |
---|
| 2 | /* |
---|
[16582] | 3 | * This file is part of EC-CUBE |
---|
| 4 | * |
---|
[18701] | 5 | * Copyright(c) 2000-2010 LOCKON CO.,LTD. All Rights Reserved. |
---|
[16070] | 6 | * |
---|
| 7 | * http://www.lockon.co.jp/ |
---|
[16582] | 8 | * |
---|
| 9 | * This program is free software; you can redistribute it and/or |
---|
| 10 | * modify it under the terms of the GNU General Public License |
---|
| 11 | * as published by the Free Software Foundation; either version 2 |
---|
| 12 | * of the License, or (at your option) any later version. |
---|
| 13 | * |
---|
| 14 | * This program is distributed in the hope that it will be useful, |
---|
| 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
| 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
| 17 | * GNU General Public License for more details. |
---|
| 18 | * |
---|
| 19 | * You should have received a copy of the GNU General Public License |
---|
| 20 | * along with this program; if not, write to the Free Software |
---|
| 21 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
---|
[16070] | 22 | */ |
---|
| 23 | |
---|
| 24 | // {{{ requires |
---|
[20162] | 25 | require_once(CLASS_EX_REALDIR . "page_extends/mypage/LC_Page_AbstractMypage_Ex.php"); |
---|
[16070] | 26 | |
---|
| 27 | /** |
---|
| 28 | * 登録内容変更 のページクラス. |
---|
| 29 | * |
---|
| 30 | * @package Page |
---|
| 31 | * @author LOCKON CO.,LTD. |
---|
| 32 | * @version $Id$ |
---|
| 33 | */ |
---|
[20162] | 34 | class LC_Page_Mypage_Change extends LC_Page_AbstractMypage_Ex { |
---|
[16070] | 35 | |
---|
[16369] | 36 | |
---|
[16070] | 37 | // }}} |
---|
| 38 | // {{{ functions |
---|
| 39 | |
---|
| 40 | /** |
---|
| 41 | * Page を初期化する. |
---|
| 42 | * |
---|
| 43 | * @return void |
---|
| 44 | */ |
---|
| 45 | function init() { |
---|
| 46 | parent::init(); |
---|
[17519] | 47 | $this->tpl_subtitle = '会員登録内容変更(入力ページ)'; |
---|
[16070] | 48 | $this->tpl_mypageno = 'change'; |
---|
| 49 | |
---|
[20147] | 50 | $masterData = new SC_DB_MasterData_Ex(); |
---|
| 51 | $this->arrReminder = $masterData->getMasterData("mtb_reminder"); |
---|
| 52 | $this->arrPref = $masterData->getMasterData('mtb_pref'); |
---|
| 53 | $this->arrJob = $masterData->getMasterData("mtb_job"); |
---|
[16070] | 54 | $this->arrMAILMAGATYPE = $masterData->getMasterData("mtb_mail_magazine_type"); |
---|
[20147] | 55 | $this->arrSex = $masterData->getMasterData("mtb_sex"); |
---|
[18187] | 56 | $this->httpCacheControl('nocache'); |
---|
[20041] | 57 | |
---|
[19892] | 58 | // 生年月日選択肢の取得 |
---|
[20477] | 59 | $objDate = new SC_Date(BIRTH_YEAR, date("Y",strtotime("now"))); |
---|
| 60 | $this->arrYear = $objDate->getYear('', START_BIRTH_YEAR, ''); |
---|
[20147] | 61 | $this->arrMonth = $objDate->getMonth(true); |
---|
| 62 | $this->arrDay = $objDate->getDay(true); |
---|
[16070] | 63 | } |
---|
| 64 | |
---|
| 65 | /** |
---|
| 66 | * Page のプロセス. |
---|
| 67 | * |
---|
| 68 | * @return void |
---|
| 69 | */ |
---|
| 70 | function process() { |
---|
[20147] | 71 | parent::process(); |
---|
[19661] | 72 | } |
---|
[20041] | 73 | |
---|
[19661] | 74 | /** |
---|
[19892] | 75 | * Page のプロセス |
---|
[19661] | 76 | * @return void |
---|
| 77 | */ |
---|
| 78 | function action() { |
---|
[18840] | 79 | $objCustomer = new SC_Customer(); |
---|
[20147] | 80 | $customer_id = $objCustomer->getValue('customer_id'); |
---|
[20041] | 81 | |
---|
[19892] | 82 | // mobile用(戻るボタンでの遷移かどうかを判定) |
---|
| 83 | if (!empty($_POST["return"])) { |
---|
| 84 | $_POST["mode"] = "return"; |
---|
[16070] | 85 | } |
---|
[20041] | 86 | |
---|
[19892] | 87 | // パラメータ管理クラス,パラメータ情報の初期化 |
---|
[20147] | 88 | $objFormParam = new SC_FormParam(); |
---|
| 89 | SC_Helper_Customer_Ex::sfCustomerMypageParam($objFormParam); |
---|
| 90 | $objFormParam->setParam($_POST); // POST値の取得 |
---|
[20041] | 91 | |
---|
[20147] | 92 | $this->arrForm = $objFormParam->getHashArray(); |
---|
[20041] | 93 | |
---|
[20147] | 94 | switch ($this->getMode()) { |
---|
| 95 | case 'confirm': |
---|
| 96 | //-- 確認 |
---|
| 97 | $this->arrErr = SC_Helper_Customer_Ex::sfCustomerMypageErrorCheck($objFormParam); |
---|
| 98 | // 入力エラーなし |
---|
| 99 | if(empty($this->arrErr)) { |
---|
| 100 | //パスワード表示 |
---|
| 101 | $this->passlen = SC_Utils_Ex::sfPassLen(strlen($this->arrForm['password'])); |
---|
[20041] | 102 | |
---|
[20147] | 103 | $this->tpl_mainpage = 'mypage/change_confirm.tpl'; |
---|
| 104 | $this->tpl_title = '会員登録(確認ページ)'; |
---|
[16234] | 105 | } |
---|
[20147] | 106 | break; |
---|
| 107 | case 'complete': |
---|
| 108 | //-- 会員登録と完了画面 |
---|
[20041] | 109 | |
---|
[20147] | 110 | // 会員情報の登録 |
---|
| 111 | $this->lfRegistCustomerData($objFormParam, $customer_id); |
---|
[20041] | 112 | |
---|
[20147] | 113 | // 完了ページに移動させる。 |
---|
| 114 | SC_Response_Ex::sendRedirect('change_complete.php'); |
---|
| 115 | break; |
---|
| 116 | case 'return': |
---|
| 117 | break; |
---|
| 118 | default: |
---|
| 119 | $this->arrForm = SC_Helper_Customer_Ex::sfGetCustomerData($customer_id); |
---|
| 120 | break; |
---|
[16234] | 121 | } |
---|
| 122 | } |
---|
| 123 | |
---|
| 124 | /** |
---|
[16070] | 125 | * デストラクタ. |
---|
| 126 | * |
---|
| 127 | * @return void |
---|
| 128 | */ |
---|
| 129 | function destroy() { |
---|
| 130 | parent::destroy(); |
---|
| 131 | } |
---|
| 132 | |
---|
[18839] | 133 | /** |
---|
[20147] | 134 | * 会員情報を登録する |
---|
[18839] | 135 | * |
---|
[20147] | 136 | * @param mixed $objFormParam |
---|
| 137 | * @param mixed $customer_id |
---|
| 138 | * @access private |
---|
| 139 | * @return void |
---|
[18839] | 140 | */ |
---|
[20147] | 141 | function lfRegistCustomerData(&$objFormParam, $customer_id) { |
---|
| 142 | $arrRet = $objFormParam->getHashArray(); |
---|
| 143 | $sqlval = $objFormParam->getDbArray(); |
---|
| 144 | $sqlval['birth'] = SC_Utils_Ex::sfGetTimestamp($arrRet['year'], $arrRet['month'], $arrRet['day']); |
---|
[20041] | 145 | |
---|
[20147] | 146 | SC_Helper_Customer_Ex::sfEditCustomerData($sqlval, $customer_id); |
---|
[16070] | 147 | } |
---|
| 148 | } |
---|