source: temp/branches/mobile/html/mobile/cart/index.php @ 11406

Revision 11406, 3.0 KB checked in by rebelt, 17 years ago (diff)

以下のモバイルサイト用ページ・機能を作成いたしました。

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