source: branches/mobile/html/mobile/entry/index.php @ 11674

Revision 11674, 15.8 KB checked in by rebelt, 16 years ago (diff)

下記の問題点の修正です。

  • 検証結果19
  • Property svn:eol-style set to native
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 = 'entry/index.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_SiteView();
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// ¶õ¥á¡¼¥ë
31if (isset($_SESSION['mobile']['kara_mail_from'])) {
32    $objPage->tpl_kara_mail_from = $_POST['email'] = $_SESSION['mobile']['kara_mail_from'];
33} elseif (MOBILE_USE_KARA_MAIL) {
34    $token = gfPrepareKaraMail('entry/index.php');
35    if ($token !== false) {
36        $objPage->tpl_mainpage = 'entry/mail.tpl';
37        $objPage->tpl_title = '²ñ°÷ÅÐÏ¿(¶õ¥á¡¼¥ë)';
38        $objPage->tpl_kara_mail_to = MOBILE_KARA_MAIL_ADDRESS_USER . MOBILE_KARA_MAIL_ADDRESS_DELIMITER . 'entry_' . $token . '@' . MOBILE_KARA_MAIL_ADDRESS_DOMAIN;
39        $objPage->tpl_from_address = $CONF['email03'];
40    }
41}
42
43//SSLURLȽÄê
44if (SSLURL_CHECK == 1){
45    $ssl_url= sfRmDupSlash(SSL_URL.$_SERVER['REQUEST_URI']);
46    if (!ereg("^https://", $non_ssl_url)){
47        sfDispSiteError(URL_ERROR);
48    }
49}
50
51// ¥ì¥¤¥¢¥¦¥È¥Ç¥¶¥¤¥ó¤ò¼èÆÀ
52$objPage = sfGetPageLayout($objPage, false, DEF_LAYOUT);
53
54//---- ÅÐÏ¿ÍÑ¥«¥é¥àÇÛÎó
55$arrRegistColumn = array(
56                             array(  "column" => "name01", "convert" => "aKV" ),
57                             array(  "column" => "name02", "convert" => "aKV" ),
58                             array(  "column" => "kana01", "convert" => "CKV" ),
59                             array(  "column" => "kana02", "convert" => "CKV" ),
60                             array(  "column" => "zip01", "convert" => "n" ),
61                             array(  "column" => "zip02", "convert" => "n" ),
62                             array(  "column" => "pref", "convert" => "n" ),
63                             array(  "column" => "addr01", "convert" => "aKV" ),
64                             array(  "column" => "addr02", "convert" => "aKV" ),
65                             array(  "column" => "email", "convert" => "a" ),
66                             array(  "column" => "email2", "convert" => "a" ),
67                             array(  "column" => "email_mobile", "convert" => "a" ),
68                             array(  "column" => "email_mobile2", "convert" => "a" ),
69                             array(  "column" => "tel01", "convert" => "n" ),
70                             array(  "column" => "tel02", "convert" => "n" ),
71                             array(  "column" => "tel03", "convert" => "n" ),
72                             array(  "column" => "fax01", "convert" => "n" ),
73                             array(  "column" => "fax02", "convert" => "n" ),
74                             array(  "column" => "fax03", "convert" => "n" ),
75                             array(  "column" => "sex", "convert" => "n" ),
76                             array(  "column" => "job", "convert" => "n" ),
77                             array(  "column" => "birth", "convert" => "n" ),
78                             array(  "column" => "reminder", "convert" => "n" ),
79                             array(  "column" => "reminder_answer", "convert" => "aKV"),
80                             array(  "column" => "password", "convert" => "a" ),
81                             array(  "column" => "password02", "convert" => "a" )
82                         );
83
84//---- ÅÐÏ¿½ü³°ÍÑ¥«¥é¥àÇÛÎó
85$arrRejectRegistColumn = array("year", "month", "day", "email02", "email_mobile02", "password02");
86
87if ($_SERVER["REQUEST_METHOD"] == "POST") {
88
89    //-- POST¥Ç¡¼¥¿¤Î°ú¤­·Ñ¤®
90    $objPage->arrForm = $_POST;
91   
92    if($objPage->arrForm['year'] == '----') {
93        $objPage->arrForm['year'] = '';
94    }
95   
96    $objPage->arrForm['email'] = strtolower($objPage->arrForm['email']);        // email¤Ï¤¹¤Ù¤Æ¾®Ê¸»ú¤Ç½èÍý
97   
98    //-- ÆþÎϥǡ¼¥¿¤ÎÊÑ´¹
99    $objPage->arrForm = lfConvertParam($objPage->arrForm, $arrRegistColumn);
100
101    //--¡¡ÆþÎÏ¥¨¥é¡¼¥Á¥§¥Ã¥¯
102    if ($_POST["mode"] == "set1") {
103        $objPage->arrErr = lfErrorCheck1($objPage->arrForm);
104        $objPage->tpl_mainpage = 'entry/index.tpl';
105        $objPage->tpl_title = '²ñ°÷ÅÐÏ¿(1/3)';
106    } elseif ($_POST["mode"] == "set2") {
107        $objPage->arrErr = lfErrorCheck2($objPage->arrForm);
108        $objPage->tpl_mainpage = 'entry/set1.tpl';
109        $objPage->tpl_title = '²ñ°÷ÅÐÏ¿(2/3)';
110    } else {
111        $objPage->arrErr = lfErrorCheck3($objPage->arrForm);
112        $objPage->tpl_mainpage = 'entry/set2.tpl';
113        $objPage->tpl_title = '²ñ°÷ÅÐÏ¿(3/3)';
114    }
115
116    if ($objPage->arrErr || $_POST["mode"] == "return") {       // ÆþÎÏ¥¨¥é¡¼¤Î¥Á¥§¥Ã¥¯
117        foreach($objPage->arrForm as $key => $val) {
118            $objPage->$key = $val;
119        }
120
121        //-- ¥Ç¡¼¥¿¤ÎÀßÄê
122        if ($_POST["mode"] == "set1") {
123            $checkVal = array("email", "password", "reminder", "reminder_answer", "name01", "name02", "kana01", "kana02");
124            foreach($objPage->arrForm as $key => $val) {
125                if ($key != "mode" && $key != "subm" & !in_array($key, $checkVal)) $objPage->list_data[ $key ] = $val;
126            }
127
128        } elseif ($_POST["mode"] == "set2") {
129            $checkVal = array("sex", "year", "month", "day", "zip01", "zip02");
130            foreach($objPage->arrForm as $key => $val) {
131                if ($key != "mode" && $key != "subm" & !in_array($key, $checkVal)) $objPage->list_data[ $key ] = $val;
132            }
133        } else {
134            $checkVal = array("pref", "addr01", "addr02", "tel01", "tel02", "tel03");
135            foreach($objPage->arrForm as $key => $val) {
136                if ($key != "mode" && $key != "subm" & !in_array($key, $checkVal)) $objPage->list_data[ $key ] = $val;
137            }
138        }
139
140
141    } else {
142
143        //--¡¡¥Æ¥ó¥×¥ì¡¼¥ÈÀßÄê
144        if ($_POST["mode"] == "set1") {
145            $objPage->tpl_mainpage = 'entry/set1.tpl';
146            $objPage->tpl_title = '²ñ°÷ÅÐÏ¿(2/3)';
147        } elseif ($_POST["mode"] == "set2") {
148            $objPage->tpl_mainpage = 'entry/set2.tpl';
149            $objPage->tpl_title = '²ñ°÷ÅÐÏ¿(3/3)';
150
151            $address = lfGetAddress($_REQUEST['zip01'].$_REQUEST['zip02']);
152            $objView->assign("pref", @$address[0]['state']);
153            $objView->assign("addr01", @$address[0]['city'] . @$address[0]['town']);
154        } elseif ($_POST["mode"] == "confirm") {
155            //¥Ñ¥¹¥ï¡¼¥Éɽ¼¨
156            $passlen = strlen($objPage->arrForm['password']);
157            $objPage->passlen = lfPassLen($passlen);
158           
159            //¥á¡¼¥ë¼õ¤±¼è¤ê
160            if ($objPage->arrForm['mail_flag'] = "ON") {
161                $objPage->arrForm['mail_flag']  = "2";
162            }
163
164            $objPage->tpl_mainpage = 'entry/confirm.tpl';
165            $objPage->tpl_title = '²ñ°÷ÅÐÏ¿(³Îǧ¥Ú¡¼¥¸)';
166
167        }
168
169        //-- ¥Ç¡¼¥¿ÀßÄê
170        unset($objPage->list_data);
171        foreach($objPage->arrForm as $key => $val) {
172            if ($key != "mode" && $key != "subm") $objPage->list_data[ $key ] = $val;
173        }
174
175
176        //--¡¡²¾ÅÐÏ¿¤È´°Î»²èÌÌ
177        if ($_POST["mode"] == "complete") {
178            $objPage->uniqid = lfRegistData ($objPage->arrForm, $arrRegistColumn, $arrRejectRegistColumn);
179
180            // ¶õ¥á¡¼¥ë¤ò¼õ¿®ºÑ¤ß¤Î¾ì¹ç¤Ï¤¹¤°¤ËËÜÅÐÏ¿´°Î»¤Ë¤¹¤ë¡£
181            if (isset($_SESSION['mobile']['kara_mail_from'])) {
182                header("Location:" . gfAddSessionId(URL_DIR . "regist/index.php?mode=regist&id=" . $objPage->uniqid));
183                exit;
184            }
185
186            $objPage->tpl_mainpage = 'entry/complete.tpl';
187            $objPage->tpl_title = '²ñ°÷ÅÐÏ¿(´°Î»¥Ú¡¼¥¸)';
188
189            sfMobileSetExtSessionId('id', $objPage->uniqid, 'regist/index.php');
190
191            //¡¡²¾ÅÐÏ¿´°Î»¥á¡¼¥ëÁ÷¿®
192            $objPage->CONF = $CONF;
193            $objPage->to_name01 = $_POST['name01'];
194            $objPage->to_name02 = $_POST['name02'];
195            $objMailText = new SC_SiteView();
196            $objMailText->assignobj($objPage);
197            $subject = sfMakesubject('²ñ°÷ÅÐÏ¿¤Î¤´³Îǧ');
198            $toCustomerMail = $objMailText->fetch("mail_templates/customer_mail.tpl");
199            $objMail = new GC_SendMail();
200            $objMail->setItem(
201                                ''                                  //¡¡°¸Àè
202                                , $subject                          //¡¡¥µ¥Ö¥¸¥§¥¯¥È
203                                , $toCustomerMail                   //¡¡ËÜʸ
204                                , $CONF["email03"]                  //¡¡ÇÛÁ÷¸µ¥¢¥É¥ì¥¹
205                                , $CONF["shop_name"]                //¡¡ÇÛÁ÷¸µ¡¡Ì¾Á°
206                                , $CONF["email03"]                  //¡¡reply_to
207                                , $CONF["email04"]                  //¡¡return_path
208                                , $CONF["email04"]                  //  Errors_to
209                                , $CONF["email01"]                  //  Bcc
210                                                                );
211            // °¸Àè¤ÎÀßÄê
212            $name = $_POST["name01"] . $_POST["name02"] ." ÍÍ";
213            $objMail->setTo($_POST["email"], $name);
214            $objMail->sendMail();
215
216            // ´°Î»¥Ú¡¼¥¸¤Ë°ÜÆ°¤µ¤»¤ë¡£
217            header("Location:" . gfAddSessionId("./complete.php"));
218            exit;
219        }
220    }
221}
222
223//----¡¡¥Ú¡¼¥¸É½¼¨
224$objView->assignobj($objPage);
225$objView->display(SITE_FRAME);
226
227//----------------------------------------------------------------------------------------------------------------------
228
229//---- function·²
230function lfRegistData ($array, $arrRegistColumn, $arrRejectRegistColumn) {
231    global $objConn;
232
233    // ²¾ÅÐÏ¿
234    foreach ($arrRegistColumn as $data) {
235        if (strlen($array[ $data["column"] ]) > 0 && ! in_array($data["column"], $arrRejectRegistColumn)) {
236            $arrRegist[ $data["column"] ] = $array[ $data["column"] ];
237        }
238    }
239       
240    // ÃÂÀ¸Æü¤¬ÆþÎϤµ¤ì¤Æ¤¤¤ë¾ì¹ç
241    if (strlen($array["year"]) > 0 ) {
242        $arrRegist["birth"] = $array["year"] ."/". $array["month"] ."/". $array["day"] ." 00:00:00";
243    }
244   
245    // ¥Ñ¥¹¥ï¡¼¥É¤Î°Å¹æ²½
246    $arrRegist["password"] = sha1($arrRegist["password"] . ":" . AUTH_MAGIC);
247   
248    $count = 1;
249    while ($count != 0) {
250        $uniqid = sfGetUniqRandomId("t");
251        $count = $objConn->getOne("SELECT COUNT(*) FROM dtb_customer WHERE secret_key = ?", array($uniqid));
252    }
253   
254    $arrRegist["secret_key"] = $uniqid;     // ²¾ÅÐÏ¿IDȯ¹Ô
255    $arrRegist["create_date"] = "now()";    // ºîÀ®Æü
256    $arrRegist["update_date"] = "now()";    // ¹¹¿·Æü
257    $arrRegist["first_buy_date"] = "";      // ºÇ½é¤Î¹ØÆþÆü
258   
259    // ·ÈÂӥ᡼¥ë¥¢¥É¥ì¥¹
260    $arrRegist['email_mobile'] = $arrRegist['email'];
261
262    //-- ²¾ÅÐÏ¿¼Â¹Ô
263    $objConn->query("BEGIN");
264
265    $objQuery = new SC_Query();
266    $objQuery->insert("dtb_customer", $arrRegist);
267
268    //--¡¡Èó²ñ°÷¤Ç¥á¥ë¥Þ¥¬ÅÐÏ¿¤·¤Æ¤¤¤ë¤«¤ÎȽÄê
269    $sql = "SELECT count(*) FROM dtb_customer_mail WHERE email = ?";
270    $mailResult = $objConn->getOne($sql, array($arrRegist["email"]));
271
272    //--¡¡¥á¥ë¥Þ¥¬²¾ÅÐÏ¿¼Â¹Ô
273    $arrRegistMail["email"] = $arrRegist["email"]; 
274    if ($array["mail_flag"] == 1) {
275        $arrRegistMail["mail_flag"] = 4;
276    } elseif ($array["mail_flag"] == 2) {
277        $arrRegistMail["mail_flag"] = 5;
278    } else {
279        $arrRegistMail["mail_flag"] = 6;
280    }
281    $arrRegistMail["update_date"] = "now()";
282   
283    // Èó²ñ°÷¤Ç¥á¥ë¥Þ¥¬ÅÐÏ¿¤·¤Æ¤¤¤ë¾ì¹ç
284    if ($mailResult == 1) {     
285        $objQuery->update("dtb_customer_mail", $arrRegistMail, "email = '" .addslashes($arrRegistMail["email"]). "'");         
286    } else {                //¡¡¿·µ¬ÅÐÏ¿¤Î¾ì¹ç
287        $arrRegistMail["create_date"] = "now()";
288        $objQuery->insert("dtb_customer_mail", $arrRegistMail);     
289    }
290    $objConn->query("COMMIT");
291
292    return $uniqid;
293}
294
295//----¡¡¼èÆÀʸ»úÎó¤ÎÊÑ´¹
296function lfConvertParam($array, $arrRegistColumn) {
297    /*
298     *  ʸ»úÎó¤ÎÊÑ´¹
299     *  K :  ¡ÖȾ³Ñ(ŽÊŽÝŽ¶Ž¸)ÊÒ²¾Ì¾¡×¤ò¡ÖÁ´³ÑÊÒ²¾Ì¾¡×¤ËÊÑ´¹
300     *  C :  ¡ÖÁ´³Ñ¤Ò¤é²¾Ì¾¡×¤ò¡ÖÁ´³Ñ¤«¤¿²¾Ì¾¡×¤ËÊÑ´¹
301     *  V :  ÂùÅÀÉÕ¤­¤Îʸ»ú¤ò°ìʸ»ú¤ËÊÑ´¹¡£"K","H"¤È¶¦¤Ë»ÈÍѤ·¤Þ¤¹ 
302     *  n :  ¡ÖÁ´³Ñ¡×¿ô»ú¤ò¡ÖȾ³Ñ(ŽÊŽÝŽ¶Ž¸)¡×¤ËÊÑ´¹
303     *  a :  Á´³Ñ±Ñ¿ô»ú¤òȾ³Ñ±Ñ¿ô»ú¤ËÊÑ´¹¤¹¤ë
304     */
305    // ¥«¥é¥à̾¤È¥³¥ó¥Ð¡¼¥È¾ðÊó
306    foreach ($arrRegistColumn as $data) {
307        $arrConvList[ $data["column"] ] = $data["convert"];
308    }
309    // ʸ»úÊÑ´¹
310    foreach ($arrConvList as $key => $val) {
311        // POST¤µ¤ì¤Æ¤­¤¿ÃͤΤßÊÑ´¹¤¹¤ë¡£
312        if(strlen(($array[$key])) > 0) {
313            $array[$key] = mb_convert_kana($array[$key] ,$val);
314        }
315    }
316    return $array;
317}
318
319//---- ÆþÎÏ¥¨¥é¡¼¥Á¥§¥Ã¥¯
320function lfErrorCheck1($array) {
321
322    global $objConn;
323    $objErr = new SC_CheckError($array);
324   
325    $objErr->doFunc(array("¤ªÌ¾Á°¡ÊÀ«¡Ë", 'name01', STEXT_LEN), array("EXIST_CHECK", "NO_SPTAB", "SPTAB_CHECK" ,"MAX_LENGTH_CHECK"));
326    $objErr->doFunc(array("¤ªÌ¾Á°¡Ê̾¡Ë", 'name02', STEXT_LEN), array("EXIST_CHECK", "NO_SPTAB", "SPTAB_CHECK" , "MAX_LENGTH_CHECK"));
327    $objErr->doFunc(array("¤ªÌ¾Á°¡Ê¥«¥Ê/À«¡Ë", 'kana01', STEXT_LEN), array("EXIST_CHECK", "NO_SPTAB", "SPTAB_CHECK" ,"MAX_LENGTH_CHECK", "KANA_CHECK"));
328    $objErr->doFunc(array("¤ªÌ¾Á°¡Ê¥«¥Ê/̾¡Ë", 'kana02', STEXT_LEN), array("EXIST_CHECK", "NO_SPTAB", "SPTAB_CHECK" ,"MAX_LENGTH_CHECK", "KANA_CHECK"));
329    $objErr->doFunc(array('¥á¡¼¥ë¥¢¥É¥ì¥¹', "email", MTEXT_LEN) ,array("NO_SPTAB", "EXIST_CHECK", "EMAIL_CHECK", "SPTAB_CHECK" ,"EMAIL_CHAR_CHECK", "MAX_LENGTH_CHECK", "MOBILE_EMAIL_CHECK"));
330
331    //¸½²ñ°÷¤ÎȽÄê ¢ª¡¡¸½²ñ°÷¤â¤·¤¯¤Ï²¾ÅÐÏ¿Ãæ¤Ï¡¢¥á¥¢¥É°ì°Õ¤¬Á°Äó¤Ë¤Ê¤Ã¤Æ¤ë¤Î¤ÇƱ¤¸¥á¥¢¥É¤ÇÅÐÏ¿ÉÔ²Ä
332    if (strlen($array["email"]) > 0) {
333        $objQuery = new SC_Query();
334        $arrRet = $objQuery->select("email, update_date, del_flg", "dtb_customer","email ILIKE ? OR email_mobile ILIKE ? ORDER BY del_flg", array($array["email"], $array["email"]));
335               
336        if(count($arrRet) > 0) {
337            if($arrRet[0]['del_flg'] != '1') {
338                // ²ñ°÷¤Ç¤¢¤ë¾ì¹ç
339                $objErr->arrErr["email"] .= "¢¨ ¤¹¤Ç¤Ë²ñ°÷ÅÐÏ¿¤Ç»ÈÍѤµ¤ì¤Æ¤¤¤ë¥á¡¼¥ë¥¢¥É¥ì¥¹¤Ç¤¹¡£<br />";
340            } else {
341                // Âà²ñ¤·¤¿²ñ°÷¤Ç¤¢¤ë¾ì¹ç
342                $leave_time = sfDBDatetoTime($arrRet[0]['update_date']);
343                $now_time = time();
344                $pass_time = $now_time - $leave_time;
345                // Âà²ñ¤«¤é²¿»þ´Ö-·Ð²á¤·¤Æ¤¤¤ë¤«È½Äꤹ¤ë¡£
346                $limit_time = ENTRY_LIMIT_HOUR * 3600;                     
347                if($pass_time < $limit_time) {
348                    $objErr->arrErr["email"] .= "¢¨ Âà²ñ¤«¤é°ìÄê´ü´Ö¤Î´Ö¤Ï¡¢Æ±¤¸¥á¡¼¥ë¥¢¥É¥ì¥¹¤ò»ÈÍѤ¹¤ë¤³¤È¤Ï¤Ç¤­¤Þ¤»¤ó¡£<br />";
349                }
350            }
351        }
352    }
353
354    $objErr->doFunc(array("¥Ñ¥¹¥ï¡¼¥É", 'password', PASSWORD_LEN1, PASSWORD_LEN2), array("EXIST_CHECK", "SPTAB_CHECK" ,"ALNUM_CHECK", "NUM_RANGE_CHECK"));
355    $objErr->doFunc(array("¥Ñ¥¹¥ï¡¼¥É³ÎǧÍѤμÁÌä", "reminder") ,array("SELECT_CHECK", "NUM_CHECK"));
356    $objErr->doFunc(array("¥Ñ¥¹¥ï¡¼¥É³ÎǧÍѤμÁÌä¤ÎÅú¤¨", "reminder_answer", STEXT_LEN) ,array("EXIST_CHECK","SPTAB_CHECK" , "MAX_LENGTH_CHECK"));
357   
358    return $objErr->arrErr;
359}
360
361//---- ÆþÎÏ¥¨¥é¡¼¥Á¥§¥Ã¥¯
362function lfErrorCheck2($array) {
363
364    global $objConn, $objDate;
365    $objErr = new SC_CheckError($array);
366   
367    $objErr->doFunc(array("͹ÊØÈÖ¹æ1", "zip01", ZIP01_LEN ) ,array("EXIST_CHECK", "SPTAB_CHECK" ,"NUM_CHECK", "NUM_COUNT_CHECK"));
368    $objErr->doFunc(array("͹ÊØÈÖ¹æ2", "zip02", ZIP02_LEN ) ,array("EXIST_CHECK", "SPTAB_CHECK" ,"NUM_CHECK", "NUM_COUNT_CHECK"));
369    $objErr->doFunc(array("͹ÊØÈÖ¹æ", "zip01", "zip02"), array("ALL_EXIST_CHECK"));
370
371    $objErr->doFunc(array("À­ÊÌ", "sex") ,array("SELECT_CHECK", "NUM_CHECK"));
372    $objErr->doFunc(array("À¸Ç¯·îÆü (ǯ)", "year", 4), array("EXIST_CHECK", "SPTAB_CHECK", "NUM_CHECK", "NUM_COUNT_CHECK"));
373    if (!isset($objErr->arrErr['year'])) {
374        $objErr->doFunc(array("À¸Ç¯·îÆü (ǯ)", "year", $objDate->getStartYear()), array("MIN_CHECK"));
375        $objErr->doFunc(array("À¸Ç¯·îÆü (ǯ)", "year", $objDate->getEndYear()), array("MAX_CHECK"));
376    }
377    $objErr->doFunc(array("À¸Ç¯·îÆü (·îÆü)", "month", "day"), array("SELECT_CHECK"));
378    if (!isset($objErr->arrErr['year']) && !isset($objErr->arrErr['month']) && !isset($objErr->arrErr['day'])) {
379        $objErr->doFunc(array("À¸Ç¯·îÆü", "year", "month", "day"), array("CHECK_DATE"));
380    }
381   
382    return $objErr->arrErr;
383}
384
385//---- ÆþÎÏ¥¨¥é¡¼¥Á¥§¥Ã¥¯
386function lfErrorCheck3($array) {
387
388    global $objConn;
389    $objErr = new SC_CheckError($array);
390   
391    $objErr->doFunc(array("ÅÔÆ»Éܸ©", 'pref'), array("SELECT_CHECK","NUM_CHECK"));
392    $objErr->doFunc(array("»Ô¶èĮ¼", "addr01", MTEXT_LEN), array("EXIST_CHECK","SPTAB_CHECK" ,"MAX_LENGTH_CHECK"));
393    $objErr->doFunc(array("ÈÖÃÏ", "addr02", MTEXT_LEN), array("EXIST_CHECK","SPTAB_CHECK" ,"MAX_LENGTH_CHECK"));
394    $objErr->doFunc(array("ÅÅÏÃÈÖ¹æ1", 'tel01'), array("EXIST_CHECK","SPTAB_CHECK" ));
395    $objErr->doFunc(array("ÅÅÏÃÈÖ¹æ2", 'tel02'), array("EXIST_CHECK","SPTAB_CHECK" ));
396    $objErr->doFunc(array("ÅÅÏÃÈÖ¹æ3", 'tel03'), array("EXIST_CHECK","SPTAB_CHECK" ));
397    $objErr->doFunc(array("ÅÅÏÃÈÖ¹æ", "tel01", "tel02", "tel03",TEL_ITEM_LEN) ,array("TEL_CHECK"));
398   
399    return $objErr->arrErr;
400}
401
402//³Îǧ¥Ú¡¼¥¸Íѥѥ¹¥ï¡¼¥Éɽ¼¨ÍÑ
403
404function lfPassLen($passlen){
405    $ret = "";
406    for ($i=0;$i<$passlen;true){
407    $ret.="*";
408    $i++;
409    }
410    return $ret;
411}
412
413
414// ͹ÊØÈֹ椫¤é½»½ê¤Î¼èÆÀ
415function lfGetAddress($zipcode) {
416    global $arrPref;
417
418    $conn = new SC_DBconn(ZIP_DSN);
419
420    // ͹ÊØÈֹ渡º÷ʸºîÀ®
421    $zipcode = mb_convert_kana($zipcode ,"n");
422    $sqlse = "SELECT state, city, town FROM mtb_zip WHERE zipcode = ?";
423
424    $data_list = $conn->getAll($sqlse, array($zipcode));
425
426    // ¥¤¥ó¥Ç¥Ã¥¯¥¹¤ÈÃͤòȿž¤µ¤»¤ë¡£
427    $arrREV_PREF = array_flip($arrPref);
428
429    /*
430        Áí̳¾Ê¤«¤é¥À¥¦¥ó¥í¡¼¥É¤·¤¿¥Ç¡¼¥¿¤ò¤½¤Î¤Þ¤Þ¥¤¥ó¥Ý¡¼¥È¤¹¤ë¤È
431        °Ê²¼¤Î¤è¤¦¤Êʸ»úÎó¤¬Æþ¤Ã¤Æ¤¤¤ë¤Î¤Ç  Âкö¤¹¤ë¡£
432        ¡¦¡Ê£±¡¦£±£¹ÃúÌÜ¡Ë
433        ¡¦°Ê²¼¤Ë·ÇºÜ¤¬¤Ê¤¤¾ì¹ç
434    */
435    $town =  $data_list[0]['town'];
436    $town = ereg_replace("¡Ê.*¡Ë$","",$town);
437    $town = ereg_replace("°Ê²¼¤Ë·ÇºÜ¤¬¤Ê¤¤¾ì¹ç","",$town);
438    $data_list[0]['town'] = $town;
439    $data_list[0]['state'] = $arrREV_PREF[$data_list[0]['state']];
440
441    return $data_list;
442}
443
444//-----------------------------------------------------------------------------------------------------------------------------------
445?>
Note: See TracBrowser for help on using the repository browser.