source: branches/beta/html/mobile/shopping/confirm.php @ 14899

Revision 14899, 3.5 KB checked in by kakinaka, 15 years ago (diff)

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

  • Property svn:eol-style set to native
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 = 'nonmember/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 = "";
72$module_id = "";
73if(sfColumnExists("dtb_payment", "memo01")){
74    // MEMO03¤ËÃͤ¬Æþ¤Ã¤Æ¤¤¤ë¾ì¹ç¤Ë¤Ï¡¢¥â¥¸¥å¡¼¥ëÄɲ䵤줿¤â¤Î¤È¤ß¤Ê¤¹
75    $sql = "SELECT module_id,memo03 FROM dtb_payment WHERE payment_id = ?";
76    $arrPayment = $objQuery->getall($sql, array($arrData['payment_id']));
77    $payment_type = $arrPayment[0]["memo03"];
78    $module_id =  $arrPayment[0]["module_id"];   
79}
80$objPage->payment_type = $payment_type;
81
82
83switch($_POST['mode']) {
84// Á°¤Î¥Ú¡¼¥¸¤ËÌá¤ë
85case 'return':
86    // Àµ¾ï¤Ê¿ä°Ü¤Ç¤¢¤ë¤³¤È¤òµ­Ï¿¤·¤Æ¤ª¤¯
87    $objSiteSess->setRegistFlag();
88    header("Location: " . gfAddSessionId(MOBILE_URL_SHOP_PAYMENT));
89    exit;
90    break;
91case 'confirm':
92    // ¤³¤Î»þÅÀ¤Ç¥ª¡¼¥À¡¼ID¤ò³ÎÊݤ·¤Æ¤ª¤¯¡Ê¥¯¥ì¥¸¥Ã¥È¡¢¥³¥ó¥Ó¥Ë·èºÑ¤ÇɬÍפʤ¿¤á¡Ë
93    // postgresql¤Èmysql¤È¤Ç½èÍý¤òʬ¤±¤ë
94    if (DB_TYPE == "pgsql") {
95        $order_id = $objQuery->nextval("dtb_order","order_id");
96    }elseif (DB_TYPE == "mysql") {
97        $order_id = $objQuery->get_auto_increment("dtb_order");
98    }
99    $arrData["order_id"] = $order_id;
100   
101    // ¥»¥Ã¥·¥ç¥ó¾ðÊó¤òÊÝ»ý
102    $arrData['session'] = serialize($_SESSION);
103   
104    // ½¸·×·ë²Ì¤ò¼õÃí°ì»þ¥Æ¡¼¥Ö¥ë¤ËÈ¿±Ç
105    sfRegistTempOrder($uniqid, $arrData);
106    // Àµ¾ï¤ËÅÐÏ¿¤µ¤ì¤¿¤³¤È¤òµ­Ï¿¤·¤Æ¤ª¤¯
107    $objSiteSess->setRegistFlag();
108   
109    // ·èºÑÊýË¡¤Ë¤è¤ê²èÌÌÀÚÂØ
110    if(!empty($module_id)) {
111        $_SESSION["payment_id"] = $arrData['payment_id'];
112        header("Location: " . gfAddSessionId(MOBILE_URL_SHOP_MODULE));
113    }else{
114        header("Location: " . gfAddSessionId(MOBILE_URL_SHOP_COMPLETE));
115    }
116    break;
117default:
118    break;
119}
120
121
122$objPage->arrData = $arrData;
123$objPage->arrInfo = $arrInfo;
124$objView->assignobj($objPage);
125$objView->display(SITE_FRAME);
126//--------------------------------------------------------------------------------------------------------------------------
127?>
Note: See TracBrowser for help on using the repository browser.