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

Revision 19782, 6.0 KB checked in by nanasess, 13 years ago (diff)

#748(モバイル/スマートフォンのデザイン管理)

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