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

Revision 15413, 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$objPage = new LC_Page();
23$objView = new SC_SiteView();
24$objCampaignSess = new SC_CampaignSession();
25$objSiteInfo = $objView->objSiteInfo;
26$arrInfo = $objSiteInfo->data;
27
28if (GC_MobileUserAgent::isMobile()) {
29    sfDispSiteError(FREE_ERROR_MSG, "", false, "¥¯¥ì¥¸¥Ã¥È·èºÑ¤Ï¡¢¤´»ÈÍѤε¡¼ï¤Ë¤ÏÂбþ¤·¤Æ¤ª¤ê¤Þ¤»¤ó¡£", true);
30    exit;
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    header("Location: " . URL_SHOP_CONFIRM);
55    exit;
56    break;
57// ¼¡¤Ø
58case 'next':
59    // ÆþÎÏÃͤÎÊÑ´¹
60    $objFormParam->convParam();
61    $objPage->arrErr = lfCheckError($arrRet);
62    // ÆþÎÏ¥¨¥é¡¼¤Ê¤·¤Î¾ì¹ç
63    if(count($objPage->arrErr) == 0) {
64
65       
66        // ÆþÎϥǡ¼¥¿¤Î¼èÆÀ¤ò¹Ô¤¦
67        $arrInput = $objFormParam->getHashArray();
68        sfPostPaymentData($arrInput);
69       
70        // ¥¯¥ì¥¸¥Ã¥ÈÅÅʸÁ÷¿®
71        //$arrRet = sfSendPaygentCredit($arrData, $arrInput, $uniqid);     
72               
73        // À®¸ù
74        if($arrRet['payment_id'] != "") {
75            // Àµ¾ï¤ËÅÐÏ¿¤µ¤ì¤¿¤³¤È¤òµ­Ï¿¤·¤Æ¤ª¤¯
76            $objSiteSess->setRegistFlag();
77            header("Location: " . URL_SHOP_COMPLETE);
78        } else {
79            // ¼ºÇÔ
80            $objPage->tpl_error = "ǧ¾Ú¤Ë¼ºÇÔ¤·¤Þ¤·¤¿¡£¤ª¼ê¿ô¤Ç¤¹¤¬ÆþÎÏÆâÍƤò¤´³Îǧ¤¯¤À¤µ¤¤¡£";
81        }
82    }
83    break;
84}
85
86$objDate = new SC_Date();
87$objDate->setStartYear(RELEASE_YEAR);
88$objDate->setEndYear(RELEASE_YEAR + CREDIT_ADD_YEAR);
89$objPage->arrYear = $objDate->getZeroYear();
90$objPage->arrMonth = $objDate->getZeroMonth();
91
92// ¶¦Ä̤Îɽ¼¨½àÈ÷
93$objPage = sfZeusDisp($objPage, $payment_id);
94
95// »Ùʧ²ó¿ô
96$objPage->arrPaymentClass = $arrPaymentClass;
97$objPage->arrForm = $objFormParam->getFormParamList();
98$objView->assignobj($objPage);
99// ¥Õ¥ì¡¼¥à¤òÁªÂò(¥­¥ã¥ó¥Ú¡¼¥ó¥Ú¡¼¥¸¤«¤éÁ«°Ü¤Ê¤éÊѹ¹)
100$objCampaignSess->pageView($objView);
101//-------------------------------------------------------------------------------------------------------
102/* ¥Ñ¥é¥á¡¼¥¿¾ðÊó¤Î½é´ü²½ */
103function lfInitParam() {
104    global $objFormParam;
105    $objFormParam->addParam("»Ùʧ²ó¿ô", "payment_class", INT_LEN, "n", array("EXIST_CHECK", "MAX_LENGTH_CHECK"));
106    $objFormParam->addParam("¥«¡¼¥ÉÈÖ¹æ1", "card_no01", CREDIT_NO_LEN, "n", array("EXIST_CHECK", "MAX_LENGTH_CHECK", "NUM_CHECK"));
107    $objFormParam->addParam("¥«¡¼¥ÉÈÖ¹æ2", "card_no02", CREDIT_NO_LEN, "n", array("EXIST_CHECK", "MAX_LENGTH_CHECK", "NUM_CHECK"));
108    $objFormParam->addParam("¥«¡¼¥ÉÈÖ¹æ3", "card_no03", CREDIT_NO_LEN, "n", array("EXIST_CHECK", "MAX_LENGTH_CHECK", "NUM_CHECK"));
109    $objFormParam->addParam("¥«¡¼¥ÉÈÖ¹æ4", "card_no04", CREDIT_NO_LEN, "n", array("EXIST_CHECK", "MAX_LENGTH_CHECK", "NUM_CHECK"));
110    $objFormParam->addParam("¥«¡¼¥É´ü¸Âǯ", "card_year", 2, "n", array("EXIST_CHECK", "NUM_COUNT_CHECK", "NUM_CHECK"));
111    $objFormParam->addParam("¥«¡¼¥É´ü¸Â·î", "card_month", 2, "n", array("EXIST_CHECK", "NUM_COUNT_CHECK", "NUM_CHECK"));
112    $objFormParam->addParam("À«", "card_name01", STEXT_LEN, "KVa", array("EXIST_CHECK", "MAX_LENGTH_CHECK", "ALPHA_CHECK"));
113    $objFormParam->addParam("̾", "card_name02", STEXT_LEN, "KVa", array("EXIST_CHECK", "MAX_LENGTH_CHECK", "ALPHA_CHECK"));
114}
115
116/* ÆþÎÏÆâÍƤΥÁ¥§¥Ã¥¯ */
117function lfCheckError() {
118    global $objFormParam;
119    // ÆþÎϥǡ¼¥¿¤òÅϤ¹¡£
120    $arrRet =  $objFormParam->getHashArray();
121    $objErr = new SC_CheckError($arrRet);
122    $objErr->arrErr = $objFormParam->checkError();
123   
124    return $objErr->arrErr;
125}
126?>
Note: See TracBrowser for help on using the repository browser.