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

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