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

Revision 19803, 5.3 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_HistoryDetail extends LC_Page {
35
36    // }}}
37    // {{{ functions
38
39    /**
40     * Page を初期化する.
41     *
42     * @return void
43     */
44    function init() {
45        parent::init();
46    }
47
48    /**
49     * Page のプロセス.
50     *
51     * @return void
52     */
53    function process() {
54        parent::process();
55        $this->action();
56        $this->sendResponse();
57    }
58
59    /**
60     * Page のAction.
61     *
62     * @return void
63     */
64    function action() {}
65
66    /**
67     * モバイルページを初期化する.
68     *
69     * @return void
70     */
71    function mobileInit() {
72        $this->init();
73        $this->tpl_mainpage = 'mypage/history_detail.tpl';
74        $this->tpl_title = 'MYページ';
75        $this->tpl_subtitle = '購入履歴詳細';
76    }
77
78    /**
79     * Page のプロセス(モバイル).
80     *
81     * @return void
82     */
83    function mobileProcess() {
84        parent::mobileProcess();
85        $this->mobileAction();
86        $this->sendResponse();
87    }
88
89    /**
90     * Page のAction(モバイル).
91     *
92     * @return void
93     */
94    function mobileAction() {
95
96        //$objView = new SC_MobileView();
97        $objQuery = new SC_Query();
98        $objCustomer = new SC_Customer();
99        $objDb = new SC_Helper_DB_Ex();
100
101
102        //不正アクセス判定
103        $from = "dtb_order";
104        $where = "del_flg = 0 AND customer_id = ? AND order_id = ? ";
105        $arrval = array($objCustomer->getValue('customer_id'), $_POST['order_id']);
106        //DBに情報があるか判定
107        $cnt = $objQuery->count($from, $where, $arrval);
108
109        //ログインしていない、またはDBに情報が無い場合
110        if (!$objCustomer->isLoginSuccess(true) or $cnt == 0){
111            SC_Utils_Ex::sfDispSiteError(CUSTOMER_ERROR);
112        } else {
113            //受注詳細データの取得
114            $this->arrDisp = $this->lfGetOrderData($_POST['order_id']);
115            // 支払い方法の取得
116            $this->arrPayment = $objDb->sfGetIDValueList("dtb_payment", "payment_id", "payment_method");
117            // お届け時間の取得
118            $arrRet = $objDb->sfGetDelivTime($this->arrDisp['payment_id']);
119            $this->arrDelivTime = SC_Utils_Ex::sfArrKeyValue($arrRet, 'time_id', 'deliv_time');
120
121            //マイページトップ顧客情報表示用
122            $this->CustomerName1 = $objCustomer->getvalue('name01');
123            $this->CustomerName2 = $objCustomer->getvalue('name02');
124            $this->CustomerPoint = $objCustomer->getvalue('point');
125        }
126
127        //$objView->assignobj($this);
128        //$objView->display(SITE_FRAME);
129    }
130
131    /**
132     * デストラクタ.
133     *
134     * @return void
135     */
136    function destroy() {
137        parent::destroy();
138    }
139
140
141    //受注詳細データの取得
142    function lfGetOrderData($order_id) {
143        //注文番号が数字であれば
144        if(SC_Utils_Ex::sfIsInt($order_id)) {
145            // DBから受注情報を読み込む
146            $objQuery = new SC_Query();
147            $col = "order_id, create_date, payment_id, subtotal, tax, use_point, add_point, discount, ";
148            $col .= "deliv_fee, charge, payment_total, deliv_name01, deliv_name02, deliv_kana01, deliv_kana02, ";
149            $col .= "deliv_zip01, deliv_zip02, deliv_pref, deliv_addr01, deliv_addr02, deliv_tel01, deliv_tel02, deliv_tel03, deliv_time_id, deliv_date ";
150            $from = "dtb_order";
151            $where = "order_id = ?";
152            $arrRet = $objQuery->select($col, $from, $where, array($order_id));
153            $arrOrder = $arrRet[0];
154            // 受注詳細データの取得
155            $arrRet = $this->lfGetOrderDetail($order_id);
156            $arrOrderDetail = SC_Utils_Ex::sfSwapArray($arrRet);
157            $arrData = array_merge($arrOrder, $arrOrderDetail);
158        }
159        return $arrData;
160    }
161
162    // 受注詳細データの取得
163    function lfGetOrderDetail($order_id) {
164        $objQuery = new SC_Query();
165        $col = "product_id, product_class_id, product_code, product_name, classcategory_name1, classcategory_name2, price, quantity, point_rate";
166        $where = "order_id = ?";
167        $objQuery->setOrder("product_class_id");
168        $arrRet = $objQuery->select($col, "dtb_order_detail", $where, array($order_id));
169        return $arrRet;
170    }
171}
172?>
Note: See TracBrowser for help on using the repository browser.