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

Revision 11569, 17.1 KB checked in by rebelt, 16 years ago (diff)

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

  • 検証結果8,9
  • PCサイトで登録されたFAXと職業が,携帯サイトの登録変更の際に消えてしまう。
  • 住所関係のエラーメッセージの表示位置がおかしい。
  • 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
190if($objPage->year == '') {
191    $objPage->year = '----';
192}
193
194//----¡¡¥Ú¡¼¥¸É½¼¨
195$objView->assignobj($objPage);
196$objView->display(SITE_FRAME);
197
198//----------------------------------------------------------------------------------------------------------------------
199
200//---- function·²
201function lfRegistData ($array, $arrRegistColumn, $arrRejectRegistColumn) {
202    global $objConn;
203
204    // ²¾ÅÐÏ¿
205    foreach ($arrRegistColumn as $data) {
206        if (strlen($array[ $data["column"] ]) > 0 && ! in_array($data["column"], $arrRejectRegistColumn)) {
207            $arrRegist[ $data["column"] ] = $array[ $data["column"] ];
208        }
209    }
210       
211    // ÃÂÀ¸Æü¤¬ÆþÎϤµ¤ì¤Æ¤¤¤ë¾ì¹ç
212    if (strlen($array["year"]) > 0 ) {
213        $arrRegist["birth"] = $array["year"] ."/". $array["month"] ."/". $array["day"] ." 00:00:00";
214    }
215   
216    // ¥Ñ¥¹¥ï¡¼¥É¤Î°Å¹æ²½
217    $arrRegist["password"] = sha1($arrRegist["password"] . ":" . AUTH_MAGIC);
218   
219    $count = 1;
220    while ($count != 0) {
221        $uniqid = sfGetUniqRandomId("t");
222        $count = $objConn->getOne("SELECT COUNT(*) FROM dtb_customer WHERE secret_key = ?", array($uniqid));
223    }
224   
225    $arrRegist["secret_key"] = $uniqid;     // ²¾ÅÐÏ¿IDȯ¹Ô
226    $arrRegist["create_date"] = "now()";    // ºîÀ®Æü
227    $arrRegist["update_date"] = "now()";    // ¹¹¿·Æü
228    $arrRegist["first_buy_date"] = "";      // ºÇ½é¤Î¹ØÆþÆü
229   
230    // ·ÈÂӥ᡼¥ë¥¢¥É¥ì¥¹
231    $arrRegist['email_mobile'] = $arrRegist['email'];
232
233    //-- ²¾ÅÐÏ¿¼Â¹Ô
234    $objConn->query("BEGIN");
235
236    $objQuery = new SC_Query();
237    $objQuery->insert("dtb_customer", $arrRegist);
238
239    //--¡¡Èó²ñ°÷¤Ç¥á¥ë¥Þ¥¬ÅÐÏ¿¤·¤Æ¤¤¤ë¤«¤ÎȽÄê
240    $sql = "SELECT count(*) FROM dtb_customer_mail WHERE email = ?";
241    $mailResult = $objConn->getOne($sql, array($arrRegist["email"]));
242
243    //--¡¡¥á¥ë¥Þ¥¬²¾ÅÐÏ¿¼Â¹Ô
244    $arrRegistMail["email"] = $arrRegist["email"]; 
245    if ($array["mail_flag"] == 1) {
246        $arrRegistMail["mail_flag"] = 4;
247    } elseif ($array["mail_flag"] == 2) {
248        $arrRegistMail["mail_flag"] = 5;
249    } else {
250        $arrRegistMail["mail_flag"] = 6;
251    }
252    $arrRegistMail["update_date"] = "now()";
253   
254    // Èó²ñ°÷¤Ç¥á¥ë¥Þ¥¬ÅÐÏ¿¤·¤Æ¤¤¤ë¾ì¹ç
255    if ($mailResult == 1) {     
256        $objQuery->update("dtb_customer_mail", $arrRegistMail, "email = '" .addslashes($arrRegistMail["email"]). "'");         
257    } else {                //¡¡¿·µ¬ÅÐÏ¿¤Î¾ì¹ç
258        $arrRegistMail["create_date"] = "now()";
259        $objQuery->insert("dtb_customer_mail", $arrRegistMail);     
260    }
261    $objConn->query("COMMIT");
262
263    return $uniqid;
264}
265
266//----¡¡¼èÆÀʸ»úÎó¤ÎÊÑ´¹
267function lfConvertParam($array, $arrRegistColumn) {
268    /*
269     *  ʸ»úÎó¤ÎÊÑ´¹
270     *  K :  ¡ÖȾ³Ñ(ŽÊŽÝŽ¶Ž¸)ÊÒ²¾Ì¾¡×¤ò¡ÖÁ´³ÑÊÒ²¾Ì¾¡×¤ËÊÑ´¹
271     *  C :  ¡ÖÁ´³Ñ¤Ò¤é²¾Ì¾¡×¤ò¡ÖÁ´³Ñ¤«¤¿²¾Ì¾¡×¤ËÊÑ´¹
272     *  V :  ÂùÅÀÉÕ¤­¤Îʸ»ú¤ò°ìʸ»ú¤ËÊÑ´¹¡£"K","H"¤È¶¦¤Ë»ÈÍѤ·¤Þ¤¹ 
273     *  n :  ¡ÖÁ´³Ñ¡×¿ô»ú¤ò¡ÖȾ³Ñ(ŽÊŽÝŽ¶Ž¸)¡×¤ËÊÑ´¹
274     *  a :  Á´³Ñ±Ñ¿ô»ú¤òȾ³Ñ±Ñ¿ô»ú¤ËÊÑ´¹¤¹¤ë
275     */
276    // ¥«¥é¥à̾¤È¥³¥ó¥Ð¡¼¥È¾ðÊó
277    foreach ($arrRegistColumn as $data) {
278        $arrConvList[ $data["column"] ] = $data["convert"];
279    }
280    // ʸ»úÊÑ´¹
281    foreach ($arrConvList as $key => $val) {
282        // POST¤µ¤ì¤Æ¤­¤¿ÃͤΤßÊÑ´¹¤¹¤ë¡£
283        if(strlen(($array[$key])) > 0) {
284            $array[$key] = mb_convert_kana($array[$key] ,$val);
285        }
286    }
287    return $array;
288}
289
290
291//¥¨¥é¡¼¥Á¥§¥Ã¥¯
292
293function lfErrorCheck($array) {
294    $objErr = new SC_CheckError($array);
295   
296    $objErr->doFunc(array("¤ªÌ¾Á°¡ÊÀ«¡Ë", 'name01', STEXT_LEN), array("EXIST_CHECK", "SPTAB_CHECK" ,"MAX_LENGTH_CHECK"));
297    $objErr->doFunc(array("¤ªÌ¾Á°¡Ê̾¡Ë", 'name02', STEXT_LEN), array("EXIST_CHECK", "SPTAB_CHECK" ,"MAX_LENGTH_CHECK"));
298    $objErr->doFunc(array("¤ªÌ¾Á°¡Ê¥«¥Ê/À«¡Ë", 'kana01', STEXT_LEN), array("EXIST_CHECK", "SPTAB_CHECK" ,"MAX_LENGTH_CHECK", "KANA_CHECK"));
299    $objErr->doFunc(array("¤ªÌ¾Á°¡Ê¥«¥Ê/̾¡Ë", 'kana02', STEXT_LEN), array("EXIST_CHECK", "SPTAB_CHECK" ,"MAX_LENGTH_CHECK", "KANA_CHECK"));
300    $objErr->doFunc(array("͹ÊØÈÖ¹æ1", "zip01", ZIP01_LEN ) ,array("EXIST_CHECK", "SPTAB_CHECK" ,"NUM_CHECK", "NUM_COUNT_CHECK"));
301    $objErr->doFunc(array("͹ÊØÈÖ¹æ2", "zip02", ZIP02_LEN ) ,array("EXIST_CHECK", "SPTAB_CHECK" ,"NUM_CHECK", "NUM_COUNT_CHECK"));
302    $objErr->doFunc(array("͹ÊØÈÖ¹æ", "zip01", "zip02"), array("ALL_EXIST_CHECK"));
303    $objErr->doFunc(array("ÅÔÆ»Éܸ©", 'pref'), array("SELECT_CHECK","NUM_CHECK"));
304    $objErr->doFunc(array("»Ô¶èĮ¼", "addr01", MTEXT_LEN), array("EXIST_CHECK","SPTAB_CHECK" ,"MAX_LENGTH_CHECK"));
305    $objErr->doFunc(array("ÈÖÃÏ", "addr02", MTEXT_LEN), array("EXIST_CHECK","SPTAB_CHECK" ,"MAX_LENGTH_CHECK"));
306    $objErr->doFunc(array('¥á¡¼¥ë¥¢¥É¥ì¥¹', "email", MTEXT_LEN) ,array("EXIST_CHECK", "EMAIL_CHECK", "NO_SPTAB" ,"EMAIL_CHAR_CHECK", "MAX_LENGTH_CHECK"));
307    $objErr->doFunc(array("ÅÅÏÃÈÖ¹æ1", 'tel01'), array("EXIST_CHECK","SPTAB_CHECK"));
308    $objErr->doFunc(array("ÅÅÏÃÈÖ¹æ2", 'tel02'), array("EXIST_CHECK","SPTAB_CHECK"));
309    $objErr->doFunc(array("ÅÅÏÃÈÖ¹æ3", 'tel03'), array("EXIST_CHECK","SPTAB_CHECK"));
310    $objErr->doFunc(array("ÅÅÏÃÈÖ¹æ", "tel01", "tel02", "tel03", TEL_LEN) ,array("TEL_CHECK"));
311    $objErr->doFunc(array("FAXÈÖ¹æ", "fax01", "fax02", "fax03", TEL_LEN) ,array("TEL_CHECK"));
312    $objErr->doFunc(array("À­ÊÌ", "sex") ,array("SELECT_CHECK", "NUM_CHECK"));
313    $objErr->doFunc(array("¤´¿¦¶È", "job") ,array("NUM_CHECK"));
314    $objErr->doFunc(array("À¸Ç¯·îÆü", "year", "month", "day"), array("CHECK_DATE"));
315    $objErr->doFunc(array("¥Ñ¥¹¥ï¡¼¥É", 'password', PASSWORD_LEN1, PASSWORD_LEN2), array("EXIST_CHECK", "ALNUM_CHECK", "NUM_RANGE_CHECK"));
316    $objErr->doFunc(array("¥Ñ¥¹¥ï¡¼¥É³ÎǧÍѤμÁÌä", "reminder") ,array("SELECT_CHECK", "NUM_CHECK"));
317    $objErr->doFunc(array("¥Ñ¥¹¥ï¡¼¥É³ÎǧÍѤμÁÌä¤ÎÅú¤¨", "reminder_answer", STEXT_LEN) ,array("EXIST_CHECK", "MAX_LENGTH_CHECK"));
318    return $objErr->arrErr;
319   
320}
321
322//---- ÆþÎÏ¥¨¥é¡¼¥Á¥§¥Ã¥¯
323function lfErrorCheck1($array) {
324
325    global $objConn;
326    global $objCustomer;
327    $objErr = new SC_CheckError($array);
328   
329    $objErr->doFunc(array("¤ªÌ¾Á°¡ÊÀ«¡Ë", 'name01', STEXT_LEN), array("EXIST_CHECK", "NO_SPTAB", "SPTAB_CHECK" ,"MAX_LENGTH_CHECK"));
330    $objErr->doFunc(array("¤ªÌ¾Á°¡Ê̾¡Ë", 'name02', STEXT_LEN), array("EXIST_CHECK", "NO_SPTAB", "SPTAB_CHECK" , "MAX_LENGTH_CHECK"));
331    $objErr->doFunc(array("¤ªÌ¾Á°¡Ê¥«¥Ê/À«¡Ë", 'kana01', STEXT_LEN), array("EXIST_CHECK", "NO_SPTAB", "SPTAB_CHECK" ,"MAX_LENGTH_CHECK", "KANA_CHECK"));
332    $objErr->doFunc(array("¤ªÌ¾Á°¡Ê¥«¥Ê/̾¡Ë", 'kana02', STEXT_LEN), array("EXIST_CHECK", "NO_SPTAB", "SPTAB_CHECK" ,"MAX_LENGTH_CHECK", "KANA_CHECK"));
333    $objErr->doFunc(array('¥á¡¼¥ë¥¢¥É¥ì¥¹', "email", MTEXT_LEN) ,array("NO_SPTAB", "EXIST_CHECK", "EMAIL_CHECK", "SPTAB_CHECK" ,"EMAIL_CHAR_CHECK", "MAX_LENGTH_CHECK", "MOBILE_EMAIL_CHECK"));
334
335    //¸½²ñ°÷¤ÎȽÄê ¢ª¡¡¸½²ñ°÷¤â¤·¤¯¤Ï²¾ÅÐÏ¿Ãæ¤Ï¡¢¥á¥¢¥É°ì°Õ¤¬Á°Äó¤Ë¤Ê¤Ã¤Æ¤ë¤Î¤ÇƱ¤¸¥á¥¢¥É¤ÇÅÐÏ¿ÉÔ²Ä
336    $array["customer_id"] = $objCustomer->getValue('customer_id');
337    if (strlen($array["email"]) > 0) {
338        $objQuery = new SC_Query();
339        $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"]));
340
341        if(count($arrRet) > 0) {
342            if($arrRet[0]['del_flg'] != '1') {
343                // ²ñ°÷¤Ç¤¢¤ë¾ì¹ç
344                $objErr->arrErr["email"] .= "¢¨ ¤¹¤Ç¤Ë²ñ°÷ÅÐÏ¿¤Ç»ÈÍѤµ¤ì¤Æ¤¤¤ë¥á¡¼¥ë¥¢¥É¥ì¥¹¤Ç¤¹¡£<br />";
345            } else {
346                // Âà²ñ¤·¤¿²ñ°÷¤Ç¤¢¤ë¾ì¹ç
347                $leave_time = sfDBDatetoTime($arrRet[0]['update_date']);
348                $now_time = time();
349                $pass_time = $now_time - $leave_time;
350                // Âà²ñ¤«¤é²¿»þ´Ö-·Ð²á¤·¤Æ¤¤¤ë¤«È½Äꤹ¤ë¡£
351                $limit_time = ENTRY_LIMIT_HOUR * 3600;                     
352                if($pass_time < $limit_time) {
353                    $objErr->arrErr["email"] .= "¢¨ Âà²ñ¤«¤é°ìÄê´ü´Ö¤Î´Ö¤Ï¡¢Æ±¤¸¥á¡¼¥ë¥¢¥É¥ì¥¹¤ò»ÈÍѤ¹¤ë¤³¤È¤Ï¤Ç¤­¤Þ¤»¤ó¡£<br />";
354                }
355            }
356        }
357    }
358
359    $objErr->doFunc(array("¥Ñ¥¹¥ï¡¼¥É", 'password', PASSWORD_LEN1, PASSWORD_LEN2), array("EXIST_CHECK", "SPTAB_CHECK" ,"ALNUM_CHECK", "NUM_RANGE_CHECK"));
360    $objErr->doFunc(array("¥Ñ¥¹¥ï¡¼¥É³ÎǧÍѤμÁÌä", "reminder") ,array("SELECT_CHECK", "NUM_CHECK"));
361    $objErr->doFunc(array("¥Ñ¥¹¥ï¡¼¥É³ÎǧÍѤμÁÌä¤ÎÅú¤¨", "reminder_answer", STEXT_LEN) ,array("EXIST_CHECK","SPTAB_CHECK" , "MAX_LENGTH_CHECK"));
362   
363    return $objErr->arrErr;
364}
365
366//---- ÆþÎÏ¥¨¥é¡¼¥Á¥§¥Ã¥¯
367function lfErrorCheck2($array) {
368
369    global $objConn;
370    $objErr = new SC_CheckError($array);
371   
372    $objErr->doFunc(array("͹ÊØÈÖ¹æ1", "zip01", ZIP01_LEN ) ,array("EXIST_CHECK", "SPTAB_CHECK" ,"NUM_CHECK", "NUM_COUNT_CHECK"));
373    $objErr->doFunc(array("͹ÊØÈÖ¹æ2", "zip02", ZIP02_LEN ) ,array("EXIST_CHECK", "SPTAB_CHECK" ,"NUM_CHECK", "NUM_COUNT_CHECK"));
374    $objErr->doFunc(array("͹ÊØÈÖ¹æ", "zip01", "zip02"), array("ALL_EXIST_CHECK"));
375
376    $objErr->doFunc(array("À­ÊÌ", "sex") ,array("SELECT_CHECK", "NUM_CHECK"));
377    $objErr->doFunc(array("À¸Ç¯·îÆü", "year", "month", "day"), array("SELECT_CHECK", "CHECK_DATE"));
378   
379    return $objErr->arrErr;
380}
381
382//---- ÆþÎÏ¥¨¥é¡¼¥Á¥§¥Ã¥¯
383function lfErrorCheck3($array) {
384
385    global $objConn;
386    $objErr = new SC_CheckError($array);
387   
388    $objErr->doFunc(array("ÅÔÆ»Éܸ©", 'pref'), array("SELECT_CHECK","NUM_CHECK"));
389    $objErr->doFunc(array("»Ô¶èĮ¼", "addr01", MTEXT_LEN), array("EXIST_CHECK","SPTAB_CHECK" ,"MAX_LENGTH_CHECK"));
390    $objErr->doFunc(array("ÈÖÃÏ", "addr02", MTEXT_LEN), array("EXIST_CHECK","SPTAB_CHECK" ,"MAX_LENGTH_CHECK"));
391    $objErr->doFunc(array("ÅÅÏÃÈÖ¹æ1", 'tel01'), array("EXIST_CHECK","SPTAB_CHECK" ));
392    $objErr->doFunc(array("ÅÅÏÃÈÖ¹æ2", 'tel02'), array("EXIST_CHECK","SPTAB_CHECK" ));
393    $objErr->doFunc(array("ÅÅÏÃÈÖ¹æ3", 'tel03'), array("EXIST_CHECK","SPTAB_CHECK" ));
394    $objErr->doFunc(array("ÅÅÏÃÈÖ¹æ", "tel01", "tel02", "tel03",TEL_ITEM_LEN) ,array("TEL_CHECK"));
395   
396    return $objErr->arrErr;
397}
398
399//³Îǧ¥Ú¡¼¥¸Íѥѥ¹¥ï¡¼¥Éɽ¼¨ÍÑ
400
401function lfPassLen($passlen){
402    $ret = "";
403    for ($i=0;$i<$passlen;true){
404    $ret.="*";
405    $i++;
406    }
407    return $ret;
408}
409
410
411// ͹ÊØÈֹ椫¤é½»½ê¤Î¼èÆÀ
412function lfGetAddress($zipcode) {
413    global $arrPref;
414
415    $conn = new SC_DBconn(ZIP_DSN);
416
417    // ͹ÊØÈֹ渡º÷ʸºîÀ®
418    $zipcode = mb_convert_kana($zipcode ,"n");
419    $sqlse = "SELECT state, city, town FROM mtb_zip WHERE zipcode = ?";
420
421    $data_list = $conn->getAll($sqlse, array($zipcode));
422
423    // ¥¤¥ó¥Ç¥Ã¥¯¥¹¤ÈÃͤòȿž¤µ¤»¤ë¡£
424    $arrREV_PREF = array_flip($arrPref);
425
426    /*
427        Áí̳¾Ê¤«¤é¥À¥¦¥ó¥í¡¼¥É¤·¤¿¥Ç¡¼¥¿¤ò¤½¤Î¤Þ¤Þ¥¤¥ó¥Ý¡¼¥È¤¹¤ë¤È
428        °Ê²¼¤Î¤è¤¦¤Êʸ»úÎó¤¬Æþ¤Ã¤Æ¤¤¤ë¤Î¤Ç  Âкö¤¹¤ë¡£
429        ¡¦¡Ê£±¡¦£±£¹ÃúÌÜ¡Ë
430        ¡¦°Ê²¼¤Ë·ÇºÜ¤¬¤Ê¤¤¾ì¹ç
431    */
432    $town =  $data_list[0]['town'];
433    $town = ereg_replace("¡Ê.*¡Ë$","",$town);
434    $town = ereg_replace("°Ê²¼¤Ë·ÇºÜ¤¬¤Ê¤¤¾ì¹ç","",$town);
435    $data_list[0]['town'] = $town;
436    $data_list[0]['state'] = $arrREV_PREF[$data_list[0]['state']];
437
438    return $data_list;
439}
440
441//¸ÜµÒ¾ðÊó¤Î¼èÆÀ
442function lfGetCustomerData(){
443    global $objQuery;
444    global $objCustomer;
445    //¸ÜµÒ¾ðÊó¼èÆÀ
446    $ret = $objQuery->select("*","dtb_customer","customer_id=?", array($objCustomer->getValue('customer_id')));
447    $arrForm = $ret[0];
448    $arrForm['email'] = $arrForm['email_mobile'];
449
450    //¥á¥ë¥Þ¥¬¥Õ¥é¥°¼èÆÀ
451    $arrForm['mail_flag'] = $objQuery->get("dtb_customer_mail","mail_flag","email=?", array($objCustomer->getValue('email_mobile')));
452   
453    //ÃÂÀ¸Æü¤Îǯ·îÆü¼èÆÀ
454    if (isset($arrForm['birth'])){
455        $birth = split(" ", $arrForm["birth"]);
456        list($year, $month, $day) = split("-",$birth[0]);
457       
458        $arrForm['year'] = $year;
459        $arrForm['month'] = $month;
460        $arrForm['day'] = $day;
461       
462    }
463    return $arrForm;
464}
465
466
467//-----------------------------------------------------------------------------------------------------------------------------------
468?>
Note: See TracBrowser for help on using the repository browser.