source: branches/feature-module-zeus/data/downloads/module/mdl_zero/zeus_credit.php @ 15414

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