source: branches/version-2_5-dev/data/class/pages/mypage/LC_Page_Mypage_Refusal.php @ 19803

Revision 19803, 5.9 KB checked in by Seasoft, 13 years ago (diff)

#834(パラメータの定数名に「URL」を含むにもかかわらず、パスのみのものがある)

  • 一斉置換前の現状記録のためのコミット

#628(未使用処理・定義などの削除)

  • Property svn:eol-style set to LF
  • Property svn:keywords set to Id Revision Date
  • 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-2010 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_FILE_PATH . "pages/LC_Page.php");
26
27/**
28 * 退会手続き のページクラス.
29 *
30 * @package Page
31 * @author LOCKON CO.,LTD.
32 * @version $Id$
33 */
34class LC_Page_Mypage_Refusal extends LC_Page {
35
36    // }}}
37    // {{{ functions
38
39    /**
40     * Page を初期化する.
41     *
42     * @return void
43     */
44    function init() {
45        parent::init();
46        $this->tpl_title = 'MYページ';
47        $this->tpl_subtitle = '退会手続き(入力ページ)';
48        $this->tpl_navi = TEMPLATE_DIR . 'mypage/navi.tpl';
49        $this->tpl_mainno = 'mypage';
50        $this->tpl_mypageno = 'refusal';
51    }
52
53    /**
54     * Page のプロセス.
55     *
56     * @return void
57     */
58    function process() {
59        parent::process();
60        $this->action();
61        $this->sendResponse();
62    }
63
64    /**
65     * Page のAction.
66     *
67     * @return void
68     */
69    function action() {
70        //$objView = new SC_SiteView();
71        $objCustomer = new SC_Customer();
72        $objQuery = new SC_Query();
73        $objSiteSess = new SC_SiteSession();
74       
75        // 退会判定用情報の取得
76        $this->tpl_login = $objCustomer->isLoginSuccess();
77
78        //ログイン判定
79        if (!$objCustomer->isLoginSuccess()){
80            SC_Utils_Ex::sfDispSiteError(CUSTOMER_ERROR);
81        }else {
82            //マイページトップ顧客情報表示用
83            $this->CustomerName1 = $objCustomer->getvalue('name01');
84            $this->CustomerName2 = $objCustomer->getvalue('name02');
85            $this->CustomerPoint = $objCustomer->getvalue('point');
86        }
87
88        if (!isset($_POST['mode'])) $_POST['mode'] = "";
89
90        switch ($_POST['mode']){
91        case 'confirm':
92
93            $this->tpl_mainpage = TEMPLATE_DIR . 'mypage/refusal_confirm.tpl';
94            $this->tpl_subtitle = '退会手続き(確認ページ)';
95
96            // 確認ページを経由したことを登録
97            $objSiteSess->setRegistFlag();
98            // hiddenにuniqidを埋め込む
99            $this->tpl_uniqid = $objSiteSess->getUniqId();
100
101            break;
102
103        case 'complete':
104            // 正しい遷移かどうかをチェック
105            $this->lfIsValidMovement($objSiteSess);
106
107            //会員削除
108            $objQuery->exec("UPDATE dtb_customer SET del_flg=1, update_date=now() WHERE customer_id=?", array($objCustomer->getValue('customer_id')));
109
110            $objCustomer->EndSession();
111            //完了ページへ
112            $this->objDisplay->redirect($this->getLocation("./refusal_complete.php"));
113            exit;
114        }
115
116        //$objView->assignobj($this);
117        //$objView->display(SITE_FRAME);
118    }
119
120    /**
121     * モバイルページを初期化する.
122     *
123     * @return void
124     */
125    function mobileInit() {
126        $this->init();
127        $this->tpl_mainpage = 'mypage/refusal.tpl';
128        $this->tpl_title = "MYページ/退会手続き(入力ページ)";
129
130    }
131
132    /**
133     * Page のプロセス(モバイル).
134     *
135     * @return void
136     */
137    function mobileProcess() {
138        parent::mobileProcess();
139        $this->mobileAction();
140        $this->sendResponse();
141    }
142
143    /**
144     * Page のAction(モバイル).
145     *
146     * @return void
147     */
148    function mobileAction() {
149
150        //$objView = new SC_MobileView();
151        $objCustomer = new SC_Customer();
152        $objQuery = new SC_Query();
153
154        //ログイン判定
155        if (!$objCustomer->isLoginSuccess(true)){
156            SC_Utils_Ex::sfDispSiteError(CUSTOMER_ERROR);
157        }else {
158            //マイページトップ顧客情報表示用
159            $this->CustomerName1 = $objCustomer->getvalue('name01');
160            $this->CustomerName2 = $objCustomer->getvalue('name02');
161            $this->CustomerPoint = $objCustomer->getvalue('point');
162        }
163
164        if (isset($_POST['no'])) {
165            $this->objDisplay->redirect($this->getLocation(DIR_INDEX_URL));
166            exit;
167        } elseif (isset($_POST['complete'])){
168            //会員削除
169            $objQuery->exec("UPDATE dtb_customer SET del_flg=1, update_date=now() WHERE customer_id=?", array($objCustomer->getValue('customer_id')));
170
171            $where = "email = ?";
172            $objCustomer->EndSession();
173            //完了ページへ
174            $this->objDisplay->redirect($this->getLocation("./refusal_complete.php"));
175            exit;
176        }
177
178        //$objView->assignobj($this);
179        //$objView->display(SITE_FRAME);
180    }
181
182    /**
183     * デストラクタ.
184     *
185     * @return void
186     */
187    function destroy() {
188        parent::destroy();
189    }
190
191    // 正しい遷移かどうかをチェック
192    function lfIsValidMovement(&$objSiteSess) {
193        // 確認ページからの遷移かどうかをチェック
194        SC_Utils_Ex::sfIsPrePage($objSiteSess);
195
196        // uniqid がPOSTされているかをチェック
197        $uniqid = $objSiteSess->getUniqId();
198        if ( !empty($_POST['uniqid']) && ($_POST['uniqid'] === $uniqid) ) {
199            return;
200        } else {
201            SC_Utils_Ex::sfDispSiteError(PAGE_ERROR, $objSiteSess);
202        }
203    }
204}
205?>
Note: See TracBrowser for help on using the repository browser.