source: branches/beta/html/shopping/confirm.php @ 17018

Revision 17018, 3.9 KB checked in by adachi, 14 years ago (diff)

同じ記述が2つあったため修正

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