1 | <?php
|
---|
2 | /*
|
---|
3 | * Copyright(c) 2000-2006 LOCKON CO.,LTD. All Rights Reserved.
|
---|
4 | *
|
---|
5 | * http://www.lockon.co.jp/
|
---|
6 | */
|
---|
7 |
|
---|
8 | require_once("../require.php");
|
---|
9 |
|
---|
10 | class 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ȽÄê
|
---|
31 | if (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 |
|
---|
76 | if ($_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 | lfRegistData ($uniqid);
|
---|
221 | header("Location:" . gfAddSessionId("./payment.php"));
|
---|
222 | print($_POST);
|
---|
223 | }
|
---|
224 |
|
---|
225 | //--¡¡²¾ÅÐÏ¿¤È´°Î»²èÌÌ
|
---|
226 | if ($_POST["mode"] == "complete") {
|
---|
227 | $objPage->uniqid = lfRegistData ($objPage->arrForm, $arrRegistColumn, $arrRejectRegistColumn);
|
---|
228 |
|
---|
229 | // ¶õ¥á¡¼¥ë¤ò¼õ¿®ºÑ¤ß¤Î¾ì¹ç¤Ï¤¹¤°¤ËËÜÅÐÏ¿´°Î»¤Ë¤¹¤ë¡£
|
---|
230 | // if (isset($_SESSION['mobile']['kara_mail_from'])) {
|
---|
231 | // header("Location:" . gfAddSessionId(MOBILE_URL_DIR . "regist/index.php?mode=regist&id=" . $objPage->uniqid));
|
---|
232 | // exit;
|
---|
233 | // }
|
---|
234 |
|
---|
235 | $objPage->tpl_mainpage = 'shopping/complete.tpl';
|
---|
236 | $objPage->tpl_title = '¤ªµÒÍ;ðÊóÆþÎÏ(´°Î»¥Ú¡¼¥¸)';
|
---|
237 |
|
---|
238 | /*sfMobileSetExtSessionId('id', $objPage->uniqid, 'regist/index.php');
|
---|
239 |
|
---|
240 | //¡¡²¾ÅÐÏ¿´°Î»¥á¡¼¥ëÁ÷¿®
|
---|
241 | $objPage->CONF = $CONF;
|
---|
242 | $objPage->to_name01 = $_POST['name01'];
|
---|
243 | $objPage->to_name02 = $_POST['name02'];
|
---|
244 | $objMailText = new SC_MobileView();
|
---|
245 | $objMailText->assignobj($objPage);
|
---|
246 | $subject = sfMakesubject('¤ªµÒÍ;ðÊó¤Î¤´³Îǧ');
|
---|
247 | $toCustomerMail = $objMailText->fetch("mail_templates/customer_mail.tpl");
|
---|
248 | $objMail = new GC_SendMail();
|
---|
249 | $objMail->setItem(
|
---|
250 | '' //¡¡°¸Àè
|
---|
251 | , $subject //¡¡¥µ¥Ö¥¸¥§¥¯¥È
|
---|
252 | , $toCustomerMail //¡¡ËÜʸ
|
---|
253 | , $CONF["email03"] //¡¡ÇÛÁ÷¸µ¥¢¥É¥ì¥¹
|
---|
254 | , $CONF["shop_name"] //¡¡ÇÛÁ÷¸µ¡¡Ì¾Á°
|
---|
255 | , $CONF["email03"] //¡¡reply_to
|
---|
256 | , $CONF["email04"] //¡¡return_path
|
---|
257 | , $CONF["email04"] // Errors_to
|
---|
258 | , $CONF["email01"] // Bcc
|
---|
259 | );
|
---|
260 | // °¸Àè¤ÎÀßÄê
|
---|
261 | $name = $_POST["name01"] . $_POST["name02"] ." ÍÍ";
|
---|
262 | $objMail->setTo($_POST["email"], $name);
|
---|
263 | $objMail->sendMail();
|
---|
264 | */
|
---|
265 | // ´°Î»¥Ú¡¼¥¸¤Ë°ÜÆ°¤µ¤»¤ë¡£
|
---|
266 | header("Location:" . gfAddSessionId("./complete.php"));
|
---|
267 | exit;
|
---|
268 | }
|
---|
269 | }
|
---|
270 | }
|
---|
271 |
|
---|
272 | //----¡¡¥Ú¡¼¥¸É½¼¨
|
---|
273 | $objView->assignobj($objPage);
|
---|
274 | $objView->display(SITE_FRAME);
|
---|
275 |
|
---|
276 | //----------------------------------------------------------------------------------------------------------------------
|
---|
277 |
|
---|
278 | //---- function·²
|
---|
279 | function lfRegistData($uniqid) {
|
---|
280 | global $objFormParam;
|
---|
281 | $arrRet = $objFormParam->getHashArray();
|
---|
282 | $sqlval = $objFormParam->getDbArray();
|
---|
283 | // ÅÐÏ¿¥Ç¡¼¥¿¤ÎºîÀ®
|
---|
284 | $sqlval['order_temp_id'] = $uniqid;
|
---|
285 | $sqlval['order_birth'] = sfGetTimestamp($arrRet['year'], $arrRet['month'], $arrRet['day']);
|
---|
286 | $sqlval['update_date'] = 'Now()';
|
---|
287 | $sqlval['customer_id'] = '0';
|
---|
288 |
|
---|
289 | // ´û¸¥Ç¡¼¥¿¤Î¥Á¥§¥Ã¥¯
|
---|
290 | $objQuery = new SC_Query();
|
---|
291 | $where = "order_temp_id = ?";
|
---|
292 | $cnt = $objQuery->count("dtb_order_temp", $where, array($uniqid));
|
---|
293 | // ´û¸¥Ç¡¼¥¿¤¬¤Ê¤¤¾ì¹ç
|
---|
294 | if ($cnt == 0) {
|
---|
295 | $sqlval['create_date'] = 'Now()';
|
---|
296 | $objQuery->insert("dtb_order_temp", $sqlval);
|
---|
297 | } else {
|
---|
298 | $objQuery->update("dtb_order_temp", $sqlval, $where, array($uniqid));
|
---|
299 | }
|
---|
300 | }
|
---|
301 |
|
---|
302 | //----¡¡¼èÆÀʸ»úÎó¤ÎÊÑ´¹
|
---|
303 | function lfConvertParam($array, $arrRegistColumn) {
|
---|
304 | /*
|
---|
305 | * ʸ»úÎó¤ÎÊÑ´¹
|
---|
306 | * K : ¡ÖȾ³Ñ(Êݶ¸)ÊÒ²¾Ì¾¡×¤ò¡ÖÁ´³ÑÊÒ²¾Ì¾¡×¤ËÊÑ´¹
|
---|
307 | * C : ¡ÖÁ´³Ñ¤Ò¤é²¾Ì¾¡×¤ò¡ÖÁ´³Ñ¤«¤¿²¾Ì¾¡×¤ËÊÑ´¹
|
---|
308 | * V : ÂùÅÀÉÕ¤¤Îʸ»ú¤ò°ìʸ»ú¤ËÊÑ´¹¡£"K","H"¤È¶¦¤Ë»ÈÍѤ·¤Þ¤¹
|
---|
309 | * n : ¡ÖÁ´³Ñ¡×¿ô»ú¤ò¡ÖȾ³Ñ(Êݶ¸)¡×¤ËÊÑ´¹
|
---|
310 | * a : Á´³Ñ±Ñ¿ô»ú¤òȾ³Ñ±Ñ¿ô»ú¤ËÊÑ´¹¤¹¤ë
|
---|
311 | */
|
---|
312 | // ¥«¥é¥à̾¤È¥³¥ó¥Ð¡¼¥È¾ðÊó
|
---|
313 | foreach ($arrRegistColumn as $data) {
|
---|
314 | $arrConvList[ $data["column"] ] = $data["convert"];
|
---|
315 | }
|
---|
316 | // ʸ»úÊÑ´¹
|
---|
317 | foreach ($arrConvList as $key => $val) {
|
---|
318 | // POST¤µ¤ì¤Æ¤¤¿ÃͤΤßÊÑ´¹¤¹¤ë¡£
|
---|
319 | if(strlen(($array[$key])) > 0) {
|
---|
320 | $array[$key] = mb_convert_kana($array[$key] ,$val);
|
---|
321 | }
|
---|
322 | }
|
---|
323 | return $array;
|
---|
324 | }
|
---|
325 |
|
---|
326 |
|
---|
327 | //---- ÆþÎÏ¥¨¥é¡¼¥Á¥§¥Ã¥¯
|
---|
328 | function lfErrorCheck2($array) {
|
---|
329 |
|
---|
330 | global $objConn, $objDate;
|
---|
331 | $objErr = new SC_CheckError($array);
|
---|
332 |
|
---|
333 | $objErr->doFunc(array("͹ÊØÈÖ¹æ1", "zip01", ZIP01_LEN ) ,array("EXIST_CHECK", "SPTAB_CHECK" ,"NUM_CHECK", "NUM_COUNT_CHECK"));
|
---|
334 | $objErr->doFunc(array("͹ÊØÈÖ¹æ2", "zip02", ZIP02_LEN ) ,array("EXIST_CHECK", "SPTAB_CHECK" ,"NUM_CHECK", "NUM_COUNT_CHECK"));
|
---|
335 | $objErr->doFunc(array("͹ÊØÈÖ¹æ", "zip01", "zip02"), array("ALL_EXIST_CHECK"));
|
---|
336 |
|
---|
337 | $objErr->doFunc(array("ÀÊÌ", "sex") ,array("SELECT_CHECK", "NUM_CHECK"));
|
---|
338 | $objErr->doFunc(array("À¸Ç¯·îÆü (ǯ)", "year", 4), array("EXIST_CHECK", "SPTAB_CHECK", "NUM_CHECK", "NUM_COUNT_CHECK"));
|
---|
339 | if (!isset($objErr->arrErr['year'])) {
|
---|
340 | $objErr->doFunc(array("À¸Ç¯·îÆü (ǯ)", "year", $objDate->getStartYear()), array("MIN_CHECK"));
|
---|
341 | $objErr->doFunc(array("À¸Ç¯·îÆü (ǯ)", "year", $objDate->getEndYear()), array("MAX_CHECK"));
|
---|
342 | }
|
---|
343 | $objErr->doFunc(array("À¸Ç¯·îÆü (·îÆü)", "month", "day"), array("SELECT_CHECK"));
|
---|
344 | if (!isset($objErr->arrErr['year']) && !isset($objErr->arrErr['month']) && !isset($objErr->arrErr['day'])) {
|
---|
345 | $objErr->doFunc(array("À¸Ç¯·îÆü", "year", "month", "day"), array("CHECK_DATE"));
|
---|
346 | }
|
---|
347 |
|
---|
348 | return $objErr->arrErr;
|
---|
349 | }
|
---|
350 |
|
---|
351 |
|
---|
352 | //---- ÆþÎÏ¥¨¥é¡¼¥Á¥§¥Ã¥¯
|
---|
353 | function lfErrorCheck3($array) {
|
---|
354 |
|
---|
355 | global $objConn;
|
---|
356 | $objErr = new SC_CheckError($array);
|
---|
357 |
|
---|
358 | $objErr->doFunc(array("ÅÔÆ»Éܸ©", 'pref'), array("SELECT_CHECK","NUM_CHECK"));
|
---|
359 | $objErr->doFunc(array("»Ô¶èĮ¼", "addr01", MTEXT_LEN), array("EXIST_CHECK","SPTAB_CHECK" ,"MAX_LENGTH_CHECK"));
|
---|
360 | $objErr->doFunc(array("ÈÖÃÏ", "addr02", MTEXT_LEN), array("EXIST_CHECK","SPTAB_CHECK" ,"MAX_LENGTH_CHECK"));
|
---|
361 | $objErr->doFunc(array("ÅÅÏÃÈÖ¹æ1", 'tel01'), array("EXIST_CHECK","SPTAB_CHECK" ));
|
---|
362 | $objErr->doFunc(array("ÅÅÏÃÈÖ¹æ2", 'tel02'), array("EXIST_CHECK","SPTAB_CHECK" ));
|
---|
363 | $objErr->doFunc(array("ÅÅÏÃÈÖ¹æ3", 'tel03'), array("EXIST_CHECK","SPTAB_CHECK" ));
|
---|
364 | $objErr->doFunc(array("ÅÅÏÃÈÖ¹æ", "tel01", "tel02", "tel03",TEL_ITEM_LEN) ,array("TEL_CHECK"));
|
---|
365 |
|
---|
366 | return $objErr->arrErr;
|
---|
367 | }
|
---|
368 |
|
---|
369 | // ͹ÊØÈֹ椫¤é½»½ê¤Î¼èÆÀ
|
---|
370 | function lfGetAddress($zipcode) {
|
---|
371 | global $arrPref;
|
---|
372 |
|
---|
373 | $conn = new SC_DBconn(ZIP_DSN);
|
---|
374 |
|
---|
375 | // ͹ÊØÈֹ渡º÷ʸºîÀ®
|
---|
376 | $zipcode = mb_convert_kana($zipcode ,"n");
|
---|
377 | $sqlse = "SELECT state, city, town FROM mtb_zip WHERE zipcode = ?";
|
---|
378 |
|
---|
379 | $data_list = $conn->getAll($sqlse, array($zipcode));
|
---|
380 |
|
---|
381 | // ¥¤¥ó¥Ç¥Ã¥¯¥¹¤ÈÃͤòȿž¤µ¤»¤ë¡£
|
---|
382 | $arrREV_PREF = array_flip($arrPref);
|
---|
383 |
|
---|
384 | /*
|
---|
385 | Áí̳¾Ê¤«¤é¥À¥¦¥ó¥í¡¼¥É¤·¤¿¥Ç¡¼¥¿¤ò¤½¤Î¤Þ¤Þ¥¤¥ó¥Ý¡¼¥È¤¹¤ë¤È
|
---|
386 | °Ê²¼¤Î¤è¤¦¤Êʸ»úÎó¤¬Æþ¤Ã¤Æ¤¤¤ë¤Î¤Ç Âкö¤¹¤ë¡£
|
---|
387 | ¡¦¡Ê£±¡¦£±£¹ÃúÌÜ¡Ë
|
---|
388 | ¡¦°Ê²¼¤Ë·ÇºÜ¤¬¤Ê¤¤¾ì¹ç
|
---|
389 | */
|
---|
390 | $town = $data_list[0]['town'];
|
---|
391 | $town = ereg_replace("¡Ê.*¡Ë$","",$town);
|
---|
392 | $town = ereg_replace("°Ê²¼¤Ë·ÇºÜ¤¬¤Ê¤¤¾ì¹ç","",$town);
|
---|
393 | $data_list[0]['town'] = $town;
|
---|
394 | $data_list[0]['state'] = $arrREV_PREF[$data_list[0]['state']];
|
---|
395 |
|
---|
396 | return $data_list;
|
---|
397 | }
|
---|
398 |
|
---|
399 | //-----------------------------------------------------------------------------------------------------------------------------------
|
---|
400 | ?> |
---|