source: branches/rel/html/shopping/card.php @ 12157

Revision 12157, 5.3 KB checked in by uehara, 16 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("../require.php");
9
10$arrJPO_INFO['10'] = "°ì³çʧ¤¤";
11$arrJPO_INFO['21'] = "¥Ü¡¼¥Ê¥¹°ì³çʧ¤¤";
12$arrJPO_INFO['80'] = "¥ê¥Üʧ¤¤";
13$arrJPO_INFO['61C02'] = "ʬ³ä2²óʧ¤¤";
14$arrJPO_INFO['61C03'] = "ʬ³ä3²óʧ¤¤";
15$arrJPO_INFO['61C05'] = "ʬ³ä5²óʧ¤¤";
16$arrJPO_INFO['61C06'] = "ʬ³ä6²óʧ¤¤";
17$arrJPO_INFO['61C10'] = "ʬ³ä10²óʧ¤¤";
18$arrJPO_INFO['61C12'] = "ʬ³ä12²óʧ¤¤";
19$arrJPO_INFO['61C15'] = "ʬ³ä15²óʧ¤¤";
20
21class LC_Page {
22    function LC_Page() {
23        /** ɬ¤º»ØÄꤹ¤ë **/
24        $this->tpl_css = URL_DIR.'css/layout/shopping/card.css';    // ¥á¥¤¥óCSS¥Ñ¥¹
25        /** ɬ¤º»ØÄꤹ¤ë **/
26        $this->tpl_mainpage = 'shopping/card.tpl';          // ¥á¥¤¥ó¥Æ¥ó¥×¥ì¡¼¥È
27        global $arrJPO_INFO;
28        $this->arrJPO_INFO = $arrJPO_INFO;
29        /*
30         session_start»þ¤Îno-cache¥Ø¥Ã¥À¡¼¤òÍÞÀ©¤¹¤ë¤³¤È¤Ç
31         ¡ÖÌá¤ë¡×¥Ü¥¿¥ó»ÈÍÑ»þ¤ÎÍ­¸ú´ü¸ÂÀÚ¤ìɽ¼¨¤òÍÞÀ©¤¹¤ë¡£
32         private-no-expire:¥¯¥é¥¤¥¢¥ó¥È¤Î¥­¥ã¥Ã¥·¥å¤òµö²Ä¤¹¤ë¡£
33        */
34        session_cache_limiter('private-no-expire');     
35    }
36}
37
38$objPage = new LC_Page();
39$objView = new SC_SiteView();
40$objSiteSess = new SC_SiteSession();
41$objCartSess = new SC_CartSession();
42$objCampaignSess = new SC_CampaignSession();
43$objSiteInfo = $objView->objSiteInfo;
44$arrInfo = $objSiteInfo->data;
45
46// ¥Ñ¥é¥á¡¼¥¿´ÉÍý¥¯¥é¥¹
47$objFormParam = new SC_FormParam();
48// ¥Ñ¥é¥á¡¼¥¿¾ðÊó¤Î½é´ü²½
49lfInitParam();
50// POSTÃͤμèÆÀ
51$objFormParam->setParam($_POST);
52
53// ¥¢¥¯¥»¥¹¤ÎÀµÅöÀ­¤ÎȽÄê
54$uniqid = sfCheckNormalAccess($objSiteSess, $objCartSess);
55
56switch($_POST['mode']) {
57// ÅÐÏ¿
58case 'regist':
59    // ÆþÎÏÃͤÎÊÑ´¹
60    $objFormParam->convParam();
61    $objPage->arrErr = lfCheckError($arrRet);
62    // ÆþÎÏ¥¨¥é¡¼¤Ê¤·¤Î¾ì¹ç
63    if(count($objPage->arrErr) == 0) {
64        // ¥«¡¼¥È½¸·×½èÍý
65        $objPage = sfTotalCart($objPage, $objCartSess, $arrInfo);
66        // °ì»þ¼õÃí¥Æ¡¼¥Ö¥ë¤ÎÆɹþ
67        $arrData = sfGetOrderTemp($uniqid);
68        // ¥«¡¼¥È½¸·×¤ò¸µ¤ËºÇ½ª·×»»
69        $arrData = sfTotalConfirm($arrData, $objPage, $objCartSess, $arrInfo);
70
71        // ¥«¡¼¥É¤Îǧ¾Ú¤ò¹Ô¤¦
72        $arrVal = $objFormParam->getHashArray();
73        $card_no = $arrVal['card_no01'].$arrVal['card_no02'].$arrVal['card_no03'].$arrVal['card_no04'];
74        $card_exp = $arrVal['card_month']. "/" . $arrVal['card_year']; // MM/DD
75        $result = sfGetAuthonlyResult(CGI_DIR, CGI_FILE, $arrVal['name01'], $arrVal['name02'], $card_no, $card_exp, $arrData['payment_total'], $uniqid, $arrVal['jpo_info']);
76
77        // ±þÅúÆâÍƤε­Ï¿
78        $sqlval['credit_result'] = $result['action-code'];
79        $sqlval['credit_msg'] = $result['aux-msg'].$result['MErrMsg'];
80        $objQuery = new SC_Query();
81        $objQuery->update("dtb_order_temp", $sqlval, "order_temp_id = ?", array($uniqid));
82               
83        // Í¿¿®½èÍýÀ®¸ù¤Î¾ì¹ç
84        if($result['action-code'] == '000') {
85            // Àµ¾ï¤ËÅÐÏ¿¤µ¤ì¤¿¤³¤È¤òµ­Ï¿¤·¤Æ¤ª¤¯
86            $objSiteSess->setRegistFlag();
87            // ½èÍý´°Î»¥Ú¡¼¥¸¤Ø
88            header("Location: " . URL_SHOP_COMPLETE);
89        } else {
90            switch($result['action-code']) {
91            case '115':
92                $objPage->tpl_error = "¢¨ ¥«¡¼¥É¤ÎÍ­¸ú´ü¸Â¤¬ÀÚ¤ì¤Æ¤¤¤Þ¤¹¡£";
93                break;
94            case '212':
95                $objPage->tpl_error = "¢¨ ¥«¡¼¥ÉÈÖ¹æ¤Ë¸í¤ê¤¬¤¢¤ê¤Þ¤¹¡£";
96                break;
97            case '100':
98                $objPage->tpl_error = "¢¨ ¥«¡¼¥É²ñ¼Ò¤Ç¤ª¼è°ú¤¬¾µÇ§¤µ¤ì¤Þ¤»¤ó¤Ç¤·¤¿¡£";
99                break;
100            default:
101                $objPage->tpl_error = "¢¨ ¥¯¥ì¥¸¥Ã¥È¥«¡¼¥É¤Î¾È¹ç¤Ë¼ºÇÔ¤·¤Þ¤·¤¿¡£";
102                break;
103            }
104        }
105    }
106    break;
107// Á°¤Î¥Ú¡¼¥¸¤ËÌá¤ë
108case 'return':
109    // Àµ¾ï¤ËÅÐÏ¿¤µ¤ì¤¿¤³¤È¤òµ­Ï¿¤·¤Æ¤ª¤¯
110    $objSiteSess->setRegistFlag();
111    // ³Îǧ¥Ú¡¼¥¸¤Ø°ÜÆ°
112    header("Location: " . URL_SHOP_CONFIRM);
113    exit;
114    break;
115}
116
117$objDate = new SC_Date();
118$objDate->setStartYear(RELEASE_YEAR);
119$objDate->setEndYear(RELEASE_YEAR + CREDIT_ADD_YEAR);
120$objPage->arrYear = $objDate->getZeroYear();
121$objPage->arrMonth = $objDate->getZeroMonth();
122
123$objPage->arrForm = $objFormParam->getFormParamList();
124$objView->assignobj($objPage);
125// ¥Õ¥ì¡¼¥à¤òÁªÂò(¥­¥ã¥ó¥Ú¡¼¥ó¥Ú¡¼¥¸¤«¤éÁ«°Ü¤Ê¤éÊѹ¹)
126$objCampaignSess->pageView($objView);
127//-----------------------------------------------------------------------------------------------------------------------------------
128/* ¥Ñ¥é¥á¡¼¥¿¾ðÊó¤Î½é´ü²½ */
129function lfInitParam() {
130    global $objFormParam;
131    $objFormParam->addParam("¥«¡¼¥ÉÈÖ¹æ1", "card_no01", CREDIT_NO_LEN, "n", array("EXIST_CHECK", "MAX_LENGTH_CHECK", "NUM_CHECK"));
132    $objFormParam->addParam("¥«¡¼¥ÉÈÖ¹æ2", "card_no02", CREDIT_NO_LEN, "n", array("EXIST_CHECK", "MAX_LENGTH_CHECK", "NUM_CHECK"));
133    $objFormParam->addParam("¥«¡¼¥ÉÈÖ¹æ3", "card_no03", CREDIT_NO_LEN, "n", array("EXIST_CHECK", "MAX_LENGTH_CHECK", "NUM_CHECK"));
134    $objFormParam->addParam("¥«¡¼¥ÉÈÖ¹æ4", "card_no04", CREDIT_NO_LEN, "n", array("EXIST_CHECK", "MAX_LENGTH_CHECK", "NUM_CHECK"));
135    $objFormParam->addParam("¥«¡¼¥É´ü¸Âǯ", "card_year", 2, "n", array("EXIST_CHECK", "NUM_COUNT_CHECK", "NUM_CHECK"));
136    $objFormParam->addParam("¥«¡¼¥É´ü¸Â·î", "card_month", 2, "n", array("EXIST_CHECK", "NUM_COUNT_CHECK", "NUM_CHECK"));
137    $objFormParam->addParam("À«", "card_name01", STEXT_LEN, "KVa", array("EXIST_CHECK", "MAX_LENGTH_CHECK", "ALPHA_CHECK"));
138    $objFormParam->addParam("̾", "card_name02", STEXT_LEN, "KVa", array("EXIST_CHECK", "MAX_LENGTH_CHECK", "ALPHA_CHECK"));
139    $objFormParam->addParam("¤ª»Ùʧ¤¤ÊýË¡", "jpo_info", STEXT_LEN, "KVa", array("EXIST_CHECK", "MAX_LENGTH_CHECK", "ALNUM_CHECK"));
140}
141
142/* ÆþÎÏÆâÍƤΥÁ¥§¥Ã¥¯ */
143function lfCheckError() {
144    global $objFormParam;
145    // ÆþÎϥǡ¼¥¿¤òÅϤ¹¡£
146    $arrRet =  $objFormParam->getHashArray();
147    $objErr = new SC_CheckError($arrRet);
148    $objErr->arrErr = $objFormParam->checkError();
149   
150    return $objErr->arrErr;
151}
152
153?>
Note: See TracBrowser for help on using the repository browser.