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

Revision 12501, 19.1 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        } else {
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] = $objPage->zip01;
211           //$objPage->arrAddr[2] = $objPage->pref;
212           //$objPage->arrAddr[3] = $objPage->pref;
213            //print($objPage->zip01.$objPage->zip02);
214           print($objPage->arrAddr[0]);
215           
216            $objPage->tpl_mainpage = 'shopping/deliv.tpl';
217            $objPage->tpl_title = '¤ªÆÏ¤±Àè¾ðÊó';
218        }
219       
220        //--¡¡²¾ÅÐÏ¿¤È´°Î»²èÌÌ
221        if ($_POST["mode"] == "complete") {
222            //$objPage->uniqid = lfRegistData ($objPage->arrForm, $arrRegistColumn, $arrRejectRegistColumn);
223
224            // ¶õ¥á¡¼¥ë¤ò¼õ¿®ºÑ¤ß¤Î¾ì¹ç¤Ï¤¹¤°¤ËËÜÅÐÏ¿´°Î»¤Ë¤¹¤ë¡£
225            if (isset($_SESSION['mobile']['kara_mail_from'])) {
226                header("Location:" . gfAddSessionId(MOBILE_URL_DIR . "regist/index.php?mode=regist&id=" . $objPage->uniqid));
227                exit;
228            }
229
230            $objPage->tpl_mainpage = 'shopping/complete.tpl';
231            $objPage->tpl_title = '¤ªµÒÍ;ðÊóÆþÎÏ(´°Î»¥Ú¡¼¥¸)';
232
233            /*sfMobileSetExtSessionId('id', $objPage->uniqid, 'regist/index.php');
234
235            //¡¡²¾ÅÐÏ¿´°Î»¥á¡¼¥ëÁ÷¿®
236            $objPage->CONF = $CONF;
237            $objPage->to_name01 = $_POST['name01'];
238            $objPage->to_name02 = $_POST['name02'];
239            $objMailText = new SC_MobileView();
240            $objMailText->assignobj($objPage);
241            $subject = sfMakesubject('¤ªµÒÍ;ðÊó¤Î¤´³Îǧ');
242            $toCustomerMail = $objMailText->fetch("mail_templates/customer_mail.tpl");
243            $objMail = new GC_SendMail();
244            $objMail->setItem(
245                                ''                                  //¡¡°¸Àè
246                                , $subject                          //¡¡¥µ¥Ö¥¸¥§¥¯¥È
247                                , $toCustomerMail                   //¡¡ËÜʸ
248                                , $CONF["email03"]                  //¡¡ÇÛÁ÷¸µ¥¢¥É¥ì¥¹
249                                , $CONF["shop_name"]                //¡¡ÇÛÁ÷¸µ¡¡Ì¾Á°
250                                , $CONF["email03"]                  //¡¡reply_to
251                                , $CONF["email04"]                  //¡¡return_path
252                                , $CONF["email04"]                  //  Errors_to
253                                , $CONF["email01"]                  //  Bcc
254                                                                );
255            // °¸Àè¤ÎÀßÄê
256            $name = $_POST["name01"] . $_POST["name02"] ." ÍÍ";
257            $objMail->setTo($_POST["email"], $name);
258            $objMail->sendMail();
259*/
260            // ´°Î»¥Ú¡¼¥¸¤Ë°Üư¤µ¤»¤ë¡£
261            header("Location:" . gfAddSessionId("./complete.php"));
262            exit;
263        }
264    }
265}
266
267//----¡¡¥Ú¡¼¥¸É½¼¨
268$objView->assignobj($objPage);
269$objView->display(SITE_FRAME);
270
271//----------------------------------------------------------------------------------------------------------------------
272
273//---- function·²
274function lfRegistData ($array, $arrRegistColumn, $arrRejectRegistColumn) {
275    global $objConn;
276
277    // ²¾ÅÐÏ¿
278    foreach ($arrRegistColumn as $data) {
279        if (strlen($array[ $data["column"] ]) > 0 && ! in_array($data["column"], $arrRejectRegistColumn)) {
280            $arrRegist[ $data["column"] ] = $array[ $data["column"] ];
281        }
282    }
283       
284    // ÃÂÀ¸Æü¤¬ÆþÎϤµ¤ì¤Æ¤¤¤ë¾ì¹ç
285    if (strlen($array["year"]) > 0 ) {
286        $arrRegist["birth"] = $array["year"] ."/". $array["month"] ."/". $array["day"] ." 00:00:00";
287    }
288   
289    // ¥Ñ¥¹¥ï¡¼¥É¤Î°Å¹æ²½
290    $arrRegist["password"] = sha1($arrRegist["password"] . ":" . AUTH_MAGIC);
291   
292    $count = 1;
293    while ($count != 0) {
294        $uniqid = sfGetUniqRandomId("t");
295        $count = $objConn->getOne("SELECT COUNT(*) FROM dtb_customer WHERE secret_key = ?", array($uniqid));
296    }
297
298    switch($array["mailmaga_flg"]) {
299        case 1:
300            $arrRegist["mailmaga_flg"] = 4;
301            break;
302        case 2:
303            $arrRegist["mailmaga_flg"] = 5;
304            break;
305        default:
306            $arrRegist["mailmaga_flg"] = 6;
307            break;
308    }
309       
310    $arrRegist["secret_key"] = $uniqid;     // ²¾ÅÐÏ¿IDȯ¹Ô
311    $arrRegist["create_date"] = "now()";    // ºîÀ®Æü
312    $arrRegist["update_date"] = "now()";    // ¹¹¿·Æü
313    $arrRegist["first_buy_date"] = "";      // ºÇ½é¤Î¹ØÆþÆü
314   
315    // ·ÈÂӥ᡼¥ë¥¢¥É¥ì¥¹
316    $arrRegist['email_mobile'] = $arrRegist['email'];
317
318    //-- ²¾ÅÐÏ¿¼Â¹Ô
319    $objConn->query("BEGIN");
320
321    $objQuery = new SC_Query();
322    $objQuery->insert("dtb_customer", $arrRegist);
323
324/* ¥á¥ë¥Þ¥¬²ñ°÷µ¡Ç½¤Ï¸½ºßÄä»ßÃæ¡¡2007/03/07
325    //--¡¡Èó²ñ°÷¤Ç¥á¥ë¥Þ¥¬ÅÐÏ¿¤·¤Æ¤¤¤ë¤«¤ÎȽÄê
326    $sql = "SELECT count(*) FROM dtb_customer_mail WHERE email = ?";
327    $mailResult = $objConn->getOne($sql, array($arrRegist["email"]));
328
329    //--¡¡¥á¥ë¥Þ¥¬²¾ÅÐÏ¿¼Â¹Ô
330    $arrRegistMail["email"] = $arrRegist["email"]; 
331    if ($array["mailmaga_flg"] == 1) {
332        $arrRegistMail["mailmaga_flg"] = 4;
333    } elseif ($array["mailmaga_flg"] == 2) {
334        $arrRegistMail["mailmaga_flg"] = 5;
335    } else {
336        $arrRegistMail["mailmaga_flg"] = 6;
337    }
338    $arrRegistMail["update_date"] = "now()";
339   
340    // Èó²ñ°÷¤Ç¥á¥ë¥Þ¥¬ÅÐÏ¿¤·¤Æ¤¤¤ë¾ì¹ç
341    if ($mailResult == 1) {     
342        $objQuery->update("dtb_customer_mail", $arrRegistMail, "email = '" .addslashes($arrRegistMail["email"]). "'");         
343    } else {                //¡¡¿·µ¬ÅÐÏ¿¤Î¾ì¹ç
344        $arrRegistMail["create_date"] = "now()";
345        $objQuery->insert("dtb_customer_mail", $arrRegistMail);     
346    }
347*/
348    $objConn->query("COMMIT");
349
350    return $uniqid;
351}
352
353//----¡¡¼èÆÀʸ»úÎó¤ÎÊÑ´¹
354function lfConvertParam($array, $arrRegistColumn) {
355    /*
356     *  ʸ»úÎó¤ÎÊÑ´¹
357     *  K :  ¡ÖȾ³Ñ(ŽÊŽÝ޶ޏ)ÊÒ²¾Ì¾¡×¤ò¡ÖÁ´³ÑÊÒ²¾Ì¾¡×¤ËÊÑ´¹
358     *  C :  ¡ÖÁ´³Ñ¤Ò¤é²¾Ì¾¡×¤ò¡ÖÁ´³Ñ¤«¤¿²¾Ì¾¡×¤ËÊÑ´¹
359     *  V :  ÂùÅÀÉÕ¤­¤Îʸ»ú¤ò°ìʸ»ú¤ËÊÑ´¹¡£"K","H"¤È¶¦¤Ë»ÈÍѤ·¤Þ¤¹
360     *  n :  ¡ÖÁ´³Ñ¡×¿ô»ú¤ò¡ÖȾ³Ñ(ŽÊŽÝ޶ޏ)¡×¤ËÊÑ´¹
361     *  a :  Á´³Ñ±Ñ¿ô»ú¤òȾ³Ñ±Ñ¿ô»ú¤ËÊÑ´¹¤¹¤ë
362     */
363    // ¥«¥é¥à̾¤È¥³¥ó¥Ð¡¼¥È¾ðÊó
364    foreach ($arrRegistColumn as $data) {
365        $arrConvList[ $data["column"] ] = $data["convert"];
366    }
367    // ʸ»úÊÑ´¹
368    foreach ($arrConvList as $key => $val) {
369        // POST¤µ¤ì¤Æ¤­¤¿ÃͤΤßÊÑ´¹¤¹¤ë¡£
370        if(strlen(($array[$key])) > 0) {
371            $array[$key] = mb_convert_kana($array[$key] ,$val);
372        }
373    }
374    return $array;
375}
376
377//---- ÆþÎÏ¥¨¥é¡¼¥Á¥§¥Ã¥¯
378function lfErrorCheck1($array) {
379
380    global $objConn;
381    $objErr = new SC_CheckError($array);
382   
383    $objErr->doFunc(array("¤ªÌ¾Á°¡ÊÀ«¡Ë", 'name01', STEXT_LEN), array("EXIST_CHECK", "NO_SPTAB", "SPTAB_CHECK" ,"MAX_LENGTH_CHECK"));
384    $objErr->doFunc(array("¤ªÌ¾Á°¡Ê̾¡Ë", 'name02', STEXT_LEN), array("EXIST_CHECK", "NO_SPTAB", "SPTAB_CHECK" , "MAX_LENGTH_CHECK"));
385    $objErr->doFunc(array("¤ªÌ¾Á°¡Ê¥«¥Ê/À«¡Ë", 'kana01', STEXT_LEN), array("EXIST_CHECK", "NO_SPTAB", "SPTAB_CHECK" ,"MAX_LENGTH_CHECK", "KANA_CHECK"));
386    $objErr->doFunc(array("¤ªÌ¾Á°¡Ê¥«¥Ê/̾¡Ë", 'kana02', STEXT_LEN), array("EXIST_CHECK", "NO_SPTAB", "SPTAB_CHECK" ,"MAX_LENGTH_CHECK", "KANA_CHECK"));
387    $objErr->doFunc(array('¥á¡¼¥ë¥¢¥É¥ì¥¹', "email", MTEXT_LEN) ,array("NO_SPTAB", "EXIST_CHECK", "EMAIL_CHECK", "SPTAB_CHECK" ,"EMAIL_CHAR_CHECK", "MAX_LENGTH_CHECK", "MOBILE_EMAIL_CHECK"));
388
389    //¸½²ñ°÷¤ÎȽÄê ¢ª¡¡¸½²ñ°÷¤â¤·¤¯¤Ï²¾ÅÐÏ¿Ãæ¤Ï¡¢¥á¥¢¥É°ì°Õ¤¬Á°Äó¤Ë¤Ê¤Ã¤Æ¤ë¤Î¤ÇƱ¤¸¥á¥¢¥É¤ÇÅÐÏ¿ÉÔ²Ä
390
391    return $objErr->arrErr;
392}
393
394//---- ÆþÎÏ¥¨¥é¡¼¥Á¥§¥Ã¥¯
395function lfErrorCheck2($array) {
396
397    global $objConn, $objDate;
398    $objErr = new SC_CheckError($array);
399   
400    $objErr->doFunc(array("Í¹ÊØÈÖ¹æ1", "zip01", ZIP01_LEN ) ,array("EXIST_CHECK", "SPTAB_CHECK" ,"NUM_CHECK", "NUM_COUNT_CHECK"));
401    $objErr->doFunc(array("Í¹ÊØÈÖ¹æ2", "zip02", ZIP02_LEN ) ,array("EXIST_CHECK", "SPTAB_CHECK" ,"NUM_CHECK", "NUM_COUNT_CHECK"));
402    $objErr->doFunc(array("Í¹ÊØÈÖ¹æ", "zip01", "zip02"), array("ALL_EXIST_CHECK"));
403
404    $objErr->doFunc(array("À­ÊÌ", "sex") ,array("SELECT_CHECK", "NUM_CHECK"));
405    $objErr->doFunc(array("À¸Ç¯·îÆü (ǯ)", "year", 4), array("EXIST_CHECK", "SPTAB_CHECK", "NUM_CHECK", "NUM_COUNT_CHECK"));
406    if (!isset($objErr->arrErr['year'])) {
407        $objErr->doFunc(array("À¸Ç¯·îÆü (ǯ)", "year", $objDate->getStartYear()), array("MIN_CHECK"));
408        $objErr->doFunc(array("À¸Ç¯·îÆü (ǯ)", "year", $objDate->getEndYear()), array("MAX_CHECK"));
409    }
410    $objErr->doFunc(array("À¸Ç¯·îÆü (·îÆü)", "month", "day"), array("SELECT_CHECK"));
411    if (!isset($objErr->arrErr['year']) && !isset($objErr->arrErr['month']) && !isset($objErr->arrErr['day'])) {
412        $objErr->doFunc(array("À¸Ç¯·îÆü", "year", "month", "day"), array("CHECK_DATE"));
413    }
414   
415    return $objErr->arrErr;
416}
417
418//---- ÆþÎÏ¥¨¥é¡¼¥Á¥§¥Ã¥¯
419function lfErrorCheck3($array) {
420
421    global $objConn;
422    $objErr = new SC_CheckError($array);
423   
424    $objErr->doFunc(array("ÅÔÆ»Éܸ©", 'pref'), array("SELECT_CHECK","NUM_CHECK"));
425    $objErr->doFunc(array("»Ô¶èĮ¼", "addr01", MTEXT_LEN), array("EXIST_CHECK","SPTAB_CHECK" ,"MAX_LENGTH_CHECK"));
426    $objErr->doFunc(array("ÈÖÃÏ", "addr02", MTEXT_LEN), array("EXIST_CHECK","SPTAB_CHECK" ,"MAX_LENGTH_CHECK"));
427    $objErr->doFunc(array("ÅÅÏÃÈÖ¹æ1", 'tel01'), array("EXIST_CHECK","SPTAB_CHECK" ));
428    $objErr->doFunc(array("ÅÅÏÃÈÖ¹æ2", 'tel02'), array("EXIST_CHECK","SPTAB_CHECK" ));
429    $objErr->doFunc(array("ÅÅÏÃÈÖ¹æ3", 'tel03'), array("EXIST_CHECK","SPTAB_CHECK" ));
430    $objErr->doFunc(array("ÅÅÏÃÈÖ¹æ", "tel01", "tel02", "tel03",TEL_ITEM_LEN) ,array("TEL_CHECK"));
431   
432    return $objErr->arrErr;
433}
434
435//³Îǧ¥Ú¡¼¥¸Íѥѥ¹¥ï¡¼¥Éɽ¼¨ÍÑ
436
437function lfPassLen($passlen){
438    $ret = "";
439    for ($i=0;$i<$passlen;true){
440    $ret.="*";
441    $i++;
442    }
443    return $ret;
444}
445
446
447// Í¹ÊØÈֹ椫¤é½»½ê¤Î¼èÆÀ
448function lfGetAddress($zipcode) {
449    global $arrPref;
450
451    $conn = new SC_DBconn(ZIP_DSN);
452
453    // Í¹ÊØÈֹ渡º÷ʸºîÀ®
454    $zipcode = mb_convert_kana($zipcode ,"n");
455    $sqlse = "SELECT state, city, town FROM mtb_zip WHERE zipcode = ?";
456
457    $data_list = $conn->getAll($sqlse, array($zipcode));
458
459    // ¥¤¥ó¥Ç¥Ã¥¯¥¹¤ÈÃͤòȿž¤µ¤»¤ë¡£
460    $arrREV_PREF = array_flip($arrPref);
461
462    /*
463        Áí̳¾Ê¤«¤é¥À¥¦¥ó¥í¡¼¥É¤·¤¿¥Ç¡¼¥¿¤ò¤½¤Î¤Þ¤Þ¥¤¥ó¥Ý¡¼¥È¤¹¤ë¤È
464        °Ê²¼¤Î¤è¤¦¤Êʸ»úÎ󤬯þ¤Ã¤Æ¤¤¤ë¤Î¤Ç   Âкö¤¹¤ë¡£
465        ¡¦¡Ê£±¡¦£±£¹ÃúÌÜ¡Ë
466        ¡¦°Ê²¼¤Ë·ÇºÜ¤¬¤Ê¤¤¾ì¹ç
467    */
468    $town =  $data_list[0]['town'];
469    $town = ereg_replace("¡Ê.*¡Ë$","",$town);
470    $town = ereg_replace("°Ê²¼¤Ë·ÇºÜ¤¬¤Ê¤¤¾ì¹ç","",$town);
471    $data_list[0]['town'] = $town;
472    $data_list[0]['state'] = $arrREV_PREF[$data_list[0]['state']];
473
474    return $data_list;
475}
476
477//-----------------------------------------------------------------------------------------------------------------------------------
478?>
Note: See TracBrowser for help on using the repository browser.