source: branches/dev/html/mobile/shopping/nonmember.php @ 12541

Revision 12541, 20.3 KB checked in by nakanishi, 19 years ago (diff)
Line 
1<?php
2/*
3 * Copyright(c) 2000-2006 LOCKON CO.,LTD. All Rights Reserved.
4 *
5 * http://www.lockon.co.jp/
6 */
7
8require_once("../require.php");
9
10class LC_Page {
11    function LC_Page() {
12        $this->tpl_mainpage = 'shopping/nonmember.tpl';        // ¥á¥¤¥ó¥Æ¥ó¥×¥ì¡¼¥È
13        $this->tpl_title .= '¤ªµÒÍ;ðÊóÆþÎÏ(1/3)';            //¡¡¥Ú¡¼¥¸¥¿¥¤¥È¥ë
14    }
15}
16
17//---- ¥Ú¡¼¥¸½é´üÀßÄê
18$CONF = sf_getBasisData();                  // ŹÊÞ´ðËܾðÊó
19$objConn = new SC_DbConn();
20$objPage = new LC_Page();
21$objView = new SC_MobileView();
22$objDate = new SC_Date(START_BIRTH_YEAR, date("Y",strtotime("now")));
23$objPage->arrPref = $arrPref;
24$objPage->arrJob = $arrJob;
25$objPage->arrReminder = $arrReminder;
26$objPage->arrYear = $objDate->getYear('', 1950);    //¡¡ÆüÉÕ¥×¥ë¥À¥¦¥óÀßÄê
27$objPage->arrMonth = $objDate->getMonth();
28$objPage->arrDay = $objDate->getDay();
29
30//SSLURLȽÄê
31if (SSLURL_CHECK == 1){
32    $ssl_url= sfRmDupSlash(MOBILE_SSL_URL.$_SERVER['REQUEST_URI']);
33    if (!ereg("^https://", $non_ssl_url)){
34        sfDispSiteError(URL_ERROR, "", false, "", true);
35    }
36}
37
38// ¥ì¥¤¥¢¥¦¥È¥Ç¥¶¥¤¥ó¤ò¼èÆÀ
39$objPage = sfGetPageLayout($objPage, false, DEF_LAYOUT);
40
41//---- ÅÐÏ¿ÍÑ¥«¥é¥àÇÛÎó
42$arrRegistColumn = array(
43                             array(  "column" => "name01", "convert" => "aKV" ),
44                             array(  "column" => "name02", "convert" => "aKV" ),
45                             array(  "column" => "kana01", "convert" => "CKV" ),
46                             array(  "column" => "kana02", "convert" => "CKV" ),
47                             array(  "column" => "zip01", "convert" => "n" ),
48                             array(  "column" => "zip02", "convert" => "n" ),
49                             array(  "column" => "pref", "convert" => "n" ),
50                             array(  "column" => "addr01", "convert" => "aKV" ),
51                             array(  "column" => "addr02", "convert" => "aKV" ),
52                             array(  "column" => "email", "convert" => "a" ),
53                             array(  "column" => "email2", "convert" => "a" ),
54                             array(  "column" => "email_mobile", "convert" => "a" ),
55                             array(  "column" => "email_mobile2", "convert" => "a" ),
56                             array(  "column" => "tel01", "convert" => "n" ),
57                             array(  "column" => "tel02", "convert" => "n" ),
58                             array(  "column" => "tel03", "convert" => "n" ),
59                             array(  "column" => "fax01", "convert" => "n" ),
60                             array(  "column" => "fax02", "convert" => "n" ),
61                             array(  "column" => "fax03", "convert" => "n" ),
62                             array(  "column" => "sex", "convert" => "n" ),
63                             array(  "column" => "job", "convert" => "n" ),
64                             array(  "column" => "birth", "convert" => "n" ),
65                             array(  "column" => "reminder", "convert" => "n" ),
66                             array(  "column" => "reminder_answer", "convert" => "aKV"),
67                             array(  "column" => "password", "convert" => "a" ),
68                             array(  "column" => "password02", "convert" => "a" ),
69                             array(  "column" => "mailmaga_flg", "convert" => "n" ),
70                         );
71
72//---- ÅÐÏ¿½ü³°ÍÑ¥«¥é¥àÇÛÎó
73//$arrRejectRegistColumn = array("year", "month", "day", "email02", "email_mobile02","password","password02","reminder","reminder_answer");
74$arrRejectRegistColumn = array("year", "month", "day");
75
76if ($_SERVER["REQUEST_METHOD"] == "POST") {
77    //-- POST¥Ç¡¼¥¿¤Î°ú¤­·Ñ¤®
78    $objPage->arrForm = $_POST;
79   
80    if($objPage->arrForm['year'] == '----') {
81        $objPage->arrForm['year'] = '';
82    }
83   
84    //$objPage->arrForm['email'] = strtolower($objPage->arrForm['email']);        // email¤Ï¤¹¤Ù¤Æ¾®Ê¸»ú¤Ç½èÍý
85   
86    //-- ÆþÎϥǡ¼¥¿¤ÎÊÑ´¹
87    $objPage->arrForm = lfConvertParam($objPage->arrForm, $arrRegistColumn);
88
89    // Ìá¤ë¥Ü¥¿¥óÍѽèÍý
90    if (!empty($_POST["return"])) {
91        switch ($_POST["mode"]) {
92        case "complete":
93            $_POST["mode"] = "set3";
94            break;
95        case "confirm":
96            $_POST["mode"] = "set2";
97            break;
98        default:
99            $_POST["mode"] = "set1";
100            break;
101        }
102    }
103
104    //--¡¡ÆþÎÏ¥¨¥é¡¼¥Á¥§¥Ã¥¯
105    if (!empty($_POST["mode"])) {
106            if ($_POST["mode"] == "set1") {
107            $objPage->arrErr = lfErrorCheck1($objPage->arrForm);
108            $objPage->tpl_mainpage = 'shopping/nonmember.tpl';
109            $objPage->tpl_title = '¤ªµÒÍ;ðÊóÆþÎÏ(1/3)';
110        } elseif ($_POST["mode"] == "set2") {
111            $objPage->arrErr = lfErrorCheck2($objPage->arrForm);
112            $objPage->tpl_mainpage = 'shopping/nonmember_set1.tpl';
113            $objPage->tpl_title = '¤ªµÒÍ;ðÊóÆþÎÏ(2/3)';
114        } elseif ($_POST["mode"] == "deliv"){
115            $objPage->arrErr = lfErrorCheck3($objPage->arrForm);
116            $objPage->tpl_mainpage = 'shopping/nonmember_set2.tpl';
117            $objPage->tpl_title = '¤ªµÒÍ;ðÊóÆþÎÏ(3/3)';
118        }
119   
120   foreach($objPage->arrForm as $key => $val) {
121        $objPage->$key = $val;
122        }
123 
124    }
125
126
127    if ($objPage->arrErr || !empty($_POST["return"])) {     // ÆþÎÏ¥¨¥é¡¼¤Î¥Á¥§¥Ã¥¯
128
129        //-- ¥Ç¡¼¥¿¤ÎÀßÄê
130        if ($_POST["mode"] == "set1") {
131            $checkVal = array("email", "name01", "name02", "kana01", "kana02");
132        } elseif ($_POST["mode"] == "set2") {
133            $checkVal = array("sex", "year", "month", "day", "zip01", "zip02");
134        } else {
135            $checkVal = array("pref", "addr01", "addr02", "tel01", "tel02", "tel03", "mail_flag");
136        }
137
138        foreach($objPage->arrForm as $key => $val) {
139            if ($key != "mode" && $key != "submit" && $key != "return" && $key != session_name() && !in_array($key, $checkVal))
140                $objPage->list_data[ $key ] = $val;
141        }
142
143
144
145    } else {
146
147        //--¡¡¥Æ¥ó¥×¥ì¡¼¥ÈÀßÄê
148        if ($_POST["mode"] == "set1") {
149            $objPage->tpl_mainpage = 'shopping/nonmember_set1.tpl';
150            $objPage->tpl_title = '¤ªµÒÍ;ðÊóÆþÎÏ(2/3)';
151        } elseif ($_POST["mode"] == "set2") {
152            $objPage->tpl_mainpage = 'shopping/nonmember_set2.tpl';
153            $objPage->tpl_title = '¤ªµÒÍ;ðÊóÆþÎÏ(3/3)';
154
155            if (@$objPage->arrForm['pref'] == "" && @$objPage->arrForm['addr01'] == "" && @$objPage->arrForm['addr02'] == "") {
156                $address = lfGetAddress($_REQUEST['zip01'].$_REQUEST['zip02']);
157                $objPage->pref = @$address[0]['state'];
158                $objPage->addr01 = @$address[0]['city'] . @$address[0]['town'];
159            }
160        } /*elseif ($_POST["mode"] == "deliv") {
161            //¥Ñ¥¹¥ï¡¼¥Éɽ¼¨
162           
163            //¥á¡¼¥ë¼õ¤±¼è¤ê
164            if (strtolower($objPage->arrForm['mail_flag']) == "on") {
165                $objPage->arrForm['mail_flag']  = "2";
166            } else {
167                $objPage->arrForm['mail_flag']  = "3";
168            }
169
170            $objPage->tpl_mainpage = 'shopping/deliv.tpl';
171            $objPage->tpl_title = '¤ªµÒÍ;ðÊó(³Îǧ¥Ú¡¼¥¸)';
172
173        }*/
174
175        //-- ¥Ç¡¼¥¿ÀßÄê
176        unset($objPage->list_data);
177        if ($_POST["mode"] == "set1") {
178            $checkVal = array("sex", "year", "month", "day", "zip01", "zip02");
179        } elseif ($_POST["mode"] == "set2") {
180            $checkVal = array("pref", "addr01", "addr02", "tel01", "tel02", "tel03", "mail_flag");
181        } else {
182            $checkVal = array();
183        }
184
185        foreach($objPage->arrForm as $key => $val) {
186            if ($key != "mode" && $key != "submit" && $key != "confirm" && $key != "return" && $key != session_name() && !in_array($key, $checkVal)) {
187                $objPage->list_data[ $key ] = $val;
188            }
189        }
190
191        if ($_POST["mode"] == "deliv") {
192           
193            $objFormParam = new SC_FormParam();
194            // ¥Ñ¥é¥á¡¼¥¿¾ðÊó¤Î½é´ü²½
195           
196            // POSTÃͤμèÆÀ
197            $objFormParam->setParam($_POST);
198           
199            // ÆþÎÏÃͤμèÆÀ
200            $objPage->arrForm = $objFormParam->getFormParamList();
201            $objPage->arrErr = $arrErr;
202           
203//            $cnt = 1;
204//            foreach($objOtherAddr as $val) {
205//                $objPage->arrAddr[$cnt] = $val;
206//                $cnt++;
207//            }
208           
209           $objPage->arrAddr[0]['zip01'] = $objPage->zip01;
210           $objPage->arrAddr[0]['zip02'] = $objPage->zip02;
211           $objPage->arrAddr[0]['pref'] = $objPage->pref;
212           $objPage->arrAddr[0]['addr01'] = $objPage->addr01;
213           $objPage->arrAddr[0]['addr02'] = $objPage->addr02;
214           
215            $objPage->tpl_mainpage = 'shopping/deliv.tpl';
216            $objPage->tpl_title = '¤ªÆÏ¤±Àè¾ðÊó';
217        }
218       
219         if ($_POST["mode"] == "customer_addr") {
220
221
222           
223//            $objFormParam = new SC_FormParam();
224//            // ¥Ñ¥é¥á¡¼¥¿¾ðÊó¤Î½é´ü²½
225//           
226//            // POSTÃͤμèÆÀ
227//            $objFormParam->setParam($_POST);
228//           
229//            // ÆþÎÏÃͤμèÆÀ
230//            $objPage->arrForm = $objFormParam->getFormParamList();
231//            $objPage->arrErr = $arrErr;
232//           
233////            $cnt = 1;
234////            foreach($objOtherAddr as $val) {
235////                $objPage->arrAddr[$cnt] = $val;
236////                $cnt++;
237////            }
238//           
239//           $objPage->arrAddr[0]['zip01'] = $objPage->zip01;
240//           $objPage->arrAddr[0]['zip02'] = $objPage->zip02;
241//           $objPage->arrAddr[0]['pref'] = $objPage->pref;
242//           $objPage->arrAddr[0]['addr01'] = $objPage->addr01;
243//           $objPage->arrAddr[0]['addr02'] = $objPage->addr02;
244//           
245//           foreach($objOtherAddr as $val) {
246//               $objPage->arrAddr[$cnt] = $val;
247//               $cnt++;
248//            }
249           header("Location:" . gfAddSessionId("./payment.php"));
250        print($_POST);
251        }
252       
253        //--¡¡²¾ÅÐÏ¿¤È´°Î»²èÌÌ
254        if ($_POST["mode"] == "complete") {
255            //$objPage->uniqid = lfRegistData ($objPage->arrForm, $arrRegistColumn, $arrRejectRegistColumn);
256
257            // ¶õ¥á¡¼¥ë¤ò¼õ¿®ºÑ¤ß¤Î¾ì¹ç¤Ï¤¹¤°¤ËËÜÅÐÏ¿´°Î»¤Ë¤¹¤ë¡£
258            if (isset($_SESSION['mobile']['kara_mail_from'])) {
259                header("Location:" . gfAddSessionId(MOBILE_URL_DIR . "regist/index.php?mode=regist&id=" . $objPage->uniqid));
260                exit;
261            }
262
263            $objPage->tpl_mainpage = 'shopping/complete.tpl';
264            $objPage->tpl_title = '¤ªµÒÍ;ðÊóÆþÎÏ(´°Î»¥Ú¡¼¥¸)';
265
266            /*sfMobileSetExtSessionId('id', $objPage->uniqid, 'regist/index.php');
267
268            //¡¡²¾ÅÐÏ¿´°Î»¥á¡¼¥ëÁ÷¿®
269            $objPage->CONF = $CONF;
270            $objPage->to_name01 = $_POST['name01'];
271            $objPage->to_name02 = $_POST['name02'];
272            $objMailText = new SC_MobileView();
273            $objMailText->assignobj($objPage);
274            $subject = sfMakesubject('¤ªµÒÍ;ðÊó¤Î¤´³Îǧ');
275            $toCustomerMail = $objMailText->fetch("mail_templates/customer_mail.tpl");
276            $objMail = new GC_SendMail();
277            $objMail->setItem(
278                                ''                                  //¡¡°¸Àè
279                                , $subject                          //¡¡¥µ¥Ö¥¸¥§¥¯¥È
280                                , $toCustomerMail                   //¡¡ËÜʸ
281                                , $CONF["email03"]                  //¡¡ÇÛÁ÷¸µ¥¢¥É¥ì¥¹
282                                , $CONF["shop_name"]                //¡¡ÇÛÁ÷¸µ¡¡Ì¾Á°
283                                , $CONF["email03"]                  //¡¡reply_to
284                                , $CONF["email04"]                  //¡¡return_path
285                                , $CONF["email04"]                  //  Errors_to
286                                , $CONF["email01"]                  //  Bcc
287                                                                );
288            // °¸Àè¤ÎÀßÄê
289            $name = $_POST["name01"] . $_POST["name02"] ." ÍÍ";
290            $objMail->setTo($_POST["email"], $name);
291            $objMail->sendMail();
292*/
293            // ´°Î»¥Ú¡¼¥¸¤Ë°Üư¤µ¤»¤ë¡£
294            header("Location:" . gfAddSessionId("./complete.php"));
295            exit;
296        }
297    }
298}
299
300//----¡¡¥Ú¡¼¥¸É½¼¨
301$objView->assignobj($objPage);
302$objView->display(SITE_FRAME);
303
304//----------------------------------------------------------------------------------------------------------------------
305
306//---- function·²
307function lfRegistData ($array, $arrRegistColumn, $arrRejectRegistColumn) {
308    global $objConn;
309
310    // ²¾ÅÐÏ¿
311    foreach ($arrRegistColumn as $data) {
312        if (strlen($array[ $data["column"] ]) > 0 && ! in_array($data["column"], $arrRejectRegistColumn)) {
313            $arrRegist[ $data["column"] ] = $array[ $data["column"] ];
314        }
315    }
316       
317    // ÃÂÀ¸Æü¤¬ÆþÎϤµ¤ì¤Æ¤¤¤ë¾ì¹ç
318    if (strlen($array["year"]) > 0 ) {
319        $arrRegist["birth"] = $array["year"] ."/". $array["month"] ."/". $array["day"] ." 00:00:00";
320    }
321   
322    // ¥Ñ¥¹¥ï¡¼¥É¤Î°Å¹æ²½
323    $arrRegist["password"] = sha1($arrRegist["password"] . ":" . AUTH_MAGIC);
324   
325    $count = 1;
326    while ($count != 0) {
327        $uniqid = sfGetUniqRandomId("t");
328        $count = $objConn->getOne("SELECT COUNT(*) FROM dtb_customer WHERE secret_key = ?", array($uniqid));
329    }
330
331    switch($array["mailmaga_flg"]) {
332        case 1:
333            $arrRegist["mailmaga_flg"] = 4;
334            break;
335        case 2:
336            $arrRegist["mailmaga_flg"] = 5;
337            break;
338        default:
339            $arrRegist["mailmaga_flg"] = 6;
340            break;
341    }
342       
343    $arrRegist["secret_key"] = $uniqid;     // ²¾ÅÐÏ¿IDȯ¹Ô
344    $arrRegist["create_date"] = "now()";    // ºîÀ®Æü
345    $arrRegist["update_date"] = "now()";    // ¹¹¿·Æü
346    $arrRegist["first_buy_date"] = "";      // ºÇ½é¤Î¹ØÆþÆü
347   
348    // ·ÈÂӥ᡼¥ë¥¢¥É¥ì¥¹
349    $arrRegist['email_mobile'] = $arrRegist['email'];
350
351    //-- ²¾ÅÐÏ¿¼Â¹Ô
352    $objConn->query("BEGIN");
353
354    $objQuery = new SC_Query();
355    $objQuery->insert("dtb_customer", $arrRegist);
356
357/* ¥á¥ë¥Þ¥¬²ñ°÷µ¡Ç½¤Ï¸½ºßÄä»ßÃæ¡¡2007/03/07
358    //--¡¡Èó²ñ°÷¤Ç¥á¥ë¥Þ¥¬ÅÐÏ¿¤·¤Æ¤¤¤ë¤«¤ÎȽÄê
359    $sql = "SELECT count(*) FROM dtb_customer_mail WHERE email = ?";
360    $mailResult = $objConn->getOne($sql, array($arrRegist["email"]));
361
362    //--¡¡¥á¥ë¥Þ¥¬²¾ÅÐÏ¿¼Â¹Ô
363    $arrRegistMail["email"] = $arrRegist["email"]; 
364    if ($array["mailmaga_flg"] == 1) {
365        $arrRegistMail["mailmaga_flg"] = 4;
366    } elseif ($array["mailmaga_flg"] == 2) {
367        $arrRegistMail["mailmaga_flg"] = 5;
368    } else {
369        $arrRegistMail["mailmaga_flg"] = 6;
370    }
371    $arrRegistMail["update_date"] = "now()";
372   
373    // Èó²ñ°÷¤Ç¥á¥ë¥Þ¥¬ÅÐÏ¿¤·¤Æ¤¤¤ë¾ì¹ç
374    if ($mailResult == 1) {     
375        $objQuery->update("dtb_customer_mail", $arrRegistMail, "email = '" .addslashes($arrRegistMail["email"]). "'");         
376    } else {                //¡¡¿·µ¬ÅÐÏ¿¤Î¾ì¹ç
377        $arrRegistMail["create_date"] = "now()";
378        $objQuery->insert("dtb_customer_mail", $arrRegistMail);     
379    }
380*/
381    $objConn->query("COMMIT");
382
383    return $uniqid;
384}
385
386//----¡¡¼èÆÀʸ»úÎó¤ÎÊÑ´¹
387function lfConvertParam($array, $arrRegistColumn) {
388    /*
389     *  ʸ»úÎó¤ÎÊÑ´¹
390     *  K :  ¡ÖȾ³Ñ(ŽÊŽÝ޶ޏ)ÊÒ²¾Ì¾¡×¤ò¡ÖÁ´³ÑÊÒ²¾Ì¾¡×¤ËÊÑ´¹
391     *  C :  ¡ÖÁ´³Ñ¤Ò¤é²¾Ì¾¡×¤ò¡ÖÁ´³Ñ¤«¤¿²¾Ì¾¡×¤ËÊÑ´¹
392     *  V :  ÂùÅÀÉÕ¤­¤Îʸ»ú¤ò°ìʸ»ú¤ËÊÑ´¹¡£"K","H"¤È¶¦¤Ë»ÈÍѤ·¤Þ¤¹
393     *  n :  ¡ÖÁ´³Ñ¡×¿ô»ú¤ò¡ÖȾ³Ñ(ŽÊŽÝ޶ޏ)¡×¤ËÊÑ´¹
394     *  a :  Á´³Ñ±Ñ¿ô»ú¤òȾ³Ñ±Ñ¿ô»ú¤ËÊÑ´¹¤¹¤ë
395     */
396    // ¥«¥é¥à̾¤È¥³¥ó¥Ð¡¼¥È¾ðÊó
397    foreach ($arrRegistColumn as $data) {
398        $arrConvList[ $data["column"] ] = $data["convert"];
399    }
400    // ʸ»úÊÑ´¹
401    foreach ($arrConvList as $key => $val) {
402        // POST¤µ¤ì¤Æ¤­¤¿ÃͤΤßÊÑ´¹¤¹¤ë¡£
403        if(strlen(($array[$key])) > 0) {
404            $array[$key] = mb_convert_kana($array[$key] ,$val);
405        }
406    }
407    return $array;
408}
409
410//---- ÆþÎÏ¥¨¥é¡¼¥Á¥§¥Ã¥¯
411function lfErrorCheck1($array) {
412
413    global $objConn;
414    $objErr = new SC_CheckError($array);
415   
416    $objErr->doFunc(array("¤ªÌ¾Á°¡ÊÀ«¡Ë", 'name01', STEXT_LEN), array("EXIST_CHECK", "NO_SPTAB", "SPTAB_CHECK" ,"MAX_LENGTH_CHECK"));
417    $objErr->doFunc(array("¤ªÌ¾Á°¡Ê̾¡Ë", 'name02', STEXT_LEN), array("EXIST_CHECK", "NO_SPTAB", "SPTAB_CHECK" , "MAX_LENGTH_CHECK"));
418    $objErr->doFunc(array("¤ªÌ¾Á°¡Ê¥«¥Ê/À«¡Ë", 'kana01', STEXT_LEN), array("EXIST_CHECK", "NO_SPTAB", "SPTAB_CHECK" ,"MAX_LENGTH_CHECK", "KANA_CHECK"));
419    $objErr->doFunc(array("¤ªÌ¾Á°¡Ê¥«¥Ê/̾¡Ë", 'kana02', STEXT_LEN), array("EXIST_CHECK", "NO_SPTAB", "SPTAB_CHECK" ,"MAX_LENGTH_CHECK", "KANA_CHECK"));
420    $objErr->doFunc(array('¥á¡¼¥ë¥¢¥É¥ì¥¹', "email", MTEXT_LEN) ,array("NO_SPTAB", "EXIST_CHECK", "EMAIL_CHECK", "SPTAB_CHECK" ,"EMAIL_CHAR_CHECK", "MAX_LENGTH_CHECK", "MOBILE_EMAIL_CHECK"));
421
422    //¸½²ñ°÷¤ÎȽÄê ¢ª¡¡¸½²ñ°÷¤â¤·¤¯¤Ï²¾ÅÐÏ¿Ãæ¤Ï¡¢¥á¥¢¥É°ì°Õ¤¬Á°Äó¤Ë¤Ê¤Ã¤Æ¤ë¤Î¤ÇƱ¤¸¥á¥¢¥É¤ÇÅÐÏ¿ÉÔ²Ä
423
424    return $objErr->arrErr;
425}
426
427//---- ÆþÎÏ¥¨¥é¡¼¥Á¥§¥Ã¥¯
428function lfErrorCheck2($array) {
429
430    global $objConn, $objDate;
431    $objErr = new SC_CheckError($array);
432   
433    $objErr->doFunc(array("Í¹ÊØÈÖ¹æ1", "zip01", ZIP01_LEN ) ,array("EXIST_CHECK", "SPTAB_CHECK" ,"NUM_CHECK", "NUM_COUNT_CHECK"));
434    $objErr->doFunc(array("Í¹ÊØÈÖ¹æ2", "zip02", ZIP02_LEN ) ,array("EXIST_CHECK", "SPTAB_CHECK" ,"NUM_CHECK", "NUM_COUNT_CHECK"));
435    $objErr->doFunc(array("Í¹ÊØÈÖ¹æ", "zip01", "zip02"), array("ALL_EXIST_CHECK"));
436
437    $objErr->doFunc(array("À­ÊÌ", "sex") ,array("SELECT_CHECK", "NUM_CHECK"));
438    $objErr->doFunc(array("À¸Ç¯·îÆü (ǯ)", "year", 4), array("EXIST_CHECK", "SPTAB_CHECK", "NUM_CHECK", "NUM_COUNT_CHECK"));
439    if (!isset($objErr->arrErr['year'])) {
440        $objErr->doFunc(array("À¸Ç¯·îÆü (ǯ)", "year", $objDate->getStartYear()), array("MIN_CHECK"));
441        $objErr->doFunc(array("À¸Ç¯·îÆü (ǯ)", "year", $objDate->getEndYear()), array("MAX_CHECK"));
442    }
443    $objErr->doFunc(array("À¸Ç¯·îÆü (·îÆü)", "month", "day"), array("SELECT_CHECK"));
444    if (!isset($objErr->arrErr['year']) && !isset($objErr->arrErr['month']) && !isset($objErr->arrErr['day'])) {
445        $objErr->doFunc(array("À¸Ç¯·îÆü", "year", "month", "day"), array("CHECK_DATE"));
446    }
447   
448    return $objErr->arrErr;
449}
450
451//---- ÆþÎÏ¥¨¥é¡¼¥Á¥§¥Ã¥¯
452function lfErrorCheck3($array) {
453
454    global $objConn;
455    $objErr = new SC_CheckError($array);
456   
457    $objErr->doFunc(array("ÅÔÆ»Éܸ©", 'pref'), array("SELECT_CHECK","NUM_CHECK"));
458    $objErr->doFunc(array("»Ô¶èĮ¼", "addr01", MTEXT_LEN), array("EXIST_CHECK","SPTAB_CHECK" ,"MAX_LENGTH_CHECK"));
459    $objErr->doFunc(array("ÈÖÃÏ", "addr02", MTEXT_LEN), array("EXIST_CHECK","SPTAB_CHECK" ,"MAX_LENGTH_CHECK"));
460    $objErr->doFunc(array("ÅÅÏÃÈÖ¹æ1", 'tel01'), array("EXIST_CHECK","SPTAB_CHECK" ));
461    $objErr->doFunc(array("ÅÅÏÃÈÖ¹æ2", 'tel02'), array("EXIST_CHECK","SPTAB_CHECK" ));
462    $objErr->doFunc(array("ÅÅÏÃÈÖ¹æ3", 'tel03'), array("EXIST_CHECK","SPTAB_CHECK" ));
463    $objErr->doFunc(array("ÅÅÏÃÈÖ¹æ", "tel01", "tel02", "tel03",TEL_ITEM_LEN) ,array("TEL_CHECK"));
464   
465    return $objErr->arrErr;
466}
467
468//³Îǧ¥Ú¡¼¥¸Íѥѥ¹¥ï¡¼¥Éɽ¼¨ÍÑ
469
470function lfPassLen($passlen){
471    $ret = "";
472    for ($i=0;$i<$passlen;true){
473    $ret.="*";
474    $i++;
475    }
476    return $ret;
477}
478
479
480// Í¹ÊØÈֹ椫¤é½»½ê¤Î¼èÆÀ
481function lfGetAddress($zipcode) {
482    global $arrPref;
483
484    $conn = new SC_DBconn(ZIP_DSN);
485
486    // Í¹ÊØÈֹ渡º÷ʸºîÀ®
487    $zipcode = mb_convert_kana($zipcode ,"n");
488    $sqlse = "SELECT state, city, town FROM mtb_zip WHERE zipcode = ?";
489
490    $data_list = $conn->getAll($sqlse, array($zipcode));
491
492    // ¥¤¥ó¥Ç¥Ã¥¯¥¹¤ÈÃͤòȿž¤µ¤»¤ë¡£
493    $arrREV_PREF = array_flip($arrPref);
494
495    /*
496        Áí̳¾Ê¤«¤é¥À¥¦¥ó¥í¡¼¥É¤·¤¿¥Ç¡¼¥¿¤ò¤½¤Î¤Þ¤Þ¥¤¥ó¥Ý¡¼¥È¤¹¤ë¤È
497        °Ê²¼¤Î¤è¤¦¤Êʸ»úÎ󤬯þ¤Ã¤Æ¤¤¤ë¤Î¤Ç   Âкö¤¹¤ë¡£
498        ¡¦¡Ê£±¡¦£±£¹ÃúÌÜ¡Ë
499        ¡¦°Ê²¼¤Ë·ÇºÜ¤¬¤Ê¤¤¾ì¹ç
500    */
501    $town =  $data_list[0]['town'];
502    $town = ereg_replace("¡Ê.*¡Ë$","",$town);
503    $town = ereg_replace("°Ê²¼¤Ë·ÇºÜ¤¬¤Ê¤¤¾ì¹ç","",$town);
504    $data_list[0]['town'] = $town;
505    $data_list[0]['state'] = $arrREV_PREF[$data_list[0]['state']];
506
507    return $data_list;
508}
509
510//-----------------------------------------------------------------------------------------------------------------------------------
511?>
Note: See TracBrowser for help on using the repository browser.