source: temp/branches/mobile/html/mypage/history.php @ 6080

Revision 6080, 3.0 KB checked in by naka, 16 years ago (diff)

* empty log message *

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
Line 
1<?php
2/*
3 * Copyright(c) 2000-2006 LOCKON CO.,LTD. All Rights Reserved.
4 *
5 * http://www.lockon.co.jp/
6 */
7
8require_once("../require.php");
9
10class LC_Page {
11    function LC_Page() {
12        $this->tpl_mainpage = USER_PATH . 'templates/mypage/history.tpl';
13        $this->tpl_title = "MY¥Ú¡¼¥¸/¹ØÆþÍúÎò¾ÜºÙ";
14        $this->tpl_navi = USER_PATH . 'templates/mypage/navi.tpl';
15        $this->tpl_mainno = 'mypage';
16        $this->tpl_mypageno = 'index';
17        session_cache_limiter('private-no-expire');
18    }
19}
20
21$objPage = new LC_Page();
22$objView = new SC_SiteView();
23$objQuery = new SC_Query();
24$objCustomer = new SC_Customer();
25
26// ¥ì¥¤¥¢¥¦¥È¥Ç¥¶¥¤¥ó¤ò¼èÆÀ
27$objPage = sfGetPageLayout($objPage, false, "mypage/index.php");
28
29//ÉÔÀµ¥¢¥¯¥»¥¹È½Äê
30$from = "dtb_order";
31$where = "del_flg = 0 AND customer_id = ? AND order_id = ? ";
32$arrval = array($objCustomer->getValue('customer_id'), $_POST['order_id']);
33//DB¤Ë¾ðÊ󤬤¢¤ë¤«È½Äê
34$cnt = $objQuery->count($from, $where, $arrval);
35//¥í¥°¥¤¥ó¤·¤Æ¤¤¤Ê¤¤¡¢¤Þ¤¿¤ÏDB¤Ë¾ðÊó¤¬Ìµ¤¤¾ì¹ç
36if (!$objCustomer->isLoginSuccess() || $cnt == 0){
37    sfDispSiteError(CUSTOMER_ERROR);
38} else {
39    //¼õÃí¾ÜºÙ¥Ç¡¼¥¿¤Î¼èÆÀ
40    $objPage->arrDisp = lfGetOrderData($_POST['order_id']);
41    // »Ùʧ¤¤ÊýË¡¤Î¼èÆÀ
42    $objPage->arrPayment = sfGetIDValueList("dtb_payment", "payment_id", "payment_method");
43    // ÇÛÁ÷»þ´Ö¤Î¼èÆÀ
44    $arrRet = sfGetDelivTime($objPage->arrDisp['payment_id']);
45    $objPage->arrDelivTime = sfArrKeyValue($arrRet, 'time_id', 'deliv_time');
46
47    //¥Þ¥¤¥Ú¡¼¥¸¥È¥Ã¥×¸ÜµÒ¾ðÊóɽ¼¨ÍÑ
48    $objPage->CustomerName1 = $objCustomer->getvalue('name01');
49    $objPage->CustomerName2 = $objCustomer->getvalue('name02');
50    $objPage->CustomerPoint = $objCustomer->getvalue('point');
51}
52
53$objView->assignobj($objPage);
54$objView->display(SITE_FRAME);
55//-----------------------------------------------------------------------------------------------------------------------------------
56
57//¼õÃí¾ÜºÙ¥Ç¡¼¥¿¤Î¼èÆÀ
58function lfGetOrderData($order_id) {
59    //¼õÃíÈֹ椬¿ô»ú¤Ç¤¢¤ì¤Ð
60    if(sfIsInt($order_id)) {
61        // DB¤«¤é¼õÃí¾ðÊó¤òÆɤ߹þ¤à
62        $objQuery = new SC_Query();
63        $col = "order_id, create_date, payment_id, subtotal, tax, use_point, add_point, discount, ";
64        $col .= "deliv_fee, charge, payment_total, deliv_name01, deliv_name02, deliv_kana01, deliv_kana02, ";
65        $col .= "deliv_zip01, deliv_zip02, deliv_pref, deliv_addr01, deliv_addr02, deliv_tel01, deliv_tel02, deliv_tel03, deliv_time_id, deliv_date ";
66        $from = "dtb_order";
67        $where = "order_id = ?";
68        $arrRet = $objQuery->select($col, $from, $where, array($order_id));
69        $arrOrder = $arrRet[0];
70        // ¼õÃí¾ÜºÙ¥Ç¡¼¥¿¤Î¼èÆÀ
71        $arrRet = lfGetOrderDetail($order_id);
72        $arrOrderDetail = sfSwapArray($arrRet);
73        $arrData = array_merge($arrOrder, $arrOrderDetail);
74    }
75    return $arrData;
76}
77
78// ¼õÃí¾ÜºÙ¥Ç¡¼¥¿¤Î¼èÆÀ
79function lfGetOrderDetail($order_id) {
80    $objQuery = new SC_Query();
81    $col = "product_id, product_code, product_name, classcategory_name1, classcategory_name2, price, quantity, point_rate";
82    $where = "order_id = ?";
83    $objQuery->setorder("classcategory_id1, classcategory_id2");
84    $arrRet = $objQuery->select($col, "dtb_order_detail", $where, array($order_id));
85    return $arrRet;
86}
87
88?>
Note: See TracBrowser for help on using the repository browser.