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

Revision 14956, 24.3 KB checked in by nakanishi, 15 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            sfprintr($objPage->arrForm);
227            $objPage->arrErr = lfErrorCheck3($objPage->arrForm);
228            $objPage->tpl_mainpage = 'nonmember/nonmember_set3.tpl';
229            $objPage->tpl_title = '¤ªµÒÍ;ðÊóÆþÎÏ(3/3)';
230        }
231   
232    //¥Õ¥©¡¼¥à¤ÎÃͤò$objPage¤Î¥­¡¼¤È¤·¤ÆÂåÆþ¤·¤Æ¤¤¤¯
233   foreach($objPage->arrForm as $key => $val) {
234        $objPage->$key = $val;
235        }
236    }
237
238        // ÆþÎÏ¥¨¥é¡¼¤Î¥Á¥§¥Ã¥¯
239    if ($objPage->arrErr || !empty($_POST["return"])) {     
240        sfprintr($objPage->arrForm);exit;
241        //-- ¥Ç¡¼¥¿¤ÎÀßÄê
242        if ($_POST["mode2"] == "set2") {
243            $checkVal = array("email", "name01", "name02", "kana01", "kana02");
244        } elseif ($_POST["mode2"] == "set3") {
245            $checkVal = array("sex", "year", "month", "day", "zip01", "zip02");
246        } else {
247            sfprintr($objPage->arrForm);exit;
248            $checkVal = array("pref", "addr01", "addr02", "tel01", "tel02", "tel03", "mail_flag");
249        }
250
251        foreach($objPage->arrForm as $key => $val) {
252            if ($key != "mode2" && $key != "submit" && $key != "return" && $key != session_name() && !in_array($key, $checkVal))
253                $objPage->list_data[ $key ] = $val;
254        }
255
256    } else {
257
258        //--¡¡¥Æ¥ó¥×¥ì¡¼¥ÈÀßÄê
259        if ($_POST["mode2"] == "set2") {
260           
261            $objPage->tpl_mainpage = 'nonmember/nonmember_set2.tpl';
262            $objPage->tpl_title = '¤ªµÒÍ;ðÊóÆþÎÏ(2/3)';
263        } elseif ($_POST["mode2"] == "set3") {
264            $objPage->tpl_mainpage = 'nonmember/nonmember_set3.tpl';
265            $objPage->tpl_title = '¤ªµÒÍ;ðÊóÆþÎÏ(3/3)';
266
267            if (@$objPage->arrForm['pref'] == "" && @$objPage->arrForm['addr01'] == "" && @$objPage->arrForm['addr02'] == "") {
268                $address = lfGetAddress($_REQUEST['zip01'].$_REQUEST['zip02']);
269                $objPage->pref = @$address[0]['state'];
270                $objPage->addr01 = @$address[0]['city'] . @$address[0]['town'];
271            }
272        }
273        //sfprintr($objPage);
274        //-- ¥Ç¡¼¥¿ÀßÄê
275        unset($objPage->list_data);
276        if ($_POST["mode2"] == "set2") {
277            $checkVal = array("sex", "year", "month", "day", "zip01", "zip02");
278        } elseif ($_POST["mode2"] == "set3") {
279            $checkVal = array("pref", "addr01", "addr02", "tel01", "tel02", "tel03", "mail_flag");
280        } else {
281            $checkVal = array();
282        }
283
284        //$objPage->arrForm¥Õ¥©¡¼¥à¤ÎÃͤòlist¤Ë³ÊǼ
285        foreach($objPage->arrForm as $key => $val) {
286            if ($key != "mode2" && $key != "submit" && $key != "confirm" && $key != "return" && $key != session_name() && !in_array($key, $checkVal)) {
287                $objPage->list_data[ $key ] = $val;
288            }
289        }
290       
291        //header("Location:" . gfAddSessionId("./deliv.php"));
292       
293    }
294    return $objPage;
295}
296
297
298/**
299 * regist data function
300 *
301 * @param string $uniqid this parameter is unique ID of user.
302 *
303 *
304 */
305 //¥Ç¡¼¥¿¤ÎÅÐÏ¿¤ò¹Ô¤¦
306//function lfRegistData($uniqid) {
307//    global $objFormParam;
308//    $arrRet = $objFormParam->getHashArray();
309//    $sqlval = $objFormParam->getDbArray();
310//    sfprintr($arrRet);exit;
311//    // ÅÐÏ¿¥Ç¡¼¥¿¤ÎºîÀ®
312//    $sqlval['order_temp_id'] = $uniqid;
313//    $sqlval['order_birth'] = sfGetTimestamp($arrRet['year'], $arrRet['month'], $arrRet['day']);
314//    $sqlval['update_date'] = 'Now()';
315//    $sqlval['customer_id'] = '0';
316//    $sqlval['order_name01'] = $objPage->arrAddr[0]['name01'];
317//         
318//    // ´û¸¥Ç¡¼¥¿¤Î¥Á¥§¥Ã¥¯
319//    $objQuery = new SC_Query();
320//    $where = "order_temp_id = ?";
321//    $cnt = $objQuery->count("dtb_order_temp", $where, array($uniqid));
322//    // ´û¸¥Ç¡¼¥¿¤¬¤Ê¤¤¾ì¹ç
323//    if ($cnt == 0) {
324//        $sqlval['create_date'] = 'Now()';
325//        $objQuery->insert("dtb_order_temp", $sqlval);
326//    } else {
327//        $objQuery->update("dtb_order_temp", $sqlval, $where, array($uniqid));
328//    }
329//}
330
331
332/* ¥Ñ¥é¥á¡¼¥¿¾ðÊó¤Î½é´ü²½ */
333function lfInitParam() {
334    global $objFormParam;
335    $objFormParam->addParam("¤ªÌ¾Á°¡ÊÀ«¡Ë", "order_name01", STEXT_LEN, "KVa", array("EXIST_CHECK", "SPTAB_CHECK", "MAX_LENGTH_CHECK"));
336    $objFormParam->addParam("¤ªÌ¾Á°¡Ê̾¡Ë", "order_name02", STEXT_LEN, "KVa", array("EXIST_CHECK", "SPTAB_CHECK", "MAX_LENGTH_CHECK"));
337    $objFormParam->addParam("¥Õ¥ê¥¬¥Ê¡Ê¥»¥¤¡Ë", "order_kana01", STEXT_LEN, "KVCa", array("EXIST_CHECK", "SPTAB_CHECK", "MAX_LENGTH_CHECK"));
338    $objFormParam->addParam("¥Õ¥ê¥¬¥Ê¡Ê¥á¥¤¡Ë", "order_kana02", STEXT_LEN, "KVCa", array("EXIST_CHECK", "SPTAB_CHECK", "MAX_LENGTH_CHECK"));
339    $objFormParam->addParam("͹ÊØÈÖ¹æ1", "order_zip01", ZIP01_LEN, "n", array("EXIST_CHECK", "NUM_CHECK", "NUM_COUNT_CHECK"));
340    $objFormParam->addParam("͹ÊØÈÖ¹æ2", "order_zip02", ZIP02_LEN, "n", array("EXIST_CHECK", "NUM_CHECK", "NUM_COUNT_CHECK"));
341    $objFormParam->addParam("ÅÔÆ»Éܸ©", "order_pref", INT_LEN, "n", array("EXIST_CHECK", "MAX_LENGTH_CHECK", "NUM_CHECK"));
342    $objFormParam->addParam("½»½ê1", "order_addr01", STEXT_LEN, "KVa", array("EXIST_CHECK", "SPTAB_CHECK", "MAX_LENGTH_CHECK"));
343    $objFormParam->addParam("½»½ê2", "order_addr02", STEXT_LEN, "KVa", array("EXIST_CHECK", "SPTAB_CHECK", "MAX_LENGTH_CHECK"));
344    $objFormParam->addParam("ÅÅÏÃÈÖ¹æ1", "order_tel01", TEL_ITEM_LEN, "n", array("EXIST_CHECK", "MAX_LENGTH_CHECK" ,"NUM_CHECK"));
345    $objFormParam->addParam("ÅÅÏÃÈÖ¹æ2", "order_tel02", TEL_ITEM_LEN, "n", array("EXIST_CHECK", "MAX_LENGTH_CHECK" ,"NUM_CHECK"));
346    $objFormParam->addParam("ÅÅÏÃÈÖ¹æ3", "order_tel03", TEL_ITEM_LEN, "n", array("EXIST_CHECK", "MAX_LENGTH_CHECK" ,"NUM_CHECK"));
347    $objFormParam->addParam("FAXÈÖ¹æ1", "order_fax01", TEL_ITEM_LEN, "n", array("MAX_LENGTH_CHECK" ,"NUM_CHECK"));
348    $objFormParam->addParam("FAXÈÖ¹æ2", "order_fax02", TEL_ITEM_LEN, "n", array("MAX_LENGTH_CHECK" ,"NUM_CHECK"));
349    $objFormParam->addParam("FAXÈÖ¹æ3", "order_fax03", TEL_ITEM_LEN, "n", array("MAX_LENGTH_CHECK" ,"NUM_CHECK"));
350    $objFormParam->addParam("¥á¡¼¥ë¥¢¥É¥ì¥¹", "order_email", STEXT_LEN, "KVa", array("EXIST_CHECK", "SPTAB_CHECK", "NO_SPTAB", "MAX_LENGTH_CHECK", "EMAIL_CHECK", "EMAIL_CHAR_CHECK"));
351    $objFormParam->addParam("¥á¡¼¥ë¥¢¥É¥ì¥¹¡Ê³Îǧ¡Ë", "order_email_check", STEXT_LEN, "KVa", array("EXIST_CHECK", "SPTAB_CHECK", "NO_SPTAB", "MAX_LENGTH_CHECK", "EMAIL_CHECK", "EMAIL_CHAR_CHECK"), "", false);
352    $objFormParam->addParam("ǯ", "year", INT_LEN, "n", array("MAX_LENGTH_CHECK"), "", false);
353    $objFormParam->addParam("·î", "month", INT_LEN, "n", array("MAX_LENGTH_CHECK"), "", false);
354    $objFormParam->addParam("Æü", "day", INT_LEN, "n", array("MAX_LENGTH_CHECK"), "", false);
355    $objFormParam->addParam("À­ÊÌ", "order_sex", INT_LEN, "n", array("EXIST_CHECK", "MAX_LENGTH_CHECK", "NUM_CHECK"));
356    $objFormParam->addParam("¿¦¶È", "order_job", INT_LEN, "n", array("MAX_LENGTH_CHECK", "NUM_CHECK"));
357    $objFormParam->addParam("Ê̤ΤªÆϤ±Àè", "deliv_check", INT_LEN, "n", array("MAX_LENGTH_CHECK", "NUM_CHECK"));
358    $objFormParam->addParam("¤ªÌ¾Á°¡ÊÀ«¡Ë", "deliv_name01", STEXT_LEN, "KVa", array("SPTAB_CHECK", "MAX_LENGTH_CHECK"));
359    $objFormParam->addParam("¤ªÌ¾Á°¡Ê̾¡Ë", "deliv_name02", STEXT_LEN, "KVa", array("SPTAB_CHECK", "MAX_LENGTH_CHECK"));
360    $objFormParam->addParam("¥Õ¥ê¥¬¥Ê¡Ê¥»¥¤¡Ë", "deliv_kana01", STEXT_LEN, "KVCa", array("SPTAB_CHECK", "MAX_LENGTH_CHECK"));
361    $objFormParam->addParam("¥Õ¥ê¥¬¥Ê¡Ê¥á¥¤¡Ë", "deliv_kana02", STEXT_LEN, "KVCa", array("SPTAB_CHECK", "MAX_LENGTH_CHECK"));
362    $objFormParam->addParam("͹ÊØÈÖ¹æ1", "deliv_zip01", ZIP01_LEN, "n", array("NUM_CHECK", "NUM_COUNT_CHECK"));
363    $objFormParam->addParam("͹ÊØÈÖ¹æ2", "deliv_zip02", ZIP02_LEN, "n", array("NUM_CHECK", "NUM_COUNT_CHECK"));
364    $objFormParam->addParam("ÅÔÆ»Éܸ©", "deliv_pref", INT_LEN, "n", array("MAX_LENGTH_CHECK", "NUM_CHECK"));
365    $objFormParam->addParam("½»½ê1", "deliv_addr01", STEXT_LEN, "KVa", array("SPTAB_CHECK", "MAX_LENGTH_CHECK"));
366    $objFormParam->addParam("½»½ê2", "deliv_addr02", STEXT_LEN, "KVa", array("SPTAB_CHECK", "MAX_LENGTH_CHECK"));
367    $objFormParam->addParam("ÅÅÏÃÈÖ¹æ1", "deliv_tel01", TEL_ITEM_LEN, "n", array("MAX_LENGTH_CHECK" ,"NUM_CHECK"));
368    $objFormParam->addParam("ÅÅÏÃÈÖ¹æ2", "deliv_tel02", TEL_ITEM_LEN, "n", array("MAX_LENGTH_CHECK" ,"NUM_CHECK"));
369    $objFormParam->addParam("ÅÅÏÃÈÖ¹æ3", "deliv_tel03", TEL_ITEM_LEN, "n", array("MAX_LENGTH_CHECK" ,"NUM_CHECK"));
370    $objFormParam->addParam("¥á¡¼¥ë¥Þ¥¬¥¸¥ó", "mail_flag", INT_LEN, "n", array("MAX_LENGTH_CHECK", "NUM_CHECK"), 1);
371}
372
373/* DB¤Ø¥Ç¡¼¥¿¤ÎÅÐÏ¿ */
374
375/* ÆþÎÏÆâÍƤΥÁ¥§¥Ã¥¯ */
376function lfCheckError() {
377    global $objFormParam;
378    // ÆþÎϥǡ¼¥¿¤òÅϤ¹¡£
379    $arrRet =  $objFormParam->getHashArray();
380    $objErr = new SC_CheckError($arrRet);
381    $objErr->arrErr = $objFormParam->checkError();
382       
383    // Ê̤ΤªÆϤ±Àè¥Á¥§¥Ã¥¯
384    if($_POST['deliv_check'] == "1") {
385        $objErr->doFunc(array("¤ªÌ¾Á°¡ÊÀ«¡Ë", "deliv_name01"), array("EXIST_CHECK"));
386        $objErr->doFunc(array("¤ªÌ¾Á°¡Ê̾¡Ë", "deliv_name02"), array("EXIST_CHECK"));
387        $objErr->doFunc(array("¥Õ¥ê¥¬¥Ê¡Ê¥»¥¤¡Ë", "deliv_kana01"), array("EXIST_CHECK"));
388        $objErr->doFunc(array("¥Õ¥ê¥¬¥Ê¡Ê¥á¥¤¡Ë", "deliv_kana02"), array("EXIST_CHECK"));
389        $objErr->doFunc(array("͹ÊØÈÖ¹æ1", "deliv_zip01"), array("EXIST_CHECK"));
390        $objErr->doFunc(array("͹ÊØÈÖ¹æ2", "deliv_zip02"), array("EXIST_CHECK"));
391        $objErr->doFunc(array("ÅÔÆ»Éܸ©", "deliv_pref"), array("EXIST_CHECK"));
392        $objErr->doFunc(array("½»½ê1", "deliv_addr01"), array("EXIST_CHECK"));
393        $objErr->doFunc(array("½»½ê2", "deliv_addr02"), array("EXIST_CHECK"));
394        $objErr->doFunc(array("ÅÅÏÃÈÖ¹æ1", "deliv_tel01"), array("EXIST_CHECK"));
395        $objErr->doFunc(array("ÅÅÏÃÈÖ¹æ2", "deliv_tel02"), array("EXIST_CHECK"));
396        $objErr->doFunc(array("ÅÅÏÃÈÖ¹æ3", "deliv_tel03"), array("EXIST_CHECK"));
397    }
398   
399    // Ê£¿ô¹àÌÜ¥Á¥§¥Ã¥¯
400    $objErr->doFunc(array("TEL", "order_tel01", "order_tel02", "order_tel03", TEL_ITEM_LEN), array("TEL_CHECK"));
401    $objErr->doFunc(array("FAX", "order_fax01", "order_fax02", "order_fax03", TEL_ITEM_LEN), array("TEL_CHECK"));
402    $objErr->doFunc(array("͹ÊØÈÖ¹æ", "order_zip01", "order_zip02"), array("ALL_EXIST_CHECK"));
403    $objErr->doFunc(array("TEL", "deliv_tel01", "deliv_tel02", "deliv_tel03", TEL_ITEM_LEN), array("TEL_CHECK"));
404    $objErr->doFunc(array("FAX", "deliv_fax01", "deliv_fax02", "deliv_fax03", TEL_ITEM_LEN), array("TEL_CHECK"));
405    $objErr->doFunc(array("͹ÊØÈÖ¹æ", "deliv_zip01", "deliv_zip02"), array("ALL_EXIST_CHECK"));
406    $objErr->doFunc(array("À¸Ç¯·îÆü", "year", "month", "day"), array("CHECK_DATE"));
407    $objErr->doFunc(array("¥á¡¼¥ë¥¢¥É¥ì¥¹", "¥á¡¼¥ë¥¢¥É¥ì¥¹¡Ê³Îǧ¡Ë", "order_email", "order_email_check"), array("EQUAL_CHECK"));
408   
409    // ¤¹¤Ç¤Ë¥á¥ë¥Þ¥¬¥Æ¡¼¥Ö¥ë¤Ë²ñ°÷¤È¤·¤Æ¥á¡¼¥ë¥¢¥É¥ì¥¹¤¬ÅÐÏ¿¤µ¤ì¤Æ¤¤¤ë¾ì¹ç
410    if(sfCheckCustomerMailMaga($arrRet['order_email'])) {
411        $objErr->arrErr['order_email'] = "¤³¤Î¥á¡¼¥ë¥¢¥É¥ì¥¹¤Ï¤¹¤Ç¤ËÅÐÏ¿¤µ¤ì¤Æ¤¤¤Þ¤¹¡£<br>";
412    }
413       
414    return $objErr->arrErr;
415}
416
417
418//-----------------------------NONMEMBER´Ø¿ô·²¢§------------------------------------------------------------------
419//----¡¡¼èÆÀʸ»úÎó¤ÎÊÑ´¹
420function lfConvertParam($array, $arrRegistColumn) {
421    /*
422     *  ʸ»úÎó¤ÎÊÑ´¹
423     *  K :  ¡ÖȾ³Ñ(ŽÊŽÝŽ¶Ž¸)ÊÒ²¾Ì¾¡×¤ò¡ÖÁ´³ÑÊÒ²¾Ì¾¡×¤ËÊÑ´¹
424     *  C :  ¡ÖÁ´³Ñ¤Ò¤é²¾Ì¾¡×¤ò¡ÖÁ´³Ñ¤«¤¿²¾Ì¾¡×¤ËÊÑ´¹
425     *  V :  ÂùÅÀÉÕ¤­¤Îʸ»ú¤ò°ìʸ»ú¤ËÊÑ´¹¡£"K","H"¤È¶¦¤Ë»ÈÍѤ·¤Þ¤¹
426     *  n :  ¡ÖÁ´³Ñ¡×¿ô»ú¤ò¡ÖȾ³Ñ(ŽÊŽÝŽ¶Ž¸)¡×¤ËÊÑ´¹
427     *  a :  Á´³Ñ±Ñ¿ô»ú¤òȾ³Ñ±Ñ¿ô»ú¤ËÊÑ´¹¤¹¤ë
428     */
429    // ¥«¥é¥à̾¤È¥³¥ó¥Ð¡¼¥È¾ðÊó
430    foreach ($arrRegistColumn as $data) {
431        $arrConvList[ $data["column"] ] = $data["convert"];
432    }
433    // ʸ»úÊÑ´¹
434    foreach ($arrConvList as $key => $val) {
435        // POST¤µ¤ì¤Æ¤­¤¿ÃͤΤßÊÑ´¹¤¹¤ë¡£
436        if(strlen(($array[$key])) > 0) {
437            $array[$key] = mb_convert_kana($array[$key] ,$val);
438        }
439    }
440    return $array;
441}
442
443
444//---- ÆþÎÏ¥¨¥é¡¼¥Á¥§¥Ã¥¯
445function lfErrorCheck1($array) {
446
447    global $objConn;
448    $objErr = new SC_CheckError($array);
449   
450    $objErr->doFunc(array("¤ªÌ¾Á°¡ÊÀ«¡Ë", 'name01', STEXT_LEN), array("EXIST_CHECK", "NO_SPTAB", "SPTAB_CHECK" ,"MAX_LENGTH_CHECK"));
451    $objErr->doFunc(array("¤ªÌ¾Á°¡Ê̾¡Ë", 'name02', STEXT_LEN), array("EXIST_CHECK", "NO_SPTAB", "SPTAB_CHECK" , "MAX_LENGTH_CHECK"));
452    $objErr->doFunc(array("¤ªÌ¾Á°¡Ê¥«¥Ê/À«¡Ë", 'kana01', STEXT_LEN), array("EXIST_CHECK", "NO_SPTAB", "SPTAB_CHECK" ,"MAX_LENGTH_CHECK", "KANA_CHECK"));
453    $objErr->doFunc(array("¤ªÌ¾Á°¡Ê¥«¥Ê/̾¡Ë", 'kana02', STEXT_LEN), array("EXIST_CHECK", "NO_SPTAB", "SPTAB_CHECK" ,"MAX_LENGTH_CHECK", "KANA_CHECK"));
454    $objErr->doFunc(array('¥á¡¼¥ë¥¢¥É¥ì¥¹', "email", MTEXT_LEN) ,array("NO_SPTAB", "EXIST_CHECK", "EMAIL_CHECK", "SPTAB_CHECK" ,"EMAIL_CHAR_CHECK", "MAX_LENGTH_CHECK", "MOBILE_EMAIL_CHECK"));
455
456    return $objErr->arrErr;
457}
458
459//---- ÆþÎÏ¥¨¥é¡¼¥Á¥§¥Ã¥¯
460function lfErrorCheck2($array) {
461
462    global $objConn, $objDate;
463    $objErr = new SC_CheckError($array);
464   
465    $objErr->doFunc(array("͹ÊØÈÖ¹æ1", "zip01", ZIP01_LEN ) ,array("EXIST_CHECK", "SPTAB_CHECK" ,"NUM_CHECK", "NUM_COUNT_CHECK"));
466    $objErr->doFunc(array("͹ÊØÈÖ¹æ2", "zip02", ZIP02_LEN ) ,array("EXIST_CHECK", "SPTAB_CHECK" ,"NUM_CHECK", "NUM_COUNT_CHECK"));
467    $objErr->doFunc(array("͹ÊØÈÖ¹æ", "zip01", "zip02"), array("ALL_EXIST_CHECK"));
468
469    $objErr->doFunc(array("À­ÊÌ", "sex") ,array("SELECT_CHECK", "NUM_CHECK"));
470    $objErr->doFunc(array("À¸Ç¯·îÆü (ǯ)", "year", 4), array("EXIST_CHECK", "SPTAB_CHECK", "NUM_CHECK", "NUM_COUNT_CHECK"));
471    if (!isset($objErr->arrErr['year'])) {
472        $objErr->doFunc(array("À¸Ç¯·îÆü (ǯ)", "year", $objDate->getStartYear()), array("MIN_CHECK"));
473        $objErr->doFunc(array("À¸Ç¯·îÆü (ǯ)", "year", $objDate->getEndYear()), array("MAX_CHECK"));
474    }
475    $objErr->doFunc(array("À¸Ç¯·îÆü (·îÆü)", "month", "day"), array("SELECT_CHECK"));
476    if (!isset($objErr->arrErr['year']) && !isset($objErr->arrErr['month']) && !isset($objErr->arrErr['day'])) {
477        $objErr->doFunc(array("À¸Ç¯·îÆü", "year", "month", "day"), array("CHECK_DATE"));
478    }
479   
480    return $objErr->arrErr;
481}
482
483
484//---- ÆþÎÏ¥¨¥é¡¼¥Á¥§¥Ã¥¯
485function lfErrorCheck3($array) {
486
487    global $objConn;
488    $objErr = new SC_CheckError($array);
489   
490    $objErr->doFunc(array("ÅÔÆ»Éܸ©", 'pref'), array("SELECT_CHECK","NUM_CHECK"));
491    $objErr->doFunc(array("»Ô¶èĮ¼", "addr01", MTEXT_LEN), array("EXIST_CHECK","SPTAB_CHECK" ,"MAX_LENGTH_CHECK"));
492    $objErr->doFunc(array("ÈÖÃÏ", "addr02", MTEXT_LEN), array("EXIST_CHECK","SPTAB_CHECK" ,"MAX_LENGTH_CHECK"));
493    $objErr->doFunc(array("ÅÅÏÃÈÖ¹æ1", 'tel01'), array("EXIST_CHECK","SPTAB_CHECK" ));
494    $objErr->doFunc(array("ÅÅÏÃÈÖ¹æ2", 'tel02'), array("EXIST_CHECK","SPTAB_CHECK" ));
495    $objErr->doFunc(array("ÅÅÏÃÈÖ¹æ3", 'tel03'), array("EXIST_CHECK","SPTAB_CHECK" ));
496    $objErr->doFunc(array("ÅÅÏÃÈÖ¹æ", "tel01", "tel02", "tel03",TEL_ITEM_LEN) ,array("TEL_CHECK"));
497   
498    return $objErr->arrErr;
499}
500
501// ͹ÊØÈֹ椫¤é½»½ê¤Î¼èÆÀ
502function lfGetAddress($zipcode) {
503    global $arrPref;
504
505    $conn = new SC_DBconn(ZIP_DSN);
506
507    // ͹ÊØÈֹ渡º÷ʸºîÀ®
508    $zipcode = mb_convert_kana($zipcode ,"n");
509    $sqlse = "SELECT state, city, town FROM mtb_zip WHERE zipcode = ?";
510
511    $data_list = $conn->getAll($sqlse, array($zipcode));
512
513    // ¥¤¥ó¥Ç¥Ã¥¯¥¹¤ÈÃͤòȿž¤µ¤»¤ë¡£
514    $arrREV_PREF = array_flip($arrPref);
515
516    /*
517        Áí̳¾Ê¤«¤é¥À¥¦¥ó¥í¡¼¥É¤·¤¿¥Ç¡¼¥¿¤ò¤½¤Î¤Þ¤Þ¥¤¥ó¥Ý¡¼¥È¤¹¤ë¤È
518        °Ê²¼¤Î¤è¤¦¤Êʸ»úÎó¤¬Æþ¤Ã¤Æ¤¤¤ë¤Î¤Ç   Âкö¤¹¤ë¡£
519        ¡¦¡Ê£±¡¦£±£¹ÃúÌÜ¡Ë
520        ¡¦°Ê²¼¤Ë·ÇºÜ¤¬¤Ê¤¤¾ì¹ç
521    */
522    $town =  $data_list[0]['town'];
523    $town = ereg_replace("¡Ê.*¡Ë$","",$town);
524    $town = ereg_replace("°Ê²¼¤Ë·ÇºÜ¤¬¤Ê¤¤¾ì¹ç","",$town);
525    $data_list[0]['town'] = $town;
526    $data_list[0]['state'] = $arrREV_PREF[$data_list[0]['state']];
527
528    return $data_list;
529}
530//NONMEMBER_´Ø¿ô·²---------------------------------------------------------------------------------------
531?>
Note: See TracBrowser for help on using the repository browser.