source: branches/rel/html/mobile/shopping/confirm.php @ 14898

Revision 14898, 3.6 KB checked in by kakinaka, 15 years ago (diff)

dtb_order_temp に セッション情報を保持するように修正

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
10require_once("../require.php");
11
12class LC_Page {
13    var $arrSession;
14    var $tpl_mode;
15    var $tpl_total_deliv_fee;
16    function LC_Page() {
17        $this->tpl_mainpage = 'shopping/confirm.tpl';
18        $this->tpl_css = '/css/layout/shopping/confirm.css';
19        $this->tpl_title = "¤´ÆþÎÏÆâÍƤΤ´³Îǧ";
20        global $arrPref;
21        $this->arrPref = $arrPref;
22        global $arrSex;
23        $this->arrSex = $arrSex;
24        global $arrMAILMAGATYPE;
25        $this->arrMAILMAGATYPE = $arrMAILMAGATYPE;
26        global $arrReminder;
27        $this->arrReminder = $arrReminder;
28        /*
29         session_start»þ¤Îno-cache¥Ø¥Ã¥À¡¼¤òÍÞÀ©¤¹¤ë¤³¤È¤Ç
30         ¡ÖÌá¤ë¡×¥Ü¥¿¥ó»ÈÍÑ»þ¤ÎÍ­¸ú´ü¸ÂÀÚ¤ìɽ¼¨¤òÍÞÀ©¤¹¤ë¡£
31         private-no-expire:¥¯¥é¥¤¥¢¥ó¥È¤Î¥­¥ã¥Ã¥·¥å¤òµö²Ä¤¹¤ë¡£
32        */
33        session_cache_limiter('private-no-expire');     
34
35    }
36}
37
38$objPage = new LC_Page();
39$objView = new SC_MobileView();
40$objCartSess = new SC_CartSession();
41$objSiteInfo = $objView->objSiteInfo;
42$objSiteSess = new SC_SiteSession();
43$objCustomer = new SC_Customer();
44$arrInfo = $objSiteInfo->data;
45$objQuery = new SC_Query();
46
47// Á°¤Î¥Ú¡¼¥¸¤ÇÀµ¤·¤¯ÅÐÏ¿¼ê³¤­¤¬¹Ô¤ï¤ì¤¿µ­Ï¿¤¬¤¢¤ë¤«È½Äê
48sfIsPrePage($objSiteSess, true);
49
50// ¥æ¡¼¥¶¥æ¥Ë¡¼¥¯ID¤Î¼èÆÀ¤È¹ØÆþ¾õÂÖ¤ÎÀµÅöÀ­¤ò¥Á¥§¥Ã¥¯
51$uniqid = sfCheckNormalAccess($objSiteSess, $objCartSess);
52$objPage->tpl_uniqid = $uniqid;
53
54// ¥«¡¼¥È½¸·×½èÍý
55$objPage = sfTotalCart($objPage, $objCartSess, $arrInfo);
56// °ì»þ¼õÃí¥Æ¡¼¥Ö¥ë¤ÎÆɹþ
57$arrData = sfGetOrderTemp($uniqid);
58// ¥«¡¼¥È½¸·×¤ò¸µ¤ËºÇ½ª·×»»
59$arrData = sfTotalConfirm($arrData, $objPage, $objCartSess, $arrInfo, $objCustomer);
60
61// ¥«¡¼ÅÔÆâ¤Î¾¦ÉʤÎÇä¤êÀÚ¤ì¥Á¥§¥Ã¥¯
62$objCartSess->chkSoldOut($objCartSess->getCartList());
63
64// ²ñ°÷¥í¥°¥¤¥ó¥Á¥§¥Ã¥¯
65if($objCustomer->isLoginSuccess()) {
66    $objPage->tpl_login = '1';
67    $objPage->tpl_user_point = $objCustomer->getValue('point');
68}
69
70// ·èºÑ¶èʬ¤ò¼èÆÀ¤¹¤ë
71$payment_type = "";
72if(sfColumnExists("dtb_payment", "memo01")){
73    // MEMO03¤ËÃͤ¬Æþ¤Ã¤Æ¤¤¤ë¾ì¹ç¤Ë¤Ï¡¢¥â¥¸¥å¡¼¥ëÄɲ䵤줿¤â¤Î¤È¤ß¤Ê¤¹
74    $sql = "SELECT memo03 FROM dtb_payment WHERE payment_id = ?";
75    $arrPayment = $objQuery->getall($sql, array($arrData['payment_id']));
76    $payment_type = $arrPayment[0]["memo03"];
77}
78$objPage->payment_type = $payment_type;
79
80
81switch($_POST['mode']) {
82// Á°¤Î¥Ú¡¼¥¸¤ËÌá¤ë
83case 'return':
84    // Àµ¾ï¤Ê¿ä°Ü¤Ç¤¢¤ë¤³¤È¤òµ­Ï¿¤·¤Æ¤ª¤¯
85    $objSiteSess->setRegistFlag();
86    header("Location: " . gfAddSessionId(MOBILE_URL_SHOP_PAYMENT));
87    exit;
88    break;
89case 'confirm':
90    // ¤³¤Î»þÅÀ¤Ç¥ª¡¼¥À¡¼ID¤ò³ÎÊݤ·¤Æ¤ª¤¯¡Ê¥¯¥ì¥¸¥Ã¥È¡¢¥³¥ó¥Ó¥Ë·èºÑ¤ÇɬÍפʤ¿¤á¡Ë
91    // postgresql¤Èmysql¤È¤Ç½èÍý¤òʬ¤±¤ë
92    if (DB_TYPE == "pgsql") {
93        $order_id = $objQuery->nextval("dtb_order","order_id");
94    }elseif (DB_TYPE == "mysql") {
95        $order_id = $objQuery->get_auto_increment("dtb_order");
96    }
97    $arrData["order_id"] = $order_id;
98   
99    // ¥»¥Ã¥·¥ç¥ó¾ðÊó¤òÊÝ»ý
100    $arrData['session'] = serialize($_SESSION);
101   
102    // ½¸·×·ë²Ì¤ò¼õÃí°ì»þ¥Æ¡¼¥Ö¥ë¤ËÈ¿±Ç
103    sfRegistTempOrder($uniqid, $arrData);
104    // Àµ¾ï¤ËÅÐÏ¿¤µ¤ì¤¿¤³¤È¤òµ­Ï¿¤·¤Æ¤ª¤¯
105    $objSiteSess->setRegistFlag();
106   
107    // ·èºÑÊýË¡¤Ë¤è¤ê²èÌÌÀÚÂØ
108    if($payment_type != "") {
109        $_SESSION["payment_id"] = $arrData['payment_id'];
110        header("Location: " . gfAddSessionId(MOBILE_URL_SHOP_MODULE));
111    }else{
112        header("Location: " . gfAddSessionId(MOBILE_URL_SHOP_COMPLETE));
113    }
114    break;
115default:
116    break;
117}
118
119
120$objPage->arrData = $arrData;
121$objPage->arrInfo = $arrInfo;
122$objView->assignobj($objPage);
123$objView->display(SITE_FRAME);
124//--------------------------------------------------------------------------------------------------------------------------
125?>
Note: See TracBrowser for help on using the repository browser.