source: branches/feature-module-zeus/data/downloads/module/mdl_zeus/zeus_credit.php @ 15505

Revision 15505, 4.5 KB checked in by naka, 13 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 */
7require_once(MODULE_PATH . "mdl_zeus/mdl_zeus.inc");
8
9class LC_Page {
10    function LC_Page() {
11        if (GC_MobileUserAgent::isMobile()) {
12            $this->tpl_mainpage = MODULE_PATH . "mdl_zeus/zeus_credit_mobile.tpl";
13        } else {
14            $this->tpl_mainpage = MODULE_PATH . "mdl_zeus/zeus_credit.tpl";
15        }       
16        /*
17         session_start»þ¤Îno-cache¥Ø¥Ã¥À¡¼¤òÍÞÀ©¤¹¤ë¤³¤È¤Ç
18         ¡ÖÌá¤ë¡×¥Ü¥¿¥ó»ÈÍÑ»þ¤ÎÍ­¸ú´ü¸ÂÀÚ¤ìɽ¼¨¤òÍÞÀ©¤¹¤ë¡£
19         private-no-expire:¥¯¥é¥¤¥¢¥ó¥È¤Î¥­¥ã¥Ã¥·¥å¤òµö²Ä¤¹¤ë¡£
20        */
21        session_cache_limiter('private-no-expire');     
22    }
23}
24
25$objPage = new LC_Page();
26$objView = (GC_MobileUserAgent::isMobile()) ? new SC_MobileView() : new SC_SiteView();
27$objCampaignSess = new SC_CampaignSession();
28$objSiteInfo = $objView->objSiteInfo;
29$arrInfo = $objSiteInfo->data;
30
31
32// ¥Ñ¥é¥á¡¼¥¿´ÉÍý¥¯¥é¥¹
33$objFormParam = new SC_FormParam();
34// ¥Ñ¥é¥á¡¼¥¿¾ðÊó¤Î½é´ü²½
35lfInitParam();
36// POSTÃͤμèÆÀ
37$objFormParam->setParam($_POST);
38
39// ¥«¡¼¥È½¸·×½èÍý
40$objPage = sfTotalCart($objPage, $objCartSess, $arrInfo);
41
42// °ì»þ¼õÃí¥Æ¡¼¥Ö¥ë¤ÎÆɹþ
43$arrData = sfGetOrderTemp($uniqid);
44
45// ¥«¡¼¥È½¸·×¤ò¸µ¤ËºÇ½ª·×»»
46$arrData = sfTotalConfirm($arrData, $objPage, $objCartSess, $arrInfo);
47
48switch($_POST['mode']) {
49// Á°¤Î¥Ú¡¼¥¸¤ËÌá¤ë
50case 'return':
51    // Àµ¾ï¤Ê¿ä°Ü¤Ç¤¢¤ë¤³¤È¤òµ­Ï¿¤·¤Æ¤ª¤¯
52    $objSiteSess->setRegistFlag();
53    if (GC_MobileUserAgent::isMobile()) {
54        header("Location: " . gfAddSessionId(URL_SHOP_CONFIRM));
55    } else {
56        header("Location: " . URL_SHOP_CONFIRM);
57    }
58    exit;
59    break;
60// ¼¡¤Ø
61case 'next':
62    // ÆþÎÏÃͤÎÊÑ´¹
63    $objFormParam->convParam();
64    $objPage->arrErr = lfCheckError($arrRet);
65   
66    // ÆþÎÏ¥¨¥é¡¼¤Ê¤·¤Î¾ì¹ç
67    if(count($objPage->arrErr) == 0) {
68        // ÆþÎϥǡ¼¥¿¤Î¼èÆÀ¤ò¹Ô¤¦
69        $arrInput = $objFormParam->getHashArray();
70        // ¥¯¥ì¥¸¥Ã¥ÈÅÅʸÁ÷¿®
71        $ret = sfPostPaymentData($arrData, $arrInput);
72        // À®¸ù
73        if($ret) {
74            // Àµ¾ï¤ËÅÐÏ¿¤µ¤ì¤¿¤³¤È¤òµ­Ï¿¤·¤Æ¤ª¤¯
75            $objSiteSess->setRegistFlag();
76            if (GC_MobileUserAgent::isMobile()) {
77                header("Location: " . gfAddSessionId(URL_SHOP_COMPLETE));
78            } else {
79                header("Location: " . URL_SHOP_COMPLETE);
80            }
81        } else {
82            // ¼ºÇÔ
83            $objPage->tpl_error = "ǧ¾Ú¤Ë¼ºÇÔ¤·¤Þ¤·¤¿¡£¤ª¼ê¿ô¤Ç¤¹¤¬ÆþÎÏÆâÍƤò¤´³Îǧ¤¯¤À¤µ¤¤¡£";
84        }
85    }
86    break;
87case 'quick_charge':
88    break;
89}
90
91$objDate = new SC_Date();
92$objDate->setStartYear(RELEASE_YEAR);
93$objDate->setEndYear(RELEASE_YEAR + CREDIT_ADD_YEAR);
94$objPage->arrYear = $objDate->getZeroYear();
95$objPage->arrMonth = $objDate->getZeroMonth();
96
97// ¶¦Ä̤Îɽ¼¨½àÈ÷
98$objPage = sfZeusDisp($objPage, $payment_id);
99
100// »Ùʧ²ó¿ô
101$objPage->arrPaymentClass = $arrPaymentClass;
102$objPage->arrForm = $objFormParam->getFormParamList();
103$objView->assignobj($objPage);
104// ¥Õ¥ì¡¼¥à¤òÁªÂò(¥­¥ã¥ó¥Ú¡¼¥ó¥Ú¡¼¥¸¤«¤éÁ«°Ü¤Ê¤éÊѹ¹)
105$objCampaignSess->pageView($objView);
106//-------------------------------------------------------------------------------------------------------
107/* ¥Ñ¥é¥á¡¼¥¿¾ðÊó¤Î½é´ü²½ */
108function lfInitParam() {
109    global $objFormParam;
110    $objFormParam->addParam("»Ùʧ²ó¿ô", "payment_class", INT_LEN, "n", array("EXIST_CHECK", "MAX_LENGTH_CHECK"));
111    $objFormParam->addParam("¥«¡¼¥ÉÈÖ¹æ1", "card_no01", CREDIT_NO_LEN, "n", array("EXIST_CHECK", "MAX_LENGTH_CHECK", "NUM_CHECK"));
112    $objFormParam->addParam("¥«¡¼¥ÉÈÖ¹æ2", "card_no02", CREDIT_NO_LEN, "n", array("EXIST_CHECK", "MAX_LENGTH_CHECK", "NUM_CHECK"));
113    $objFormParam->addParam("¥«¡¼¥ÉÈÖ¹æ3", "card_no03", CREDIT_NO_LEN, "n", array("EXIST_CHECK", "MAX_LENGTH_CHECK", "NUM_CHECK"));
114    $objFormParam->addParam("¥«¡¼¥ÉÈÖ¹æ4", "card_no04", CREDIT_NO_LEN, "n", array("EXIST_CHECK", "MAX_LENGTH_CHECK", "NUM_CHECK"));
115    $objFormParam->addParam("¥«¡¼¥É´ü¸Âǯ", "card_year", 2, "n", array("EXIST_CHECK", "NUM_COUNT_CHECK", "NUM_CHECK"));
116    $objFormParam->addParam("¥«¡¼¥É´ü¸Â·î", "card_month", 2, "n", array("EXIST_CHECK", "NUM_COUNT_CHECK", "NUM_CHECK"));
117    $objFormParam->addParam("̾", "card_name01", STEXT_LEN, "KVa", array("EXIST_CHECK", "MAX_LENGTH_CHECK", "ALPHA_CHECK"));
118    $objFormParam->addParam("À«", "card_name02", STEXT_LEN, "KVa", array("EXIST_CHECK", "MAX_LENGTH_CHECK", "ALPHA_CHECK"));
119    $objFormParam->addParam("Á°²óÍøÍѤ·¤¿¥«¡¼¥É¤ò»ÈÍѤ¹¤ë", "quick_check", INT_LEN, "n", array("MAX_LENGTH_CHECK"));   
120}
121
122/* ÆþÎÏÆâÍƤΥÁ¥§¥Ã¥¯ */
123function lfCheckError() {
124    global $objFormParam;
125    // ÆþÎϥǡ¼¥¿¤òÅϤ¹¡£
126    $arrRet =  $objFormParam->getHashArray();
127    $objErr = new SC_CheckError($arrRet);
128    $objErr->arrErr = $objFormParam->checkError();
129   
130    return $objErr->arrErr;
131}
132?>
Note: See TracBrowser for help on using the repository browser.