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

Revision 20490, 3.7 KB checked in by shutta, 13 years ago (diff)

SC_Customerクラスのclass_extends対応

  • Property svn:eol-style set to LF
  • Property svn:keywords set to Id
  • 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_EX_REALDIR . "page_extends/mypage/LC_Page_AbstractMypage_Ex.php");
26
27/**
28 * 購入履歴 のページクラス.
29 *
30 * @package Page
31 * @author LOCKON CO.,LTD.
32 * @version $Id$
33 */
34class LC_Page_Mypage_History extends LC_Page_AbstractMypage_Ex {
35
36    // }}}
37    // {{{ functions
38
39    /**
40     * Page を初期化する.
41     *
42     * @return void
43     */
44    function init() {
45        parent::init();
46        $this->tpl_mypageno     = 'index';
47        $this->tpl_subtitle     = '購入履歴詳細';
48        $this->httpCacheControl('nocache');
49
50        $masterData             = new SC_DB_MasterData_Ex();
51        $this->arrMAILTEMPLATE  = $masterData->getMasterData("mtb_mail_template");
52        $this->arrPref          = $masterData->getMasterData('mtb_pref');
53   }
54
55    /**
56     * Page のプロセス.
57     *
58     * @return void
59     */
60    function process() {
61        parent::process();
62    }
63
64    /**
65     * Page のAction.
66     *
67     * @return void
68     */
69    function action() {
70        $objCustomer    = new SC_Customer_Ex();
71        $objDb          = new SC_Helper_DB_Ex();
72        $objPurchase = new SC_Helper_Purchase_Ex();
73
74        if (!SC_Utils_Ex::sfIsInt($_GET['order_id'])) {
75            SC_Utils_Ex::sfDispSiteError(CUSTOMER_ERROR);
76        }
77
78        $order_id        = $_GET['order_id'];
79
80        //受注データの取得
81        $this->tpl_arrOrderData = $objPurchase->getOrder($order_id, $objCustomer->getValue('customer_id'));
82
83        if (empty($this->tpl_arrOrderData)){
84            SC_Utils_Ex::sfDispSiteError(CUSTOMER_ERROR);
85        }
86
87        $this->arrShipping      = $objPurchase->getShippings($order_id);
88
89        $this->isMultiple       = count($this->arrShipping) > 1;
90        // 支払い方法の取得
91        $this->arrPayment       = $objDb->sfGetIDValueList("dtb_payment", "payment_id", "payment_method");
92        // FIXME お届け時間の取得
93        //$this->arrDelivTime     = $objPurchase->getDelivTime($this->tpl_arrOrderData['deliv_id']);
94        // 受注商品明細の取得
95        $this->tpl_arrOrderDetail = $objPurchase->getOrderDetail($order_id);
96        // 受注メール送信履歴の取得
97        $this->tpl_arrMailHistory = $this->lfGetMailHistory($order_id);
98
99    }
100
101    /**
102     * デストラクタ.
103     *
104     * @return void
105     */
106    function destroy() {
107        parent::destroy();
108    }
109
110    /**
111     * 受注メール送信履歴の取得
112     *
113     * @param integer $order_id 注文番号
114     * @return array 受注メール送信履歴の内容
115     */
116    function lfGetMailHistory($order_id) {
117        $objQuery   =& SC_Query::getSingletonInstance();
118        $col        = 'send_date, subject, template_id, send_id';
119        $where      = 'order_id = ?';
120        $objQuery->setOrder('send_date DESC');
121        return $objQuery->select($col, 'dtb_mail_history', $where, array($order_id));
122    }
123}
Note: See TracBrowser for help on using the repository browser.