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