source: temp/trunk/html/cart/index.php @ 2314

Revision 2314, 2.8 KB checked in by kakinaka, 20 years ago (diff)

blank

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
Line 
1<?php
2
3require_once("../require.php");
4
5class LC_Page {
6    var $arrSession;
7    var $arrProductsClass;
8    var $tpl_total_pretax;
9    var $tpl_total_tax;
10    var $tpl_total_point;
11    var $tpl_message;
12    function LC_Page() {
13        /** ɬ¤º»ØÄꤹ¤ë **/
14        $this->tpl_css = '/css/layout/cartin/index.css';    // ¥á¥¤¥óCSS¥Ñ¥¹
15        /** ɬ¤º»ØÄꤹ¤ë **/
16        $this->tpl_mainpage = 'cart/index.tpl';     // ¥á¥¤¥ó¥Æ¥ó¥×¥ì¡¼¥È
17        $this->tpl_title = "¥«¥´¤ÎÃæ¤ò¸«¤ë";
18    }
19}
20
21$objPage = new LC_Page();
22$objView = new SC_SiteView();
23$objCartSess = new SC_CartSession();
24$objSiteSess = new SC_SiteSession();
25$objSiteInfo = new SC_SiteInfo();
26$objCustomer = new SC_Customer();
27// ´ðËܾðÊó¤Î¼èÆÀ
28$arrInfo = $objSiteInfo->data;
29
30// ¾¦ÉÊ¹ØÆþÃæ¤Ë¥«¡¼¥ÈÆâÍÆ¤¬Êѹ¹¤µ¤ì¤¿¡£
31if($objCartSess->getCancelPurchase()) {
32    $objPage->tpl_message = "¾¦ÉÊ¹ØÆþÃæ¤Ë¥«¡¼¥ÈÆâÍÆ¤¬Êѹ¹¤µ¤ì¤Þ¤·¤¿¤Î¤Ç¡¢¤ª¼ê¿ô¤Ç¤¹¤¬¹ØÆþ¼ê³¤­¤ò¤ä¤êľ¤·¤Æ²¼¤µ¤¤¡£";
33}
34
35switch($_POST['mode']) {
36case 'up':
37    $objCartSess->upQuantity($_POST['cart_no']);
38    sfReload();
39    break;
40case 'down':
41    $objCartSess->downQuantity($_POST['cart_no']);
42    sfReload();
43    break;
44case 'delete':
45    $objCartSess->delProduct($_POST['cart_no']);
46    sfReload();
47    break;
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: " . sfTrimURL(SSL_URL) . URL_SHOP_TOP);       
80    }
81    break;
82default:
83    break;
84}
85
86// ¥«¡¼¥È½¸·×½èÍý
87$objPage = sfTotalCart($objPage, $objCartSess, $arrInfo);
88$objPage->arrData = sfTotalConfirm($arrData, $objPage, $objCartSess, $arrInfo, $objCustomer);
89$objPage->arrInfo = $arrInfo;
90
91// ¥í¥°¥¤¥óȽÄê
92if($objCustomer->isLoginSuccess()) {
93    $objPage->tpl_login = true;
94    $objPage->tpl_user_point = $objCustomer->getValue('point');
95    $objPage->tpl_name = $objCustomer->getValue('name01');
96}
97
98// Á÷ÎÁ̵ÎÁ¤Þ¤Ç¤Î¶â³Û¤ò·×»»
99$tpl_deliv_free = $objPage->arrInfo['free_rule'] - $objPage->tpl_total_pretax;
100$objPage->tpl_deliv_free = $tpl_deliv_free;
101
102$objView->assignobj($objPage);
103$objView->display(SITE_FRAME);
104//--------------------------------------------------------------------------------------------------------------------------
105?>
Note: See TracBrowser for help on using the repository browser.