source: branches/rel/html/mobile/cart/index.php @ 12157

Revision 12157, 3.4 KB checked in by uehara, 16 years ago (diff)
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    $arrRet = $objCartSess->getCartList();
51    $max = count($arrRet);
52    $cnt = 0;
53    for ($i = 0; $i < $max; $i++) {
54        // ¾¦Éʵ¬³Ê¾ðÊó¤Î¼èÆÀ
55        $arrData = sfGetProductsClass($arrRet[$i]['id']);
56        // DB¤Ë¸ºß¤¹¤ë¾¦ÉÊ
57        if($arrData != "") {
58            $cnt++;
59        }
60    }
61    // ¥«¡¼¥È¾¦Éʤ¬1·ï°Ê¾å¸ºß¤¹¤ë¾ì¹ç
62    if($cnt > 0) {
63        // Àµ¾ï¤ËÅÐÏ¿¤µ¤ì¤¿¤³¤È¤òµ­Ï¿¤·¤Æ¤ª¤¯
64        $objSiteSess->setRegistFlag();
65        $pre_uniqid = $objSiteSess->getUniqId();
66        // Ãíʸ°ì»þID¤Îȯ¹Ô
67        $objSiteSess->setUniqId();
68        $uniqid = $objSiteSess->getUniqId();
69        // ¥¨¥é¡¼¥ê¥È¥é¥¤¤Ê¤É¤Ç´û¤Ëuniqid¤¬Â¸ºß¤¹¤ë¾ì¹ç¤Ï¡¢ÀßÄê¤ò°ú¤­·Ñ¤°
70        if($pre_uniqid != "") {
71            $sqlval['order_temp_id'] = $uniqid;
72            $where = "order_temp_id = ?";
73            $objQuery = new SC_Query();
74            $objQuery->update("dtb_order_temp", $sqlval, $where, array($pre_uniqid));
75        }
76        // ¥«¡¼¥È¤ò¹ØÆþ¥â¡¼¥É¤ËÀßÄê
77        $objCartSess->saveCurrentCart($uniqid);
78        // ¹ØÆþ¥Ú¡¼¥¸¤Ø
79        header("Location: " . gfAddSessionId(MOBILE_URL_SHOP_TOP));
80        exit;
81    }
82    break;
83default:
84    break;
85}
86
87switch($_GET['mode']) {
88case 'up':
89    $objCartSess->upQuantity($_GET['cart_no']);
90    sfReload(session_name() . '=' . session_id());
91    break;
92case 'down':
93    $objCartSess->downQuantity($_GET['cart_no']);
94    sfReload(session_name() . '=' . session_id());
95    break;
96case 'delete':
97    $objCartSess->delProduct($_GET['cart_no']);
98    sfReload(session_name() . '=' . session_id());
99    break;
100}
101
102// ¥«¡¼¥È½¸·×½èÍý
103$objPage = sfTotalCart($objPage, $objCartSess, $arrInfo);
104$objPage->arrData = sfTotalConfirm($arrData, $objPage, $objCartSess, $arrInfo, $objCustomer);
105
106$objPage->arrInfo = $arrInfo;
107
108// ¥í¥°¥¤¥óȽÄê
109if($objCustomer->isLoginSuccess()) {
110    $objPage->tpl_login = true;
111    $objPage->tpl_user_point = $objCustomer->getValue('point');
112    $objPage->tpl_name = $objCustomer->getValue('name01');
113}
114
115// Á÷ÎÁ̵ÎÁ¤Þ¤Ç¤Î¶â³Û¤ò·×»»
116$tpl_deliv_free = $objPage->arrInfo['free_rule'] - $objPage->tpl_total_pretax;
117$objPage->tpl_deliv_free = $tpl_deliv_free;
118
119// Á°ÊǤÎURL¤ò¼èÆÀ
120$objPage->tpl_prev_url = $objCartSess->getPrevURL();
121
122$objView->assignobj($objPage);
123$objView->display(SITE_FRAME);
124//--------------------------------------------------------------------------------------------------------------------------
125?>
Note: See TracBrowser for help on using the repository browser.