source: branches/feature-module-update/html/mobile/mypage/history_detail.php @ 15532

Revision 15532, 3.2 KB checked in by nanasess, 15 years ago (diff)

svn:mime-type 修正

  • Property svn:keywords set to Id
  • Property svn:mime-type set to text/x-httpd-php; charset=UTF-8
Line 
1<?php
2/**
3 *
4 * Copyright(c) 2000-2007 LOCKON CO.,LTD. All Rights Reserved.
5 *
6 * http://www.lockon.co.jp/
7 *
8 *
9 * 履歴
10 */
11
12require_once("../require.php");
13
14class LC_Page {
15    function LC_Page() {
16        $this->tpl_mainpage = 'mypage/history_detail.tpl';
17        $this->tpl_title = "MYページ/購入履歴詳細";
18        session_cache_limiter('private-no-expire');
19    }
20}
21
22$objPage = new LC_Page();
23$objView = new SC_MobileView();
24$objQuery = new SC_Query();
25$objCustomer = new SC_Customer();
26
27// レイアウトデザインを取得
28$objPage = sfGetPageLayout($objPage, false, "mypage/index.php");
29
30//不正アクセス判定
31$from = "dtb_order";
32$where = "del_flg = 0 AND customer_id = ? AND order_id = ? ";
33$arrval = array($objCustomer->getValue('customer_id'), $_POST['order_id']);
34//DBに情報があるか判定
35$cnt = $objQuery->count($from, $where, $arrval);
36
37//ログインしていない、またはDBに情報が無い場合
38if (!$objCustomer->isLoginSuccess() or $cnt == 0){
39    sfDispSiteError(CUSTOMER_ERROR, "", false, "", true);
40} else {
41    //受注詳細データの取得
42    $objPage->arrDisp = lfGetOrderData($_POST['order_id']);
43    // 支払い方法の取得
44    $objPage->arrPayment = sfGetIDValueList("dtb_payment", "payment_id", "payment_method");
45    // 配送時間の取得
46    $arrRet = sfGetDelivTime($objPage->arrDisp['payment_id']);
47    $objPage->arrDelivTime = sfArrKeyValue($arrRet, 'time_id', 'deliv_time');
48
49    //マイページトップ顧客情報表示用
50    $objPage->CustomerName1 = $objCustomer->getvalue('name01');
51    $objPage->CustomerName2 = $objCustomer->getvalue('name02');
52    $objPage->CustomerPoint = $objCustomer->getvalue('point');
53}
54
55$objView->assignobj($objPage);
56$objView->display(SITE_FRAME);
57//-----------------------------------------------------------------------------------------------------------------------------------
58
59//受注詳細データの取得
60function lfGetOrderData($order_id) {
61    //受注番号が数字であれば
62    if(sfIsInt($order_id)) {
63        // DBから受注情報を読み込む
64        $objQuery = new SC_Query();
65        $col = "order_id, create_date, payment_id, subtotal, tax, use_point, add_point, discount, ";
66        $col .= "deliv_fee, charge, payment_total, deliv_name01, deliv_name02, deliv_kana01, deliv_kana02, ";
67        $col .= "deliv_zip01, deliv_zip02, deliv_pref, deliv_addr01, deliv_addr02, deliv_tel01, deliv_tel02, deliv_tel03, deliv_time_id, deliv_date ";
68        $from = "dtb_order";
69        $where = "order_id = ?";
70        $arrRet = $objQuery->select($col, $from, $where, array($order_id));
71        $arrOrder = $arrRet[0];
72        // 受注詳細データの取得
73        $arrRet = lfGetOrderDetail($order_id);
74        $arrOrderDetail = sfSwapArray($arrRet);
75        $arrData = array_merge($arrOrder, $arrOrderDetail);
76    }
77    return $arrData;
78}
79
80// 受注詳細データの取得
81function lfGetOrderDetail($order_id) {
82    $objQuery = new SC_Query();
83    $col = "product_id, product_code, product_name, classcategory_name1, classcategory_name2, price, quantity, point_rate";
84    $where = "order_id = ?";
85    $objQuery->setorder("classcategory_id1, classcategory_id2");
86    $arrRet = $objQuery->select($col, "dtb_order_detail", $where, array($order_id));
87    return $arrRet;
88}
89
90?>
Note: See TracBrowser for help on using the repository browser.