source: temp/trunk/html/mypage/history.php @ 4608

Revision 4608, 2.9 KB checked in by kakinaka, 20 years ago (diff)

blank

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