source: branches/feature-module-zeus/data/downloads/module/mdl_zeus/card.php @ 15418

Revision 15418, 4.9 KB checked in by naka, 17 years ago (diff)
Line 
1<?php
2/*
3 * Copyright(c) 2000-2007 LOCKON CO.,LTD. All Rights Reserved.
4 *
5 * http://www.lockon.co.jp/
6 */
7
8require_once(MODULE_PATH . "mdl_zero/mdl_zero.inc");
9
10class LC_Page {
11    function LC_Page() {
12        $this->tpl_mainpage = MODULE_PATH . 'mdl_zero/card_mobile.tpl';
13        /*
14         session_start»þ¤Îno-cache¥Ø¥Ã¥À¡¼¤òÍÞÀ©¤¹¤ë¤³¤È¤Ç
15         ¡ÖÌá¤ë¡×¥Ü¥¿¥ó»ÈÍÑ»þ¤ÎÍ­¸ú´ü¸ÂÀÚ¤ìɽ¼¨¤òÍÞÀ©¤¹¤ë¡£
16         private-no-expire:¥¯¥é¥¤¥¢¥ó¥È¤Î¥­¥ã¥Ã¥·¥å¤òµö²Ä¤¹¤ë¡£
17        */
18        session_cache_limiter('private-no-expire');     
19    }
20}
21
22$objPage = new LC_Page();
23$objView = new SC_MobileView();
24$objSiteSess = new SC_SiteSession();
25$objCartSess = new SC_CartSession();
26$objCampaignSess = new SC_CampaignSession();
27$objSiteInfo = $objView->objSiteInfo;
28$arrInfo = $objSiteInfo->data;
29
30// ¥æ¡¼¥¶¥æ¥Ë¡¼¥¯ID¤Î¼èÆÀ¤È¹ØÆþ¾õÂÖ¤ÎÀµÅöÀ­¤ò¥Á¥§¥Ã¥¯
31$uniqid = sfCheckNormalAccess($objSiteSess, $objCartSess);
32
33// ¥«¡¼¥È½¸·×½èÍý
34$objPage = sfTotalCart($objPage, $objCartSess, $arrInfo);
35
36// °ì»þ¼õÃí¥Æ¡¼¥Ö¥ë¤ÎÆɹþ
37$arrData = sfGetOrderTemp($uniqid);
38
39// ¥«¡¼¥È½¸·×¤ò¸µ¤ËºÇ½ª·×»»
40$arrData = sfTotalConfirm($arrData, $objPage, $objCartSess, $arrInfo);
41
42// »Ùʧ¤¤¾ðÊó¤ò¼èÆÀ
43$arrPayment = $objQuery->getall("SELECT module_id, memo01, memo02, memo03, memo04, memo05, memo06, memo07, memo08, memo09, memo10 FROM dtb_payment WHERE payment_id = ? ", array($arrData["payment_id"]));
44
45// ¥Ç¡¼¥¿Á÷¿®ÀèCGI ·ÈÂÓüËö¤Î¾ì¹ç¤Ï ·ÈÂÓÍѤËÈô¤Ð¤¹
46if(GC_MobileUserAgent::isMobile()) {
47    $objPage = lfSendMobileCredit($arrData, $arrPayment, $objPage);
48}else{
49    lfSendPcCredit($arrData, $arrPayment);
50}
51
52$objPage = lfSendMobileCredit($arrData, $arrPayment, $objPage);
53
54$objView->assignobj($objPage);
55$objView->display(SITE_FRAME);
56
57//---------------------------------------------------------------------------------------------------------------------------------------------------------
58
59// ¥Ç¡¼¥¿Á÷¿®½èÍý(PC)
60function lfSendPcCredit($arrData, $arrPayment){
61    global $objCartSess;
62    global $objSiteSess;
63 
64    // Á÷¿®¥Ç¡¼¥¿À¸À®
65    $arrSendData = array(
66        'clientip' => $arrPayment[0]["memo02"],                                                     // ÈÖÁÈ¥³¡¼¥É
67        'custom' => SEND_PARAM_CUSTOM ,                                                             // yes¸ÇÄê
68        'send' => SEND_PARAM_SEND,                                                                  // jpall¸ÇÄê
69        'money' => $arrData["payment_total"],                                                       // ¶â³Û
70        'usrtel' => $arrData["order_tel01"] . $arrData["order_tel02"] . $arrData["order_tel03"],    // ÅÅÏÃÈÖ¹æ
71        'usrmail' => $arrData["order_email"],                                                       // ¥á¡¼¥ë¥¢¥É¥ì¥¹
72        'sendid' => $arrData["order_temp_id"] . SEND_PARAM_DELIMITER . $arrData["payment_id"],      // ¥ª¡¼¥À¡¼TEMPID , payment_id
73        'sendpoint' => ECCUBE_PAYMENT                                                               // EC-CUBE
74    );
75   
76    // ¥»¥Ã¥·¥ç¥ó¥«¡¼¥ÈÆâ¤Î¾¦Éʤòºï½ü¤¹¤ë¡£
77    $objCartSess->delAllProducts();
78    // Ãíʸ°ì»þID¤ò²ò½ü¤¹¤ë¡£
79    $objSiteSess->unsetUniqId();
80   
81    $order_url = SEND_PARAM_PC_URL;
82    $html = '';
83    $html .= '<body onload="document.form1.submit();">';
84    $html .= '<form name="form1" id="form1" method="post" action="' . $order_url . '">';
85    foreach($arrSendData as $key => $val){
86        $html .= '  <input type="hidden" name="' . $key . '" value="' . $val . '">';
87    }
88    $html .= '  </form>';
89    $html .= '  </body>';
90//    $html .= "<script type='text/javascript'>document.form1.submit();</script>";
91   
92    echo $html;
93    exit();
94}
95
96// ¥Ç¡¼¥¿Á÷¿®½èÍý(MOBILE)
97function lfSendMobileCredit($arrData, $arrPayment, $objPage){
98    global $objCartSess;
99    global $objSiteSess;
100 
101    // Èó²ñ°÷¤Î¤È¤­¤Ï user_id ¤Ë not_member¤ÈÁ÷¤ë
102    ($arrData["customer_id"] == 0) ? $user_id = "not_member" : $user_id = $arrData["customer_id"]; 
103   
104    // Á÷¿®¥Ç¡¼¥¿À¸À®
105    $arrSendData = array(
106        'clientip' => $arrPayment[0]["memo05"],                                                     // ÈÖÁÈ¥³¡¼¥É
107        'act' => SEND_PARAM_ACT ,                                                                   // imode¸ÇÄê
108        'send' => SEND_PARAM_SEND,                                                                  // jpall¸ÇÄê
109        'money' => $arrData["payment_total"],                                                       // ¶â³Û
110        'usrtel' => $arrData["order_tel01"] . $arrData["order_tel02"] . $arrData["order_tel03"],    // ÅÅÏÃÈÖ¹æ
111        'usrmail' => $arrData["order_email"],                                                       // ¥á¡¼¥ë¥¢¥É¥ì¥¹
112        'sendid' => $arrData["order_temp_id"] . SEND_PARAM_DELIMITER . $arrData["payment_id"],                      // ¥ª¡¼¥À¡¼TEMPID , payment_id
113        'sendpoint' => ECCUBE_PAYMENT,                                                              // EC-CUBE
114        'siteurl' => SITE_URL . "mobile/",                                                                      // Ìá¤êÀèURL
115        'sitestr' => "TOP¤ØÌá¤ë"                                                                    // Ìá¤êÀè¥ê¥ó¥¯Ì¾
116    );
117   
118    // ¥»¥Ã¥·¥ç¥ó¥«¡¼¥ÈÆâ¤Î¾¦Éʤòºï½ü¤¹¤ë¡£
119    $objCartSess->delAllProducts();
120    // Ãíʸ°ì»þID¤ò²ò½ü¤¹¤ë¡£
121    $objSiteSess->unsetUniqId();
122   
123    // ¥Ç¡¼¥¿Á÷¿®ÀèCGI ·ÈÂÓüËö¤Î¾ì¹ç¤Ï ·ÈÂÓÍѤËÈô¤Ð¤¹
124    $objPage->order_url = SEND_PARAM_MOBILE_URL;
125    $objPage->arrSendData = $arrSendData;
126   
127    return $objPage;
128}
129
130
131?>
Note: See TracBrowser for help on using the repository browser.