source: branches/feature-module-paygent/html/mobile/cart/index.php @ 15162

Revision 15162, 3.3 KB checked in by naka, 17 years ago (diff)

ペイジェント決済モジュール

  • 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 */
9require_once("../require.php");
10
11class LC_Page {
12    var $arrSession;
13    var $arrProductsClass;
14    var $tpl_total_pretax;
15    var $tpl_total_tax;
16    var $tpl_total_point;
17    var $tpl_message;
18    function LC_Page() {
19        /** ɬ¤º»ØÄꤹ¤ë **/
20        $this->tpl_css = '/css/layout/cartin/index.css';    // ¥á¥¤¥óCSS¥Ñ¥¹
21        /** ɬ¤º»ØÄꤹ¤ë **/
22        $this->tpl_mainpage = 'cart/index.tpl';     // ¥á¥¤¥ó¥Æ¥ó¥×¥ì¡¼¥È
23        $this->tpl_title = "Ž¶ŽºŽÞ¤ÎÃæ¤ò¸«¤ë";
24    }
25}
26
27// Ç㤤ʪ¤ò³¤±¤ë¾ì¹ç
28if($_REQUEST['continue']) {
29    header("Location: " . gfAddSessionId(MOBILE_URL_SITE_TOP) );
30    exit;
31}
32
33$objPage = new LC_Page();
34$objView = new SC_MobileView(false);
35$objCartSess = new SC_CartSession("", false);
36$objSiteSess = new SC_SiteSession();
37$objSiteInfo = $objView->objSiteInfo;
38$objCustomer = new SC_Customer();
39// ´ðËܾðÊó¤Î¼èÆÀ
40$arrInfo = $objSiteInfo->data;
41
42// ¾¦ÉʹØÆþÃæ¤Ë¥«¡¼¥ÈÆâÍƤ¬Êѹ¹¤µ¤ì¤¿¡£
43if($objCartSess->getCancelPurchase()) {
44    $objPage->tpl_message = "¾¦ÉʹØÆþÃæ¤ËŽ¶Ž°ŽÄÆâÍƤ¬Êѹ¹¤µ¤ì¤Þ¤·¤¿¤Î¤ÇŽ¤¤ª¼ê¿ô¤Ç¤¹¤¬¹ØÆþ¼ê³¤­¤ò¤ä¤êľ¤·¤Æ²¼¤µ¤¤Ž¡";
45}
46
47switch($_POST['mode']) {
48case 'confirm':
49   
50    // ¥«¡¼¥ÈÆâ¾ðÊó¤Î¼èÆÀ
51    $arrRet = $objCartSess->getCartList();
52    $max = count($arrRet);
53    $cnt = 0;
54    for ($i = 0; $i < $max; $i++) {
55        // ¾¦Éʵ¬³Ê¾ðÊó¤Î¼èÆÀ
56        $arrData = sfGetProductsClass($arrRet[$i]['id']);
57        // DB¤Ë¸ºß¤¹¤ë¾¦ÉÊ
58        if($arrData != "") {
59            $cnt++;
60        }
61    }
62    // ¥«¡¼¥È¾¦Éʤ¬1·ï°Ê¾å¸ºß¤¹¤ë¾ì¹ç
63    if($cnt > 0) {
64        // Àµ¾ï¤ËÅÐÏ¿¤µ¤ì¤¿¤³¤È¤òµ­Ï¿¤·¤Æ¤ª¤¯
65        $objSiteSess->setRegistFlag();
66        $pre_uniqid = $objSiteSess->getUniqId();
67        // Ãíʸ°ì»þID¤Îȯ¹Ô
68        $objSiteSess->setUniqId();
69        $uniqid = $objSiteSess->getUniqId();
70        // ¥¨¥é¡¼¥ê¥È¥é¥¤¤Ê¤É¤Ç´û¤Ëuniqid¤¬Â¸ºß¤¹¤ë¾ì¹ç¤Ï¡¢ÀßÄê¤ò°ú¤­·Ñ¤°
71        if($pre_uniqid != "") {
72            $sqlval['order_temp_id'] = $uniqid;
73            $where = "order_temp_id = ?";
74            $objQuery = new SC_Query();
75            $objQuery->update("dtb_order_temp", $sqlval, $where, array($pre_uniqid));
76        }
77        // ¥«¡¼¥È¤ò¹ØÆþ¥â¡¼¥É¤ËÀßÄê
78        $objCartSess->saveCurrentCart($uniqid);
79        // ¹ØÆþ¥Ú¡¼¥¸¤Ø
80        header("Location: " . gfAddSessionId(MOBILE_URL_SHOP_TOP));
81        exit;
82    }
83    break;
84default:
85    break;
86}
87
88switch($_GET['mode']) {
89case 'up':
90    $objCartSess->upQuantity($_GET['cart_no']);
91    sfReload(session_name() . '=' . session_id());
92    break;
93case 'down':
94    $objCartSess->downQuantity($_GET['cart_no']);
95    sfReload(session_name() . '=' . session_id());
96    break;
97case 'delete':
98    $objCartSess->delProduct($_GET['cart_no']);
99    sfReload(session_name() . '=' . session_id());
100    break;
101}
102
103// ¥«¡¼¥È½¸·×½èÍý
104$objPage = sfTotalCart($objPage, $objCartSess, $arrInfo);
105$objPage->arrData = sfTotalConfirm($arrData, $objPage, $objCartSess, $arrInfo, $objCustomer);
106
107$objPage->arrInfo = $arrInfo;
108
109// ¥í¥°¥¤¥óȽÄê
110if($objCustomer->isLoginSuccess()) {
111    $objPage->tpl_login = true;
112    $objPage->tpl_user_point = $objCustomer->getValue('point');
113    $objPage->tpl_name = $objCustomer->getValue('name01');
114}
115
116// Á÷ÎÁ̵ÎÁ¤Þ¤Ç¤Î¶â³Û¤ò·×»»
117$tpl_deliv_free = $objPage->arrInfo['free_rule'] - $objPage->tpl_total_pretax;
118$objPage->tpl_deliv_free = $tpl_deliv_free;
119
120// Á°ÊǤÎURL¤ò¼èÆÀ
121$objPage->tpl_prev_url = $objCartSess->getPrevURL();
122
123$objView->assignobj($objPage);
124$objView->display(SITE_FRAME);
125//--------------------------------------------------------------------------------------------------------------------------
126?>
Note: See TracBrowser for help on using the repository browser.