source: branches/version-2_11-dev/data/class/pages/mypage/LC_Page_Mypage_Change.php @ 20970

Revision 20970, 4.6 KB checked in by Seasoft, 10 years ago (diff)

#1288 (「-er」カタカナ表記の統一)

  • 現状で混在が発生しているもののみ改修。
  • Property svn:eol-style set to LF
  • Property svn:keywords set to Id
  • Property svn:mime-type set to text/x-httpd-php; charset=UTF-8
Line 
1<?php
2/*
3 * This file is part of EC-CUBE
4 *
5 * Copyright(c) 2000-2011 LOCKON CO.,LTD. All Rights Reserved.
6 *
7 * http://www.lockon.co.jp/
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.
22 */
23
24// {{{ requires
25require_once CLASS_EX_REALDIR . 'page_extends/mypage/LC_Page_AbstractMypage_Ex.php';
26
27/**
28 * 登録内容変更 のページクラス.
29 *
30 * @package Page
31 * @author LOCKON CO.,LTD.
32 * @version $Id$
33 */
34class LC_Page_Mypage_Change extends LC_Page_AbstractMypage_Ex {
35
36    // }}}
37    // {{{ functions
38
39    /**
40     * Page を初期化する.
41     *
42     * @return void
43     */
44    function init() {
45        parent::init();
46        $this->tpl_subtitle = '会員登録内容変更(入力ページ)';
47        $this->tpl_mypageno = 'change';
48
49        $masterData         = new SC_DB_MasterData_Ex();
50        $this->arrReminder  = $masterData->getMasterData("mtb_reminder");
51        $this->arrPref      = $masterData->getMasterData('mtb_pref');
52        $this->arrJob       = $masterData->getMasterData("mtb_job");
53        $this->arrMAILMAGATYPE = $masterData->getMasterData("mtb_mail_magazine_type");
54        $this->arrSex       = $masterData->getMasterData("mtb_sex");
55        $this->httpCacheControl('nocache');
56
57        // 生年月日選択肢の取得
58        $objDate            = new SC_Date_Ex(BIRTH_YEAR, date('Y',strtotime('now')));
59        $this->arrYear      = $objDate->getYear('', START_BIRTH_YEAR, '');
60        $this->arrMonth     = $objDate->getMonth(true);
61        $this->arrDay       = $objDate->getDay(true);
62    }
63
64    /**
65     * Page のプロセス.
66     *
67     * @return void
68     */
69    function process() {
70        parent::process();
71    }
72
73    /**
74     * Page のプロセス
75     * @return void
76     */
77    function action() {
78        $objCustomer = new SC_Customer_Ex();
79        $customer_id = $objCustomer->getValue('customer_id');
80
81        // mobile用(戻るボタンでの遷移かどうかを判定)
82        if (!empty($_POST['return'])) {
83            $_POST['mode'] = 'return';
84        }
85
86        // パラメーター管理クラス,パラメーター情報の初期化
87        $objFormParam = new SC_FormParam_Ex();
88        SC_Helper_Customer_Ex::sfCustomerMypageParam($objFormParam);
89        $objFormParam->setParam($_POST);    // POST値の取得
90
91        $this->arrForm = $objFormParam->getHashArray();
92
93        switch ($this->getMode()) {
94        case 'confirm':
95        //-- 確認
96            $this->arrErr = SC_Helper_Customer_Ex::sfCustomerMypageErrorCheck($objFormParam);
97            // 入力エラーなし
98            if(empty($this->arrErr)) {
99                //パスワード表示
100                $this->passlen      = SC_Utils_Ex::sfPassLen(strlen($this->arrForm['password']));
101
102                $this->tpl_mainpage = 'mypage/change_confirm.tpl';
103                $this->tpl_title    = '会員登録(確認ページ)';
104            }
105            break;
106        case 'complete':
107            //-- 会員登録と完了画面
108
109            // 会員情報の登録
110            $this->lfRegistCustomerData($objFormParam, $customer_id);
111
112            // 完了ページに移動させる。
113            SC_Response_Ex::sendRedirect('change_complete.php');
114            break;
115        case 'return':
116            break;
117        default:
118            $this->arrForm = SC_Helper_Customer_Ex::sfGetCustomerData($customer_id);
119            break;
120        }
121    }
122
123    /**
124     * デストラクタ.
125     *
126     * @return void
127     */
128    function destroy() {
129        parent::destroy();
130    }
131
132    /**
133     *  会員情報を登録する
134     *
135     * @param mixed $objFormParam
136     * @param mixed $customer_id
137     * @access private
138     * @return void
139     */
140    function lfRegistCustomerData(&$objFormParam, $customer_id) {
141        $arrRet             = $objFormParam->getHashArray();
142        $sqlval             = $objFormParam->getDbArray();
143        $sqlval['birth']    = SC_Utils_Ex::sfGetTimestamp($arrRet['year'], $arrRet['month'], $arrRet['day']);
144
145        SC_Helper_Customer_Ex::sfEditCustomerData($sqlval, $customer_id);
146    }
147}
Note: See TracBrowser for help on using the repository browser.