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

Revision 19912, 4.8 KB checked in by nanasess, 13 years ago (diff)

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

  • モジュール連携用のコードを削除

#843(複数配送先の指定)

  • 受注編集画面を修正

#642(共通ロジックの機能向上)

  • SC_Utils::sfIsPrePage(), SC_Utils::sfCheckNormalAccess() を削除

#631(テーブル定義の改良)

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