source: branches/dev/html/mobile/nonmember/index.php @ 14957

Revision 14957, 24.4 KB checked in by nakanishi, 13 years ago (diff)
Line 
1<?php
2/**
3 *
4 * Copyright(c) 2000-2007 LOCKON CO.,LTD. All Rights Reserved.
5 *
6 * http://www.lockon.co.jp/
7 *
8 */
9
10require_once("../require.php");
11
12class LC_Page {
13    var $arrSession;
14    var $tpl_mode;
15    var $tpl_login_email;
16    function LC_Page() {
17        $this->tpl_mainpage = 'nonmember/index.tpl';
18        global $arrPref;
19        $this->arrPref = $arrPref;
20        global $arrSex;
21        $this->arrSex = $arrSex;
22        global $arrJob;
23        $this->arrJob = $arrJob;
24        $this->tpl_onload = 'fnCheckInputDeliv();';
25       
26        /*
27         session_start»þ¤Îno-cache¥Ø¥Ã¥À¡¼¤òÍÞÀ©¤¹¤ë¤³¤È¤Ç
28         ¡ÖÌá¤ë¡×¥Ü¥¿¥ó»ÈÍÑ»þ¤ÎÍ­¸ú´ü¸ÂÀÚ¤ìɽ¼¨¤òÍÞÀ©¤¹¤ë¡£
29         private-no-expire:¥¯¥é¥¤¥¢¥ó¥È¤Î¥­¥ã¥Ã¥·¥å¤òµö²Ä¤¹¤ë¡£
30        */
31        session_cache_limiter('private-no-expire');             
32    }
33}
34
35$conn = new SC_DBConn();
36$objPage = new LC_Page();
37$objView = new SC_MobileView();
38$objSiteSess = new SC_SiteSession();
39$objCartSess = new SC_CartSession();
40$objCustomer = new SC_Customer();
41$objCookie = new SC_Cookie();
42$objFormParam = new SC_FormParam();         // ¥Õ¥©¡¼¥àÍÑ
43lfInitParam();                              // ¥Ñ¥é¥á¡¼¥¿¾ðÊó¤Î½é´ü²½
44$objFormParam->setParam($_POST);            // POSTÃͤμèÆÀ
45
46//-------------------------------------¢§NONMEMBER----------------------------------------------
47//---- ¥Ú¡¼¥¸½é´üÀßÄê
48
49$CONF = sf_getBasisData();                  // ŹÊÞ´ðËܾðÊó
50$objDate = new SC_Date(START_BIRTH_YEAR, date("Y",strtotime("now")));
51$objPage->arrPref = $arrPref;
52$objPage->arrJob = $arrJob;
53$objPage->arrReminder = $arrReminder;
54$objPage->arrYear = $objDate->getYear('', 1950);    //¡¡ÆüÉÕ¥×¥ë¥À¥¦¥óÀßÄê
55$objPage->arrMonth = $objDate->getMonth();
56$objPage->arrDay = $objDate->getDay();
57
58//SSLURLȽÄê
59if (SSLURL_CHECK == 1){
60    $ssl_url= sfRmDupSlash(MOBILE_SSL_URL.$_SERVER['REQUEST_URI']);
61    if (!ereg("^https://", $non_ssl_url)){
62        sfDispSiteError(URL_ERROR, "", false, "", true);
63    }
64}
65
66// ¥ì¥¤¥¢¥¦¥È¥Ç¥¶¥¤¥ó¤ò¼èÆÀ
67$objPage = sfGetPageLayout($objPage, false, DEF_LAYOUT);
68
69// ¥æ¡¼¥¶¥æ¥Ë¡¼¥¯ID¤Î¼èÆÀ¤È¹ØÆþ¾õÂÖ¤ÎÀµÅöÀ­¤ò¥Á¥§¥Ã¥¯
70$uniqid = sfCheckNormalAccess($objSiteSess, $objCartSess);
71
72$objPage->tpl_uniqid = $uniqid;
73
74switch($_POST['mode']) {
75case 'nonmember_confirm':
76    $objPage = lfSetNonMember($objPage);
77    // ¢¨break¤Ê¤·
78//case 'confirm':
79//    // ÆþÎÏÃͤÎÊÑ´¹
80//    $objFormParam->convParam();
81//    $objFormParam->toLower('order_mail');
82//    $objFormParam->toLower('order_mail_check');
83//    $objPage->arrErr = lfCheckError();
84//    // ÆþÎÏ¥¨¥é¡¼¤Ê¤·
85//    if(count($objPage->arrErr) == 0) {
86//        // DB¤Ø¤Î¥Ç¡¼¥¿ÅÐÏ¿
87//        lfRegistData($uniqid);
88//        // Àµ¾ï¤ËÅÐÏ¿¤µ¤ì¤¿¤³¤È¤òµ­Ï¿¤·¤Æ¤ª¤¯
89//        $objSiteSess->setRegistFlag();
90//        // ¤ª»Ùʧ¤¤ÊýË¡ÁªÂò¥Ú¡¼¥¸¤Ø°ÜÆ°
91//        header("Location: " . gfAddSessionId(MOBILE_URL_SHOP_PAYMENT));
92//        exit;       
93//    }
94//   
95//    break;
96// Á°¤Î¥Ú¡¼¥¸¤ËÌá¤ë
97case 'return':
98    // ³Îǧ¥Ú¡¼¥¸¤Ø°ÜÆ°
99    header("Location: " . gfAddSessionId(MOBILE_URL_CART_TOP));
100    exit;
101    break;
102case 'nonmember':
103    $objPage = lfSetNonMember($objPage);
104    // ¢¨break¤Ê¤·
105default:
106    if($_GET['from'] == 'nonmember') {
107        $objPage = lfSetNonMember($objPage);
108    }
109    // ¥æ¡¼¥¶¥æ¥Ë¡¼¥¯ID¤Î¼èÆÀ
110    $uniqid = $objSiteSess->getUniqId();
111    sfprintr($uniqid);
112    $objQuery = new SC_Query();
113    $where = "order_temp_id = ?";
114    $arrRet = $objQuery->select("*", "dtb_order_temp", $where, array($uniqid));
115    // DBÃͤμèÆÀ
116    $objFormParam->setParam($arrRet[0]);
117    $objFormParam->setValue('order_email_check', $arrRet[0]['order_email']);
118    $objFormParam->setDBDate($arrRet[0]['order_birth']);
119    break;
120}
121
122// ¥¯¥Ã¥­¡¼È½Äê
123$objPage->tpl_login_email = $objCookie->getCookie('login_email');
124if($objPage->tpl_login_email != "") {
125    $objPage->tpl_login_memory = "1";
126}
127
128// ÁªÂòÍÑÆüÉդμèÆÀ
129$objDate = new SC_Date(START_BIRTH_YEAR);
130$objPage->arrYear = $objDate->getYear('', 1950);    //¡¡ÆüÉÕ¥×¥ë¥À¥¦¥óÀßÄê
131$objPage->arrMonth = $objDate->getMonth();
132$objPage->arrDay = $objDate->getDay();
133
134// ÆþÎÏÃͤμèÆÀ
135$objPage->arrForm = $objFormParam->getFormParamList();
136
137//objPage¤Î¾ðÊó¤òobjView¤Ë³ÊǼ
138$objView->assignobj($objPage);
139$objView->display(SITE_FRAME);
140
141//--------------------------------------------------------------------------------------------------------------------------
142/* Èó²ñ°÷ÆþÎÏ¥Ú¡¼¥¸¤Î¥»¥Ã¥È */
143function lfSetNonMember($objPage) {
144   
145    $arrRegistColumn = array(
146                             array(  "column" => "name01", "convert" => "aKV" ),
147                             array(  "column" => "name02", "convert" => "aKV" ),
148                             array(  "column" => "kana01", "convert" => "CKV" ),
149                             array(  "column" => "kana02", "convert" => "CKV" ),
150                             array(  "column" => "zip01", "convert" => "n" ),
151                             array(  "column" => "zip02", "convert" => "n" ),
152                             array(  "column" => "pref", "convert" => "n" ),
153                             array(  "column" => "addr01", "convert" => "aKV" ),
154                             array(  "column" => "addr02", "convert" => "aKV" ),
155                             array(  "column" => "email", "convert" => "a" ),
156                             array(  "column" => "email2", "convert" => "a" ),
157                             array(  "column" => "email_mobile", "convert" => "a" ),
158                             array(  "column" => "email_mobile2", "convert" => "a" ),
159                             array(  "column" => "tel01", "convert" => "n" ),
160                             array(  "column" => "tel02", "convert" => "n" ),
161                             array(  "column" => "tel03", "convert" => "n" ),
162                             array(  "column" => "fax01", "convert" => "n" ),
163                             array(  "column" => "fax02", "convert" => "n" ),
164                             array(  "column" => "fax03", "convert" => "n" ),
165                             array(  "column" => "sex", "convert" => "n" ),
166                             array(  "column" => "job", "convert" => "n" ),
167                             array(  "column" => "birth", "convert" => "n" ),
168                             array(  "column" => "reminder", "convert" => "n" ),
169                             array(  "column" => "reminder_answer", "convert" => "aKV"),
170                             array(  "column" => "password", "convert" => "a" ),
171                             array(  "column" => "password02", "convert" => "a" ),
172                             array(  "column" => "mailmaga_flg", "convert" => "n" ),
173                         );
174
175//---- ÅÐÏ¿½ü³°ÍÑ¥«¥é¥àÇÛÎó
176//$arrRejectRegistColumn = array("year", "month", "day", "email02", "email_mobile02","password","password02","reminder","reminder_answer");
177$arrRejectRegistColumn = array("year", "month", "day", "email02", "email_mobile02", "password02");
178       
179    $objPage->tpl_mainpage = 'nonmember/nonmember_set1.tpl';
180    $objPage->tpl_css = array();
181    $objPage->tpl_css[] = '/css/layout/login/nonmember.css';
182   
183    //-- POST¥Ç¡¼¥¿¤Î°ú¤­·Ñ¤®
184    $objPage->arrForm = $_POST;
185   
186    if($objPage->arrForm['year'] == '----') {
187        $objPage->arrForm['year'] = '';
188    }
189   
190    $objPage->arrForm['email'] = strtolower($objPage->arrForm['email']);        // email¤Ï¤¹¤Ù¤Æ¾®Ê¸»ú¤Ç½èÍý
191   
192    //-- ÆþÎϥǡ¼¥¿¤ÎÊÑ´¹
193    $objPage->arrForm = lfConvertParam($objPage->arrForm, $arrRegistColumn);
194
195    // Ìá¤ë¥Ü¥¿¥óÍѽèÍý
196    //return¤ÎÃæ¤Ë¸µ¤Î¥Ú¡¼¥¸¤Î̾Á°¤¬Æþ¤Ã¤Æ¤¤¤ë
197    if (!empty($_POST["return"])) {
198        switch ($_POST["mode2"]) {
199        case "deliv_date": 
200       
201            break;
202        case "deliv":
203            $_POST["mode2"] = "set3";
204            break;
205        case "set3":
206            $_POST["mode2"] = "set2";
207            break;
208        default:
209            $_POST["mode2"] = "set1";
210            break;
211        }
212    }   
213
214    //--¡¡ÆþÎÏ¥¨¥é¡¼¥Á¥§¥Ã¥¯
215    if (!empty($_POST["mode2"])) {
216            if ($_POST["mode2"] == "set2") {
217            $objPage->arrErr = lfErrorCheck1($objPage->arrForm);
218            $objPage->tpl_mainpage = 'nonmember/nonmember_set1.tpl';
219            $objPage->tpl_title = '¤ªµÒÍ;ðÊóÆþÎÏ(1/3)';
220        } elseif ($_POST["mode2"] == "set3") {
221            sfprintr($objPage->arrForm);
222            $objPage->arrErr = lfErrorCheck2($objPage->arrForm);
223            $objPage->tpl_mainpage = 'nonmember/nonmember_set2.tpl';
224            $objPage->tpl_title = '¤ªµÒÍ;ðÊóÆþÎÏ(2/3)';
225        } else{
226            print('¤ªµÒÍ;ðÊóÆþÎÏ(3/3)');
227            sfprintr($objPage->arrForm);
228            $objPage->arrErr = lfErrorCheck3($objPage->arrForm);
229            $objPage->tpl_mainpage = 'nonmember/nonmember_set3.tpl';
230            $objPage->tpl_title = '¤ªµÒÍ;ðÊóÆþÎÏ(3/3)';
231        }
232   
233    //¥Õ¥©¡¼¥à¤ÎÃͤò$objPage¤Î¥­¡¼¤È¤·¤ÆÂåÆþ¤·¤Æ¤¤¤¯
234   foreach($objPage->arrForm as $key => $val) {
235        $objPage->$key = $val;
236        }
237    }
238
239        // ÆþÎÏ¥¨¥é¡¼¤Î¥Á¥§¥Ã¥¯
240    if ($objPage->arrErr || !empty($_POST["return"])) {     
241        sfprintr($objPage->arrForm);exit;
242        //-- ¥Ç¡¼¥¿¤ÎÀßÄê
243        if ($_POST["mode2"] == "set2") {
244            $checkVal = array("email", "name01", "name02", "kana01", "kana02");
245        } elseif ($_POST["mode2"] == "set3") {
246            $checkVal = array("sex", "year", "month", "day", "zip01", "zip02");
247        } else {
248            sfprintr($objPage->arrForm);exit;
249            $checkVal = array("pref", "addr01", "addr02", "tel01", "tel02", "tel03", "mail_flag");
250        }
251
252        foreach($objPage->arrForm as $key => $val) {
253            if ($key != "mode2" && $key != "submit" && $key != "return" && $key != session_name() && !in_array($key, $checkVal))
254                $objPage->list_data[ $key ] = $val;
255        }
256
257    } else {
258
259        //--¡¡¥Æ¥ó¥×¥ì¡¼¥ÈÀßÄê
260        if ($_POST["mode2"] == "set2") {
261           
262            $objPage->tpl_mainpage = 'nonmember/nonmember_set2.tpl';
263            $objPage->tpl_title = '¤ªµÒÍ;ðÊóÆþÎÏ(2/3)';
264        } elseif ($_POST["mode2"] == "set3") {
265            $objPage->tpl_mainpage = 'nonmember/nonmember_set3.tpl';
266            $objPage->tpl_title = '¤ªµÒÍ;ðÊóÆþÎÏ(3/3)';
267
268            if (@$objPage->arrForm['pref'] == "" && @$objPage->arrForm['addr01'] == "" && @$objPage->arrForm['addr02'] == "") {
269                $address = lfGetAddress($_REQUEST['zip01'].$_REQUEST['zip02']);
270                $objPage->pref = @$address[0]['state'];
271                $objPage->addr01 = @$address[0]['city'] . @$address[0]['town'];
272            }
273        }
274        //sfprintr($objPage);
275        //-- ¥Ç¡¼¥¿ÀßÄê
276        unset($objPage->list_data);
277        if ($_POST["mode2"] == "set2") {
278            $checkVal = array("sex", "year", "month", "day", "zip01", "zip02");
279        } elseif ($_POST["mode2"] == "set3") {
280            $checkVal = array("pref", "addr01", "addr02", "tel01", "tel02", "tel03", "mail_flag");
281        } else {
282            $checkVal = array();
283        }
284
285        //$objPage->arrForm¥Õ¥©¡¼¥à¤ÎÃͤòlist¤Ë³ÊǼ
286        foreach($objPage->arrForm as $key => $val) {
287            if ($key != "mode2" && $key != "submit" && $key != "confirm" && $key != "return" && $key != session_name() && !in_array($key, $checkVal)) {
288                $objPage->list_data[ $key ] = $val;
289            }
290        }
291       
292        //header("Location:" . gfAddSessionId("./deliv.php"));
293       
294    }
295    return $objPage;
296}
297
298
299/**
300 * regist data function
301 *
302 * @param string $uniqid this parameter is unique ID of user.
303 *
304 *
305 */
306 //¥Ç¡¼¥¿¤ÎÅÐÏ¿¤ò¹Ô¤¦
307//function lfRegistData($uniqid) {
308//    global $objFormParam;
309//    $arrRet = $objFormParam->getHashArray();
310//    $sqlval = $objFormParam->getDbArray();
311//    sfprintr($arrRet);exit;
312//    // ÅÐÏ¿¥Ç¡¼¥¿¤ÎºîÀ®
313//    $sqlval['order_temp_id'] = $uniqid;
314//    $sqlval['order_birth'] = sfGetTimestamp($arrRet['year'], $arrRet['month'], $arrRet['day']);
315//    $sqlval['update_date'] = 'Now()';
316//    $sqlval['customer_id'] = '0';
317//    $sqlval['order_name01'] = $objPage->arrAddr[0]['name01'];
318//         
319//    // ´û¸¥Ç¡¼¥¿¤Î¥Á¥§¥Ã¥¯
320//    $objQuery = new SC_Query();
321//    $where = "order_temp_id = ?";
322//    $cnt = $objQuery->count("dtb_order_temp", $where, array($uniqid));
323//    // ´û¸¥Ç¡¼¥¿¤¬¤Ê¤¤¾ì¹ç
324//    if ($cnt == 0) {
325//        $sqlval['create_date'] = 'Now()';
326//        $objQuery->insert("dtb_order_temp", $sqlval);
327//    } else {
328//        $objQuery->update("dtb_order_temp", $sqlval, $where, array($uniqid));
329//    }
330//}
331
332
333/* ¥Ñ¥é¥á¡¼¥¿¾ðÊó¤Î½é´ü²½ */
334function lfInitParam() {
335    global $objFormParam;
336    $objFormParam->addParam("¤ªÌ¾Á°¡ÊÀ«¡Ë", "order_name01", STEXT_LEN, "KVa", array("EXIST_CHECK", "SPTAB_CHECK", "MAX_LENGTH_CHECK"));
337    $objFormParam->addParam("¤ªÌ¾Á°¡Ê̾¡Ë", "order_name02", STEXT_LEN, "KVa", array("EXIST_CHECK", "SPTAB_CHECK", "MAX_LENGTH_CHECK"));
338    $objFormParam->addParam("¥Õ¥ê¥¬¥Ê¡Ê¥»¥¤¡Ë", "order_kana01", STEXT_LEN, "KVCa", array("EXIST_CHECK", "SPTAB_CHECK", "MAX_LENGTH_CHECK"));
339    $objFormParam->addParam("¥Õ¥ê¥¬¥Ê¡Ê¥á¥¤¡Ë", "order_kana02", STEXT_LEN, "KVCa", array("EXIST_CHECK", "SPTAB_CHECK", "MAX_LENGTH_CHECK"));
340    $objFormParam->addParam("͹ÊØÈÖ¹æ1", "order_zip01", ZIP01_LEN, "n", array("EXIST_CHECK", "NUM_CHECK", "NUM_COUNT_CHECK"));
341    $objFormParam->addParam("͹ÊØÈÖ¹æ2", "order_zip02", ZIP02_LEN, "n", array("EXIST_CHECK", "NUM_CHECK", "NUM_COUNT_CHECK"));
342    $objFormParam->addParam("ÅÔÆ»Éܸ©", "order_pref", INT_LEN, "n", array("EXIST_CHECK", "MAX_LENGTH_CHECK", "NUM_CHECK"));
343    $objFormParam->addParam("½»½ê1", "order_addr01", STEXT_LEN, "KVa", array("EXIST_CHECK", "SPTAB_CHECK", "MAX_LENGTH_CHECK"));
344    $objFormParam->addParam("½»½ê2", "order_addr02", STEXT_LEN, "KVa", array("EXIST_CHECK", "SPTAB_CHECK", "MAX_LENGTH_CHECK"));
345    $objFormParam->addParam("ÅÅÏÃÈÖ¹æ1", "order_tel01", TEL_ITEM_LEN, "n", array("EXIST_CHECK", "MAX_LENGTH_CHECK" ,"NUM_CHECK"));
346    $objFormParam->addParam("ÅÅÏÃÈÖ¹æ2", "order_tel02", TEL_ITEM_LEN, "n", array("EXIST_CHECK", "MAX_LENGTH_CHECK" ,"NUM_CHECK"));
347    $objFormParam->addParam("ÅÅÏÃÈÖ¹æ3", "order_tel03", TEL_ITEM_LEN, "n", array("EXIST_CHECK", "MAX_LENGTH_CHECK" ,"NUM_CHECK"));
348    $objFormParam->addParam("FAXÈÖ¹æ1", "order_fax01", TEL_ITEM_LEN, "n", array("MAX_LENGTH_CHECK" ,"NUM_CHECK"));
349    $objFormParam->addParam("FAXÈÖ¹æ2", "order_fax02", TEL_ITEM_LEN, "n", array("MAX_LENGTH_CHECK" ,"NUM_CHECK"));
350    $objFormParam->addParam("FAXÈÖ¹æ3", "order_fax03", TEL_ITEM_LEN, "n", array("MAX_LENGTH_CHECK" ,"NUM_CHECK"));
351    $objFormParam->addParam("¥á¡¼¥ë¥¢¥É¥ì¥¹", "order_email", STEXT_LEN, "KVa", array("EXIST_CHECK", "SPTAB_CHECK", "NO_SPTAB", "MAX_LENGTH_CHECK", "EMAIL_CHECK", "EMAIL_CHAR_CHECK"));
352    $objFormParam->addParam("¥á¡¼¥ë¥¢¥É¥ì¥¹¡Ê³Îǧ¡Ë", "order_email_check", STEXT_LEN, "KVa", array("EXIST_CHECK", "SPTAB_CHECK", "NO_SPTAB", "MAX_LENGTH_CHECK", "EMAIL_CHECK", "EMAIL_CHAR_CHECK"), "", false);
353    $objFormParam->addParam("ǯ", "year", INT_LEN, "n", array("MAX_LENGTH_CHECK"), "", false);
354    $objFormParam->addParam("·î", "month", INT_LEN, "n", array("MAX_LENGTH_CHECK"), "", false);
355    $objFormParam->addParam("Æü", "day", INT_LEN, "n", array("MAX_LENGTH_CHECK"), "", false);
356    $objFormParam->addParam("À­ÊÌ", "order_sex", INT_LEN, "n", array("EXIST_CHECK", "MAX_LENGTH_CHECK", "NUM_CHECK"));
357    $objFormParam->addParam("¿¦¶È", "order_job", INT_LEN, "n", array("MAX_LENGTH_CHECK", "NUM_CHECK"));
358    $objFormParam->addParam("Ê̤ΤªÆϤ±Àè", "deliv_check", INT_LEN, "n", array("MAX_LENGTH_CHECK", "NUM_CHECK"));
359    $objFormParam->addParam("¤ªÌ¾Á°¡ÊÀ«¡Ë", "deliv_name01", STEXT_LEN, "KVa", array("SPTAB_CHECK", "MAX_LENGTH_CHECK"));
360    $objFormParam->addParam("¤ªÌ¾Á°¡Ê̾¡Ë", "deliv_name02", STEXT_LEN, "KVa", array("SPTAB_CHECK", "MAX_LENGTH_CHECK"));
361    $objFormParam->addParam("¥Õ¥ê¥¬¥Ê¡Ê¥»¥¤¡Ë", "deliv_kana01", STEXT_LEN, "KVCa", array("SPTAB_CHECK", "MAX_LENGTH_CHECK"));
362    $objFormParam->addParam("¥Õ¥ê¥¬¥Ê¡Ê¥á¥¤¡Ë", "deliv_kana02", STEXT_LEN, "KVCa", array("SPTAB_CHECK", "MAX_LENGTH_CHECK"));
363    $objFormParam->addParam("͹ÊØÈÖ¹æ1", "deliv_zip01", ZIP01_LEN, "n", array("NUM_CHECK", "NUM_COUNT_CHECK"));
364    $objFormParam->addParam("͹ÊØÈÖ¹æ2", "deliv_zip02", ZIP02_LEN, "n", array("NUM_CHECK", "NUM_COUNT_CHECK"));
365    $objFormParam->addParam("ÅÔÆ»Éܸ©", "deliv_pref", INT_LEN, "n", array("MAX_LENGTH_CHECK", "NUM_CHECK"));
366    $objFormParam->addParam("½»½ê1", "deliv_addr01", STEXT_LEN, "KVa", array("SPTAB_CHECK", "MAX_LENGTH_CHECK"));
367    $objFormParam->addParam("½»½ê2", "deliv_addr02", STEXT_LEN, "KVa", array("SPTAB_CHECK", "MAX_LENGTH_CHECK"));
368    $objFormParam->addParam("ÅÅÏÃÈÖ¹æ1", "deliv_tel01", TEL_ITEM_LEN, "n", array("MAX_LENGTH_CHECK" ,"NUM_CHECK"));
369    $objFormParam->addParam("ÅÅÏÃÈÖ¹æ2", "deliv_tel02", TEL_ITEM_LEN, "n", array("MAX_LENGTH_CHECK" ,"NUM_CHECK"));
370    $objFormParam->addParam("ÅÅÏÃÈÖ¹æ3", "deliv_tel03", TEL_ITEM_LEN, "n", array("MAX_LENGTH_CHECK" ,"NUM_CHECK"));
371    $objFormParam->addParam("¥á¡¼¥ë¥Þ¥¬¥¸¥ó", "mail_flag", INT_LEN, "n", array("MAX_LENGTH_CHECK", "NUM_CHECK"), 1);
372}
373
374/* DB¤Ø¥Ç¡¼¥¿¤ÎÅÐÏ¿ */
375
376/* ÆþÎÏÆâÍƤΥÁ¥§¥Ã¥¯ */
377function lfCheckError() {
378    global $objFormParam;
379    // ÆþÎϥǡ¼¥¿¤òÅϤ¹¡£
380    $arrRet =  $objFormParam->getHashArray();
381    $objErr = new SC_CheckError($arrRet);
382    $objErr->arrErr = $objFormParam->checkError();
383       
384    // Ê̤ΤªÆϤ±Àè¥Á¥§¥Ã¥¯
385    if($_POST['deliv_check'] == "1") {
386        $objErr->doFunc(array("¤ªÌ¾Á°¡ÊÀ«¡Ë", "deliv_name01"), array("EXIST_CHECK"));
387        $objErr->doFunc(array("¤ªÌ¾Á°¡Ê̾¡Ë", "deliv_name02"), array("EXIST_CHECK"));
388        $objErr->doFunc(array("¥Õ¥ê¥¬¥Ê¡Ê¥»¥¤¡Ë", "deliv_kana01"), array("EXIST_CHECK"));
389        $objErr->doFunc(array("¥Õ¥ê¥¬¥Ê¡Ê¥á¥¤¡Ë", "deliv_kana02"), array("EXIST_CHECK"));
390        $objErr->doFunc(array("͹ÊØÈÖ¹æ1", "deliv_zip01"), array("EXIST_CHECK"));
391        $objErr->doFunc(array("͹ÊØÈÖ¹æ2", "deliv_zip02"), array("EXIST_CHECK"));
392        $objErr->doFunc(array("ÅÔÆ»Éܸ©", "deliv_pref"), array("EXIST_CHECK"));
393        $objErr->doFunc(array("½»½ê1", "deliv_addr01"), array("EXIST_CHECK"));
394        $objErr->doFunc(array("½»½ê2", "deliv_addr02"), array("EXIST_CHECK"));
395        $objErr->doFunc(array("ÅÅÏÃÈÖ¹æ1", "deliv_tel01"), array("EXIST_CHECK"));
396        $objErr->doFunc(array("ÅÅÏÃÈÖ¹æ2", "deliv_tel02"), array("EXIST_CHECK"));
397        $objErr->doFunc(array("ÅÅÏÃÈÖ¹æ3", "deliv_tel03"), array("EXIST_CHECK"));
398    }
399   
400    // Ê£¿ô¹àÌÜ¥Á¥§¥Ã¥¯
401    $objErr->doFunc(array("TEL", "order_tel01", "order_tel02", "order_tel03", TEL_ITEM_LEN), array("TEL_CHECK"));
402    $objErr->doFunc(array("FAX", "order_fax01", "order_fax02", "order_fax03", TEL_ITEM_LEN), array("TEL_CHECK"));
403    $objErr->doFunc(array("͹ÊØÈÖ¹æ", "order_zip01", "order_zip02"), array("ALL_EXIST_CHECK"));
404    $objErr->doFunc(array("TEL", "deliv_tel01", "deliv_tel02", "deliv_tel03", TEL_ITEM_LEN), array("TEL_CHECK"));
405    $objErr->doFunc(array("FAX", "deliv_fax01", "deliv_fax02", "deliv_fax03", TEL_ITEM_LEN), array("TEL_CHECK"));
406    $objErr->doFunc(array("͹ÊØÈÖ¹æ", "deliv_zip01", "deliv_zip02"), array("ALL_EXIST_CHECK"));
407    $objErr->doFunc(array("À¸Ç¯·îÆü", "year", "month", "day"), array("CHECK_DATE"));
408    $objErr->doFunc(array("¥á¡¼¥ë¥¢¥É¥ì¥¹", "¥á¡¼¥ë¥¢¥É¥ì¥¹¡Ê³Îǧ¡Ë", "order_email", "order_email_check"), array("EQUAL_CHECK"));
409   
410    // ¤¹¤Ç¤Ë¥á¥ë¥Þ¥¬¥Æ¡¼¥Ö¥ë¤Ë²ñ°÷¤È¤·¤Æ¥á¡¼¥ë¥¢¥É¥ì¥¹¤¬ÅÐÏ¿¤µ¤ì¤Æ¤¤¤ë¾ì¹ç
411    if(sfCheckCustomerMailMaga($arrRet['order_email'])) {
412        $objErr->arrErr['order_email'] = "¤³¤Î¥á¡¼¥ë¥¢¥É¥ì¥¹¤Ï¤¹¤Ç¤ËÅÐÏ¿¤µ¤ì¤Æ¤¤¤Þ¤¹¡£<br>";
413    }
414       
415    return $objErr->arrErr;
416}
417
418
419//-----------------------------NONMEMBER´Ø¿ô·²¢§------------------------------------------------------------------
420//----¡¡¼èÆÀʸ»úÎó¤ÎÊÑ´¹
421function lfConvertParam($array, $arrRegistColumn) {
422    /*
423     *  ʸ»úÎó¤ÎÊÑ´¹
424     *  K :  ¡ÖȾ³Ñ(ŽÊŽÝŽ¶Ž¸)ÊÒ²¾Ì¾¡×¤ò¡ÖÁ´³ÑÊÒ²¾Ì¾¡×¤ËÊÑ´¹
425     *  C :  ¡ÖÁ´³Ñ¤Ò¤é²¾Ì¾¡×¤ò¡ÖÁ´³Ñ¤«¤¿²¾Ì¾¡×¤ËÊÑ´¹
426     *  V :  ÂùÅÀÉÕ¤­¤Îʸ»ú¤ò°ìʸ»ú¤ËÊÑ´¹¡£"K","H"¤È¶¦¤Ë»ÈÍѤ·¤Þ¤¹
427     *  n :  ¡ÖÁ´³Ñ¡×¿ô»ú¤ò¡ÖȾ³Ñ(ŽÊŽÝŽ¶Ž¸)¡×¤ËÊÑ´¹
428     *  a :  Á´³Ñ±Ñ¿ô»ú¤òȾ³Ñ±Ñ¿ô»ú¤ËÊÑ´¹¤¹¤ë
429     */
430    // ¥«¥é¥à̾¤È¥³¥ó¥Ð¡¼¥È¾ðÊó
431    foreach ($arrRegistColumn as $data) {
432        $arrConvList[ $data["column"] ] = $data["convert"];
433    }
434    // ʸ»úÊÑ´¹
435    foreach ($arrConvList as $key => $val) {
436        // POST¤µ¤ì¤Æ¤­¤¿ÃͤΤßÊÑ´¹¤¹¤ë¡£
437        if(strlen(($array[$key])) > 0) {
438            $array[$key] = mb_convert_kana($array[$key] ,$val);
439        }
440    }
441    return $array;
442}
443
444
445//---- ÆþÎÏ¥¨¥é¡¼¥Á¥§¥Ã¥¯
446function lfErrorCheck1($array) {
447
448    global $objConn;
449    $objErr = new SC_CheckError($array);
450   
451    $objErr->doFunc(array("¤ªÌ¾Á°¡ÊÀ«¡Ë", 'name01', STEXT_LEN), array("EXIST_CHECK", "NO_SPTAB", "SPTAB_CHECK" ,"MAX_LENGTH_CHECK"));
452    $objErr->doFunc(array("¤ªÌ¾Á°¡Ê̾¡Ë", 'name02', STEXT_LEN), array("EXIST_CHECK", "NO_SPTAB", "SPTAB_CHECK" , "MAX_LENGTH_CHECK"));
453    $objErr->doFunc(array("¤ªÌ¾Á°¡Ê¥«¥Ê/À«¡Ë", 'kana01', STEXT_LEN), array("EXIST_CHECK", "NO_SPTAB", "SPTAB_CHECK" ,"MAX_LENGTH_CHECK", "KANA_CHECK"));
454    $objErr->doFunc(array("¤ªÌ¾Á°¡Ê¥«¥Ê/̾¡Ë", 'kana02', STEXT_LEN), array("EXIST_CHECK", "NO_SPTAB", "SPTAB_CHECK" ,"MAX_LENGTH_CHECK", "KANA_CHECK"));
455    $objErr->doFunc(array('¥á¡¼¥ë¥¢¥É¥ì¥¹', "email", MTEXT_LEN) ,array("NO_SPTAB", "EXIST_CHECK", "EMAIL_CHECK", "SPTAB_CHECK" ,"EMAIL_CHAR_CHECK", "MAX_LENGTH_CHECK", "MOBILE_EMAIL_CHECK"));
456
457    return $objErr->arrErr;
458}
459
460//---- ÆþÎÏ¥¨¥é¡¼¥Á¥§¥Ã¥¯
461function lfErrorCheck2($array) {
462
463    global $objConn, $objDate;
464    $objErr = new SC_CheckError($array);
465   
466    $objErr->doFunc(array("͹ÊØÈÖ¹æ1", "zip01", ZIP01_LEN ) ,array("EXIST_CHECK", "SPTAB_CHECK" ,"NUM_CHECK", "NUM_COUNT_CHECK"));
467    $objErr->doFunc(array("͹ÊØÈÖ¹æ2", "zip02", ZIP02_LEN ) ,array("EXIST_CHECK", "SPTAB_CHECK" ,"NUM_CHECK", "NUM_COUNT_CHECK"));
468    $objErr->doFunc(array("͹ÊØÈÖ¹æ", "zip01", "zip02"), array("ALL_EXIST_CHECK"));
469
470    $objErr->doFunc(array("À­ÊÌ", "sex") ,array("SELECT_CHECK", "NUM_CHECK"));
471    $objErr->doFunc(array("À¸Ç¯·îÆü (ǯ)", "year", 4), array("EXIST_CHECK", "SPTAB_CHECK", "NUM_CHECK", "NUM_COUNT_CHECK"));
472    if (!isset($objErr->arrErr['year'])) {
473        $objErr->doFunc(array("À¸Ç¯·îÆü (ǯ)", "year", $objDate->getStartYear()), array("MIN_CHECK"));
474        $objErr->doFunc(array("À¸Ç¯·îÆü (ǯ)", "year", $objDate->getEndYear()), array("MAX_CHECK"));
475    }
476    $objErr->doFunc(array("À¸Ç¯·îÆü (·îÆü)", "month", "day"), array("SELECT_CHECK"));
477    if (!isset($objErr->arrErr['year']) && !isset($objErr->arrErr['month']) && !isset($objErr->arrErr['day'])) {
478        $objErr->doFunc(array("À¸Ç¯·îÆü", "year", "month", "day"), array("CHECK_DATE"));
479    }
480   
481    return $objErr->arrErr;
482}
483
484
485//---- ÆþÎÏ¥¨¥é¡¼¥Á¥§¥Ã¥¯
486function lfErrorCheck3($array) {
487
488    global $objConn;
489    $objErr = new SC_CheckError($array);
490   
491    $objErr->doFunc(array("ÅÔÆ»Éܸ©", 'pref'), array("SELECT_CHECK","NUM_CHECK"));
492    $objErr->doFunc(array("»Ô¶èĮ¼", "addr01", MTEXT_LEN), array("EXIST_CHECK","SPTAB_CHECK" ,"MAX_LENGTH_CHECK"));
493    $objErr->doFunc(array("ÈÖÃÏ", "addr02", MTEXT_LEN), array("EXIST_CHECK","SPTAB_CHECK" ,"MAX_LENGTH_CHECK"));
494    $objErr->doFunc(array("ÅÅÏÃÈÖ¹æ1", 'tel01'), array("EXIST_CHECK","SPTAB_CHECK" ));
495    $objErr->doFunc(array("ÅÅÏÃÈÖ¹æ2", 'tel02'), array("EXIST_CHECK","SPTAB_CHECK" ));
496    $objErr->doFunc(array("ÅÅÏÃÈÖ¹æ3", 'tel03'), array("EXIST_CHECK","SPTAB_CHECK" ));
497    $objErr->doFunc(array("ÅÅÏÃÈÖ¹æ", "tel01", "tel02", "tel03",TEL_ITEM_LEN) ,array("TEL_CHECK"));
498   
499    return $objErr->arrErr;
500}
501
502// ͹ÊØÈֹ椫¤é½»½ê¤Î¼èÆÀ
503function lfGetAddress($zipcode) {
504    global $arrPref;
505
506    $conn = new SC_DBconn(ZIP_DSN);
507
508    // ͹ÊØÈֹ渡º÷ʸºîÀ®
509    $zipcode = mb_convert_kana($zipcode ,"n");
510    $sqlse = "SELECT state, city, town FROM mtb_zip WHERE zipcode = ?";
511
512    $data_list = $conn->getAll($sqlse, array($zipcode));
513
514    // ¥¤¥ó¥Ç¥Ã¥¯¥¹¤ÈÃͤòȿž¤µ¤»¤ë¡£
515    $arrREV_PREF = array_flip($arrPref);
516
517    /*
518        Áí̳¾Ê¤«¤é¥À¥¦¥ó¥í¡¼¥É¤·¤¿¥Ç¡¼¥¿¤ò¤½¤Î¤Þ¤Þ¥¤¥ó¥Ý¡¼¥È¤¹¤ë¤È
519        °Ê²¼¤Î¤è¤¦¤Êʸ»úÎó¤¬Æþ¤Ã¤Æ¤¤¤ë¤Î¤Ç   Âкö¤¹¤ë¡£
520        ¡¦¡Ê£±¡¦£±£¹ÃúÌÜ¡Ë
521        ¡¦°Ê²¼¤Ë·ÇºÜ¤¬¤Ê¤¤¾ì¹ç
522    */
523    $town =  $data_list[0]['town'];
524    $town = ereg_replace("¡Ê.*¡Ë$","",$town);
525    $town = ereg_replace("°Ê²¼¤Ë·ÇºÜ¤¬¤Ê¤¤¾ì¹ç","",$town);
526    $data_list[0]['town'] = $town;
527    $data_list[0]['state'] = $arrREV_PREF[$data_list[0]['state']];
528
529    return $data_list;
530}
531//NONMEMBER_´Ø¿ô·²---------------------------------------------------------------------------------------
532?>
Note: See TracBrowser for help on using the repository browser.