source: branches/mobile/html/mobile/mypage/change.php @ 11674

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

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

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