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

Revision 12725, 28.7 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           
354//           $objPage->arrAddr[0]['zip01'] = $_POST['zip01'];
355//           $objPage->arrAddr[0]['zip02'] = $_POST['zip02'];
356//           $objPage->arrAddr[0]['pref'] = $_POST['pref'];
357//           $objPage->arrAddr[0]['addr01'] = $_POST['addr01'];
358//           $objPage->arrAddr[0]['addr02'] = $_POST['addr02'];
359           
360//            $cnt = 1;
361//            foreach($objOtherAddr as $val) {
362//                $objPage->arrAddr[$cnt] = $val;
363//                $cnt++;
364//            }
365         
366            lfRegistData($objPage->tpl_uniqid);
367           
368            lfCopyDeliv($objPage->tpl_uniqid, $_POST);
369           
370           
371           
372            $objPage->tpl_mainpage = 'nonmember/nonmember_deliv.tpl';
373            $objPage->tpl_title = '¤ªÆϤ±Àè¾ðÊó';
374        }
375       
376         if ($_POST["mode2"] == "customer_addr") {
377            //print_r($_POST);
378            if ($_POST['deli'] != "") {
379           
380                     
381           lfRegistData($objPage->tpl_uniqid);
382           header("Location:" . gfAddSessionId("./payment.php"));
383            exit;
384    }else{
385        // ¥¨¥é¡¼¤òÊÖ¤¹
386        $arrErr['deli'] = '¢¨ ¤ªÆϤ±Àè¤òÁªÂò¤·¤Æ¤¯¤À¤µ¤¤¡£';
387    }
388    break;
389        }
390    }
391
392    return $objPage;
393}
394
395
396function lfRegistData($uniqid) {
397    global $objFormParam;
398    $arrRet = $objFormParam->getHashArray();
399    $sqlval = $objFormParam->getDbArray();
400   
401    // ÅÐÏ¿¥Ç¡¼¥¿¤ÎºîÀ®
402    $sqlval['order_temp_id'] = $uniqid;
403    $sqlval['order_birth'] = sfGetTimestamp($arrRet['year'], $arrRet['month'], $arrRet['day']);
404    $sqlval['update_date'] = 'Now()';
405    $sqlval['customer_id'] = '0';
406    $sqlval['order_name01'] = "test";
407         
408    print_r($sqlval);
409    // ´û¸¥Ç¡¼¥¿¤Î¥Á¥§¥Ã¥¯
410    $objQuery = new SC_Query();
411    $where = "order_temp_id = ?";
412    $cnt = $objQuery->count("dtb_order_temp", $where, array($uniqid));
413    // ´û¸¥Ç¡¼¥¿¤¬¤Ê¤¤¾ì¹ç
414    if ($cnt == 0) {
415        $sqlval['create_date'] = 'Now()';
416        $objQuery->insert("dtb_order_temp", $sqlval);
417    } else {
418        $objQuery->update("dtb_order_temp", $sqlval, $where, array($uniqid));
419    }
420}
421
422/* ¥Ñ¥é¥á¡¼¥¿¾ðÊó¤Î½é´ü²½ */
423function lfInitParam() {
424    global $objFormParam;
425    $objFormParam->addParam("¤ªÌ¾Á°¡ÊÀ«¡Ë", "order_name01", STEXT_LEN, "KVa", array("EXIST_CHECK", "SPTAB_CHECK", "MAX_LENGTH_CHECK"));
426    $objFormParam->addParam("¤ªÌ¾Á°¡Ê̾¡Ë", "order_name02", STEXT_LEN, "KVa", array("EXIST_CHECK", "SPTAB_CHECK", "MAX_LENGTH_CHECK"));
427    $objFormParam->addParam("¥Õ¥ê¥¬¥Ê¡Ê¥»¥¤¡Ë", "order_kana01", STEXT_LEN, "KVCa", array("EXIST_CHECK", "SPTAB_CHECK", "MAX_LENGTH_CHECK"));
428    $objFormParam->addParam("¥Õ¥ê¥¬¥Ê¡Ê¥á¥¤¡Ë", "order_kana02", STEXT_LEN, "KVCa", array("EXIST_CHECK", "SPTAB_CHECK", "MAX_LENGTH_CHECK"));
429    $objFormParam->addParam("͹ÊØÈÖ¹æ1", "order_zip01", ZIP01_LEN, "n", array("EXIST_CHECK", "NUM_CHECK", "NUM_COUNT_CHECK"));
430    $objFormParam->addParam("͹ÊØÈÖ¹æ2", "order_zip02", ZIP02_LEN, "n", array("EXIST_CHECK", "NUM_CHECK", "NUM_COUNT_CHECK"));
431    $objFormParam->addParam("ÅÔÆ»Éܸ©", "order_pref", INT_LEN, "n", array("EXIST_CHECK", "MAX_LENGTH_CHECK", "NUM_CHECK"));
432    $objFormParam->addParam("½»½ê1", "order_addr01", STEXT_LEN, "KVa", array("EXIST_CHECK", "SPTAB_CHECK", "MAX_LENGTH_CHECK"));
433    $objFormParam->addParam("½»½ê2", "order_addr02", STEXT_LEN, "KVa", array("EXIST_CHECK", "SPTAB_CHECK", "MAX_LENGTH_CHECK"));
434    $objFormParam->addParam("ÅÅÏÃÈÖ¹æ1", "order_tel01", TEL_ITEM_LEN, "n", array("EXIST_CHECK", "MAX_LENGTH_CHECK" ,"NUM_CHECK"));
435    $objFormParam->addParam("ÅÅÏÃÈÖ¹æ2", "order_tel02", TEL_ITEM_LEN, "n", array("EXIST_CHECK", "MAX_LENGTH_CHECK" ,"NUM_CHECK"));
436    $objFormParam->addParam("ÅÅÏÃÈÖ¹æ3", "order_tel03", TEL_ITEM_LEN, "n", array("EXIST_CHECK", "MAX_LENGTH_CHECK" ,"NUM_CHECK"));
437    $objFormParam->addParam("FAXÈÖ¹æ1", "order_fax01", TEL_ITEM_LEN, "n", array("MAX_LENGTH_CHECK" ,"NUM_CHECK"));
438    $objFormParam->addParam("FAXÈÖ¹æ2", "order_fax02", TEL_ITEM_LEN, "n", array("MAX_LENGTH_CHECK" ,"NUM_CHECK"));
439    $objFormParam->addParam("FAXÈÖ¹æ3", "order_fax03", TEL_ITEM_LEN, "n", array("MAX_LENGTH_CHECK" ,"NUM_CHECK"));
440    $objFormParam->addParam("¥á¡¼¥ë¥¢¥É¥ì¥¹", "order_email", STEXT_LEN, "KVa", array("EXIST_CHECK", "SPTAB_CHECK", "NO_SPTAB", "MAX_LENGTH_CHECK", "EMAIL_CHECK", "EMAIL_CHAR_CHECK"));
441    $objFormParam->addParam("¥á¡¼¥ë¥¢¥É¥ì¥¹¡Ê³Îǧ¡Ë", "order_email_check", STEXT_LEN, "KVa", array("EXIST_CHECK", "SPTAB_CHECK", "NO_SPTAB", "MAX_LENGTH_CHECK", "EMAIL_CHECK", "EMAIL_CHAR_CHECK"), "", false);
442    $objFormParam->addParam("ǯ", "year", INT_LEN, "n", array("MAX_LENGTH_CHECK"), "", false);
443    $objFormParam->addParam("·î", "month", INT_LEN, "n", array("MAX_LENGTH_CHECK"), "", false);
444    $objFormParam->addParam("Æü", "day", INT_LEN, "n", array("MAX_LENGTH_CHECK"), "", false);
445    $objFormParam->addParam("À­ÊÌ", "order_sex", INT_LEN, "n", array("EXIST_CHECK", "MAX_LENGTH_CHECK", "NUM_CHECK"));
446    $objFormParam->addParam("¿¦¶È", "order_job", INT_LEN, "n", array("MAX_LENGTH_CHECK", "NUM_CHECK"));
447    $objFormParam->addParam("Ê̤ΤªÆϤ±Àè", "deliv_check", INT_LEN, "n", array("MAX_LENGTH_CHECK", "NUM_CHECK"));
448    $objFormParam->addParam("¤ªÌ¾Á°¡ÊÀ«¡Ë", "deliv_name01", STEXT_LEN, "KVa", array("SPTAB_CHECK", "MAX_LENGTH_CHECK"));
449    $objFormParam->addParam("¤ªÌ¾Á°¡Ê̾¡Ë", "deliv_name02", STEXT_LEN, "KVa", array("SPTAB_CHECK", "MAX_LENGTH_CHECK"));
450    $objFormParam->addParam("¥Õ¥ê¥¬¥Ê¡Ê¥»¥¤¡Ë", "deliv_kana01", STEXT_LEN, "KVCa", array("SPTAB_CHECK", "MAX_LENGTH_CHECK"));
451    $objFormParam->addParam("¥Õ¥ê¥¬¥Ê¡Ê¥á¥¤¡Ë", "deliv_kana02", STEXT_LEN, "KVCa", array("SPTAB_CHECK", "MAX_LENGTH_CHECK"));
452    $objFormParam->addParam("͹ÊØÈÖ¹æ1", "deliv_zip01", ZIP01_LEN, "n", array("NUM_CHECK", "NUM_COUNT_CHECK"));
453    $objFormParam->addParam("͹ÊØÈÖ¹æ2", "deliv_zip02", ZIP02_LEN, "n", array("NUM_CHECK", "NUM_COUNT_CHECK"));
454    $objFormParam->addParam("ÅÔÆ»Éܸ©", "deliv_pref", INT_LEN, "n", array("MAX_LENGTH_CHECK", "NUM_CHECK"));
455    $objFormParam->addParam("½»½ê1", "deliv_addr01", STEXT_LEN, "KVa", array("SPTAB_CHECK", "MAX_LENGTH_CHECK"));
456    $objFormParam->addParam("½»½ê2", "deliv_addr02", STEXT_LEN, "KVa", array("SPTAB_CHECK", "MAX_LENGTH_CHECK"));
457    $objFormParam->addParam("ÅÅÏÃÈÖ¹æ1", "deliv_tel01", TEL_ITEM_LEN, "n", array("MAX_LENGTH_CHECK" ,"NUM_CHECK"));
458    $objFormParam->addParam("ÅÅÏÃÈÖ¹æ2", "deliv_tel02", TEL_ITEM_LEN, "n", array("MAX_LENGTH_CHECK" ,"NUM_CHECK"));
459    $objFormParam->addParam("ÅÅÏÃÈÖ¹æ3", "deliv_tel03", TEL_ITEM_LEN, "n", array("MAX_LENGTH_CHECK" ,"NUM_CHECK"));
460    $objFormParam->addParam("¥á¡¼¥ë¥Þ¥¬¥¸¥ó", "mail_flag", INT_LEN, "n", array("MAX_LENGTH_CHECK", "NUM_CHECK"), 1);
461}
462
463/* DB¤Ø¥Ç¡¼¥¿¤ÎÅÐÏ¿ */
464
465
466/* ÆþÎÏÆâÍƤΥÁ¥§¥Ã¥¯ */
467function lfCheckError() {
468    global $objFormParam;
469    // ÆþÎϥǡ¼¥¿¤òÅϤ¹¡£
470    $arrRet =  $objFormParam->getHashArray();
471    $objErr = new SC_CheckError($arrRet);
472    $objErr->arrErr = $objFormParam->checkError();
473       
474    // Ê̤ΤªÆϤ±Àè¥Á¥§¥Ã¥¯
475    if($_POST['deliv_check'] == "1") {
476        $objErr->doFunc(array("¤ªÌ¾Á°¡ÊÀ«¡Ë", "deliv_name01"), array("EXIST_CHECK"));
477        $objErr->doFunc(array("¤ªÌ¾Á°¡Ê̾¡Ë", "deliv_name02"), array("EXIST_CHECK"));
478        $objErr->doFunc(array("¥Õ¥ê¥¬¥Ê¡Ê¥»¥¤¡Ë", "deliv_kana01"), array("EXIST_CHECK"));
479        $objErr->doFunc(array("¥Õ¥ê¥¬¥Ê¡Ê¥á¥¤¡Ë", "deliv_kana02"), array("EXIST_CHECK"));
480        $objErr->doFunc(array("͹ÊØÈÖ¹æ1", "deliv_zip01"), array("EXIST_CHECK"));
481        $objErr->doFunc(array("͹ÊØÈÖ¹æ2", "deliv_zip02"), array("EXIST_CHECK"));
482        $objErr->doFunc(array("ÅÔÆ»Éܸ©", "deliv_pref"), array("EXIST_CHECK"));
483        $objErr->doFunc(array("½»½ê1", "deliv_addr01"), array("EXIST_CHECK"));
484        $objErr->doFunc(array("½»½ê2", "deliv_addr02"), array("EXIST_CHECK"));
485        $objErr->doFunc(array("ÅÅÏÃÈÖ¹æ1", "deliv_tel01"), array("EXIST_CHECK"));
486        $objErr->doFunc(array("ÅÅÏÃÈÖ¹æ2", "deliv_tel02"), array("EXIST_CHECK"));
487        $objErr->doFunc(array("ÅÅÏÃÈÖ¹æ3", "deliv_tel03"), array("EXIST_CHECK"));
488    }
489   
490    // Ê£¿ô¹àÌÜ¥Á¥§¥Ã¥¯
491    $objErr->doFunc(array("TEL", "order_tel01", "order_tel02", "order_tel03", TEL_ITEM_LEN), array("TEL_CHECK"));
492    $objErr->doFunc(array("FAX", "order_fax01", "order_fax02", "order_fax03", TEL_ITEM_LEN), array("TEL_CHECK"));
493    $objErr->doFunc(array("͹ÊØÈÖ¹æ", "order_zip01", "order_zip02"), array("ALL_EXIST_CHECK"));
494    $objErr->doFunc(array("TEL", "deliv_tel01", "deliv_tel02", "deliv_tel03", TEL_ITEM_LEN), array("TEL_CHECK"));
495    $objErr->doFunc(array("FAX", "deliv_fax01", "deliv_fax02", "deliv_fax03", TEL_ITEM_LEN), array("TEL_CHECK"));
496    $objErr->doFunc(array("͹ÊØÈÖ¹æ", "deliv_zip01", "deliv_zip02"), array("ALL_EXIST_CHECK"));
497    $objErr->doFunc(array("À¸Ç¯·îÆü", "year", "month", "day"), array("CHECK_DATE"));
498    $objErr->doFunc(array("¥á¡¼¥ë¥¢¥É¥ì¥¹", "¥á¡¼¥ë¥¢¥É¥ì¥¹¡Ê³Îǧ¡Ë", "order_email", "order_email_check"), array("EQUAL_CHECK"));
499   
500    // ¤¹¤Ç¤Ë¥á¥ë¥Þ¥¬¥Æ¡¼¥Ö¥ë¤Ë²ñ°÷¤È¤·¤Æ¥á¡¼¥ë¥¢¥É¥ì¥¹¤¬ÅÐÏ¿¤µ¤ì¤Æ¤¤¤ë¾ì¹ç
501    if(sfCheckCustomerMailMaga($arrRet['order_email'])) {
502        $objErr->arrErr['order_email'] = "¤³¤Î¥á¡¼¥ë¥¢¥É¥ì¥¹¤Ï¤¹¤Ç¤ËÅÐÏ¿¤µ¤ì¤Æ¤¤¤Þ¤¹¡£<br>";
503    }
504       
505    return $objErr->arrErr;
506}
507
508// ¼õÃí°ì»þ¥Æ¡¼¥Ö¥ë¤Î¤ªÆϤ±Àè¤ò¥³¥Ô¡¼¤¹¤ë
509function lfCopyDeliv($uniqid, $arrData) {
510    $objQuery = new SC_Query();
511   
512    // Ê̤ΤªÆϤ±Àè¤ò»ØÄꤷ¤Æ¤¤¤Ê¤¤¾ì¹ç¡¢ÇÛÁ÷Àè¤ËÅÐÏ¿½»½ê¤ò¥³¥Ô¡¼¤¹¤ë¡£
513    if($arrData["deliv_check"] != "1") {
514        $sqlval['deliv_name01'] = $arrData['order_name01'];
515        $sqlval['deliv_name02'] = $arrData['order_name02'];
516        $sqlval['deliv_kana01'] = $arrData['order_kana01'];
517        $sqlval['deliv_kana02'] = $arrData['order_kana02'];
518        $sqlval['deliv_pref'] = $arrData['order_pref'];
519        $sqlval['deliv_zip01'] = $arrData['order_zip01'];
520        $sqlval['deliv_zip02'] = $arrData['order_zip02'];
521        $sqlval['deliv_addr01'] = $arrData['order_addr01'];
522        $sqlval['deliv_addr02'] = $arrData['order_addr02'];
523        $sqlval['deliv_tel01'] = $arrData['order_tel01'];
524        $sqlval['deliv_tel02'] = $arrData['order_tel02'];
525        $sqlval['deliv_tel03'] = $arrData['order_tel03'];
526        $where = "order_temp_id = ?";
527        $objQuery->update("dtb_order_temp", $sqlval, $where, array($uniqid));
528    }
529}
530
531//-----------------------------NONMEMBER´Ø¿ô·²¢§------------------------------------------------------------------
532//----¡¡¼èÆÀʸ»úÎó¤ÎÊÑ´¹
533function lfConvertParam($array, $arrRegistColumn) {
534    /*
535     *  ʸ»úÎó¤ÎÊÑ´¹
536     *  K :  ¡ÖȾ³Ñ(ŽÊŽÝŽ¶Ž¸)ÊÒ²¾Ì¾¡×¤ò¡ÖÁ´³ÑÊÒ²¾Ì¾¡×¤ËÊÑ´¹
537     *  C :  ¡ÖÁ´³Ñ¤Ò¤é²¾Ì¾¡×¤ò¡ÖÁ´³Ñ¤«¤¿²¾Ì¾¡×¤ËÊÑ´¹
538     *  V :  ÂùÅÀÉÕ¤­¤Îʸ»ú¤ò°ìʸ»ú¤ËÊÑ´¹¡£"K","H"¤È¶¦¤Ë»ÈÍѤ·¤Þ¤¹
539     *  n :  ¡ÖÁ´³Ñ¡×¿ô»ú¤ò¡ÖȾ³Ñ(ŽÊŽÝŽ¶Ž¸)¡×¤ËÊÑ´¹
540     *  a :  Á´³Ñ±Ñ¿ô»ú¤òȾ³Ñ±Ñ¿ô»ú¤ËÊÑ´¹¤¹¤ë
541     */
542    // ¥«¥é¥à̾¤È¥³¥ó¥Ð¡¼¥È¾ðÊó
543    foreach ($arrRegistColumn as $data) {
544        $arrConvList[ $data["column"] ] = $data["convert"];
545    }
546    // ʸ»úÊÑ´¹
547    foreach ($arrConvList as $key => $val) {
548        // POST¤µ¤ì¤Æ¤­¤¿ÃͤΤßÊÑ´¹¤¹¤ë¡£
549        if(strlen(($array[$key])) > 0) {
550            $array[$key] = mb_convert_kana($array[$key] ,$val);
551        }
552    }
553    return $array;
554}
555
556//---- ÆþÎÏ¥¨¥é¡¼¥Á¥§¥Ã¥¯
557function lfErrorCheck1($array) {
558
559    global $objConn;
560    $objErr = new SC_CheckError($array);
561   
562    $objErr->doFunc(array("¤ªÌ¾Á°¡ÊÀ«¡Ë", 'name01', STEXT_LEN), array("EXIST_CHECK", "NO_SPTAB", "SPTAB_CHECK" ,"MAX_LENGTH_CHECK"));
563    $objErr->doFunc(array("¤ªÌ¾Á°¡Ê̾¡Ë", 'name02', STEXT_LEN), array("EXIST_CHECK", "NO_SPTAB", "SPTAB_CHECK" , "MAX_LENGTH_CHECK"));
564    $objErr->doFunc(array("¤ªÌ¾Á°¡Ê¥«¥Ê/À«¡Ë", 'kana01', STEXT_LEN), array("EXIST_CHECK", "NO_SPTAB", "SPTAB_CHECK" ,"MAX_LENGTH_CHECK", "KANA_CHECK"));
565    $objErr->doFunc(array("¤ªÌ¾Á°¡Ê¥«¥Ê/̾¡Ë", 'kana02', STEXT_LEN), array("EXIST_CHECK", "NO_SPTAB", "SPTAB_CHECK" ,"MAX_LENGTH_CHECK", "KANA_CHECK"));
566    $objErr->doFunc(array('¥á¡¼¥ë¥¢¥É¥ì¥¹', "email", MTEXT_LEN) ,array("NO_SPTAB", "EXIST_CHECK", "EMAIL_CHECK", "SPTAB_CHECK" ,"EMAIL_CHAR_CHECK", "MAX_LENGTH_CHECK", "MOBILE_EMAIL_CHECK"));
567
568    return $objErr->arrErr;
569}
570
571//---- ÆþÎÏ¥¨¥é¡¼¥Á¥§¥Ã¥¯
572function lfErrorCheck2($array) {
573
574    global $objConn, $objDate;
575    $objErr = new SC_CheckError($array);
576   
577    $objErr->doFunc(array("͹ÊØÈÖ¹æ1", "zip01", ZIP01_LEN ) ,array("EXIST_CHECK", "SPTAB_CHECK" ,"NUM_CHECK", "NUM_COUNT_CHECK"));
578    $objErr->doFunc(array("͹ÊØÈÖ¹æ2", "zip02", ZIP02_LEN ) ,array("EXIST_CHECK", "SPTAB_CHECK" ,"NUM_CHECK", "NUM_COUNT_CHECK"));
579    $objErr->doFunc(array("͹ÊØÈÖ¹æ", "zip01", "zip02"), array("ALL_EXIST_CHECK"));
580
581    $objErr->doFunc(array("À­ÊÌ", "sex") ,array("SELECT_CHECK", "NUM_CHECK"));
582    $objErr->doFunc(array("À¸Ç¯·îÆü (ǯ)", "year", 4), array("EXIST_CHECK", "SPTAB_CHECK", "NUM_CHECK", "NUM_COUNT_CHECK"));
583    if (!isset($objErr->arrErr['year'])) {
584        $objErr->doFunc(array("À¸Ç¯·îÆü (ǯ)", "year", $objDate->getStartYear()), array("MIN_CHECK"));
585        $objErr->doFunc(array("À¸Ç¯·îÆü (ǯ)", "year", $objDate->getEndYear()), array("MAX_CHECK"));
586    }
587    $objErr->doFunc(array("À¸Ç¯·îÆü (·îÆü)", "month", "day"), array("SELECT_CHECK"));
588    if (!isset($objErr->arrErr['year']) && !isset($objErr->arrErr['month']) && !isset($objErr->arrErr['day'])) {
589        $objErr->doFunc(array("À¸Ç¯·îÆü", "year", "month", "day"), array("CHECK_DATE"));
590    }
591   
592    return $objErr->arrErr;
593}
594
595
596//---- ÆþÎÏ¥¨¥é¡¼¥Á¥§¥Ã¥¯
597function lfErrorCheck3($array) {
598
599    global $objConn;
600    $objErr = new SC_CheckError($array);
601   
602    $objErr->doFunc(array("ÅÔÆ»Éܸ©", 'pref'), array("SELECT_CHECK","NUM_CHECK"));
603    $objErr->doFunc(array("»Ô¶èĮ¼", "addr01", MTEXT_LEN), array("EXIST_CHECK","SPTAB_CHECK" ,"MAX_LENGTH_CHECK"));
604    $objErr->doFunc(array("ÈÖÃÏ", "addr02", MTEXT_LEN), array("EXIST_CHECK","SPTAB_CHECK" ,"MAX_LENGTH_CHECK"));
605    $objErr->doFunc(array("ÅÅÏÃÈÖ¹æ1", 'tel01'), array("EXIST_CHECK","SPTAB_CHECK" ));
606    $objErr->doFunc(array("ÅÅÏÃÈÖ¹æ2", 'tel02'), array("EXIST_CHECK","SPTAB_CHECK" ));
607    $objErr->doFunc(array("ÅÅÏÃÈÖ¹æ3", 'tel03'), array("EXIST_CHECK","SPTAB_CHECK" ));
608    $objErr->doFunc(array("ÅÅÏÃÈÖ¹æ", "tel01", "tel02", "tel03",TEL_ITEM_LEN) ,array("TEL_CHECK"));
609   
610    return $objErr->arrErr;
611}
612
613// ͹ÊØÈֹ椫¤é½»½ê¤Î¼èÆÀ
614function lfGetAddress($zipcode) {
615    global $arrPref;
616
617    $conn = new SC_DBconn(ZIP_DSN);
618
619    // ͹ÊØÈֹ渡º÷ʸºîÀ®
620    $zipcode = mb_convert_kana($zipcode ,"n");
621    $sqlse = "SELECT state, city, town FROM mtb_zip WHERE zipcode = ?";
622
623    $data_list = $conn->getAll($sqlse, array($zipcode));
624
625    // ¥¤¥ó¥Ç¥Ã¥¯¥¹¤ÈÃͤòȿž¤µ¤»¤ë¡£
626    $arrREV_PREF = array_flip($arrPref);
627
628    /*
629        Áí̳¾Ê¤«¤é¥À¥¦¥ó¥í¡¼¥É¤·¤¿¥Ç¡¼¥¿¤ò¤½¤Î¤Þ¤Þ¥¤¥ó¥Ý¡¼¥È¤¹¤ë¤È
630        °Ê²¼¤Î¤è¤¦¤Êʸ»úÎó¤¬Æþ¤Ã¤Æ¤¤¤ë¤Î¤Ç   Âкö¤¹¤ë¡£
631        ¡¦¡Ê£±¡¦£±£¹ÃúÌÜ¡Ë
632        ¡¦°Ê²¼¤Ë·ÇºÜ¤¬¤Ê¤¤¾ì¹ç
633    */
634    $town =  $data_list[0]['town'];
635    $town = ereg_replace("¡Ê.*¡Ë$","",$town);
636    $town = ereg_replace("°Ê²¼¤Ë·ÇºÜ¤¬¤Ê¤¤¾ì¹ç","",$town);
637    $data_list[0]['town'] = $town;
638    $data_list[0]['state'] = $arrREV_PREF[$data_list[0]['state']];
639
640    return $data_list;
641}
642//NONMEMBER_´Ø¿ô·²---------------------------------------------------------------------------------------
643?>
Note: See TracBrowser for help on using the repository browser.