source: branches/feature-module-update/data/class/pages/mypage/LC_Page_Mypage_Order.php @ 16378

Revision 16378, 2.3 KB checked in by nanasess, 17 years ago (diff)

process() をモバイル用の関数に変更

  • 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
Line 
1<?php
2/*
3 * Copyright(c) 2000-2007 LOCKON CO.,LTD. All Rights Reserved.
4 *
5 * http://www.lockon.co.jp/
6 */
7
8// {{{ requires
9require_once(CLASS_PATH . "pages/LC_Page.php");
10
11/**
12 * 受注履歴からカート遷移 のページクラス.
13 *
14 * @package Page
15 * @author LOCKON CO.,LTD.
16 * @version $Id$
17 */
18class LC_Page_Mypage_Order extends LC_Page {
19
20    // }}}
21    // {{{ functions
22
23    /**
24     * Page を初期化する.
25     *
26     * @return void
27     */
28    function init() {
29        parent::init();
30    }
31
32    /**
33     * Page のプロセス.
34     *
35     * @return void
36     */
37    function process() {
38    }
39
40    /**
41     * モバイルページを初期化する.
42     *
43     * @return void
44     */
45    function mobileInit() {
46        $this->init();
47    }
48
49    /**
50     * Page のプロセス(モバイル).
51     *
52     * @return void
53     */
54    function mobileProcess() {
55        $objCustomer = new SC_Customer();
56        $objCartSess = new SC_CartSession();
57
58        //受注詳細データの取得
59        $arrDisp = $this->lfGetOrderDetail($_POST['order_id']);
60
61        //ログインしていない、またはDBに情報が無い場合
62        if (!$objCustomer->isLoginSuccess(true) or count($arrDisp) == 0){
63            SC_Utils_Ex::sfDispSiteError(CUSTOMER_ERROR, "", false, "", true);
64        }
65
66        for($num = 0; $num < count($arrDisp); $num++) {
67            $product_id = $arrDisp[$num]['product_id'];
68            $cate_id1 = $arrDisp[$num]['classcategory_id1'];
69            $cate_id2 = $arrDisp[$num]['classcategory_id2'];
70            $quantity = $arrDisp[$num]['quantity'];
71
72            $objCartSess->addProduct(array($product_id, $cate_id1, $cate_id2), $quantity);
73        }
74        $this->sendRedirect($this->getLocation(MOBILE_URL_CART_TOP), true);
75    }
76
77    /**
78     * デストラクタ.
79     *
80     * @return void
81     */
82    function destroy() {
83        parent::destroy();
84    }
85
86    // 受注詳細データの取得
87    function lfGetOrderDetail($order_id) {
88        $objQuery = new SC_Query();
89        $col = "product_id, classcategory_id1, classcategory_id2, quantity";
90        $where = "order_id = ?";
91        $objQuery->setorder("classcategory_id1, classcategory_id2");
92        $arrRet = $objQuery->select($col, "dtb_order_detail", $where, array($order_id));
93        return $arrRet;
94    }
95}
96?>
Note: See TracBrowser for help on using the repository browser.