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

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