source: branches/rel/html/mobile/mypage/history_detail.php @ 12157

Revision 12157, 3.0 KB checked in by uehara, 16 years ago (diff)
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.