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

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