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

Revision 18824, 4.8 KB checked in by eccuore, 11 years ago (diff)

#792(ダウンロード販売機能) vw_download_class削除、product_class_id対応(規格構成変更と並行作業中なので、作業途中の部分有)

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