1 | <?php |
---|
2 | /* |
---|
3 | * This file is part of EC-CUBE |
---|
4 | * |
---|
5 | * Copyright(c) 2000-2007 LOCKON CO.,LTD. All Rights Reserved. |
---|
6 | * |
---|
7 | * http://www.lockon.co.jp/ |
---|
8 | * |
---|
9 | * This program is free software; you can redistribute it and/or |
---|
10 | * modify it under the terms of the GNU General Public License |
---|
11 | * as published by the Free Software Foundation; either version 2 |
---|
12 | * of the License, or (at your option) any later version. |
---|
13 | * |
---|
14 | * This program is distributed in the hope that it will be useful, |
---|
15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
17 | * GNU General Public License for more details. |
---|
18 | * |
---|
19 | * You should have received a copy of the GNU General Public License |
---|
20 | * along with this program; if not, write to the Free Software |
---|
21 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
---|
22 | */ |
---|
23 | |
---|
24 | // {{{ requires |
---|
25 | require_once(CLASS_PATH . "pages/LC_Page.php"); |
---|
26 | |
---|
27 | /** |
---|
28 | * 会員登録(入力ページ) のページクラス. |
---|
29 | * |
---|
30 | * @package Page |
---|
31 | * @author LOCKON CO.,LTD. |
---|
32 | * @version $Id:LC_Page_Entry.php 15532 2007-08-31 14:39:46Z nanasess $ |
---|
33 | */ |
---|
34 | class LC_Page_Entry extends LC_Page { |
---|
35 | |
---|
36 | // }}} |
---|
37 | // {{{ functions |
---|
38 | |
---|
39 | /** |
---|
40 | * Page を初期化する. |
---|
41 | * |
---|
42 | * @return void |
---|
43 | */ |
---|
44 | function init() { |
---|
45 | parent::init(); |
---|
46 | $this->tpl_mainpage = 'entry/index.tpl'; |
---|
47 | $this->tpl_title .= '会員登録(入力ページ)'; |
---|
48 | $this->year = ""; |
---|
49 | $masterData = new SC_DB_MasterData_Ex(); |
---|
50 | $this->arrPref = $masterData->getMasterData("mtb_pref", |
---|
51 | array("pref_id", "pref_name", "rank")); |
---|
52 | $this->arrJob = $masterData->getMasterData("mtb_job"); |
---|
53 | $this->arrReminder = $masterData->getMasterData("mtb_reminder"); |
---|
54 | $this->objDate = new SC_Date(START_BIRTH_YEAR, date("Y",strtotime("now"))); |
---|
55 | $this->arrYear = $this->objDate->getYear('', 1950); // 日付プルダウン設定 |
---|
56 | $this->arrMonth = $this->objDate->getMonth(); |
---|
57 | $this->arrDay = $this->objDate->getDay(); |
---|
58 | } |
---|
59 | |
---|
60 | /** |
---|
61 | * Page のプロセス. |
---|
62 | * |
---|
63 | * @return void |
---|
64 | */ |
---|
65 | function process() { |
---|
66 | global $objCampaignSess; |
---|
67 | |
---|
68 | $objConn = new SC_DbConn(); |
---|
69 | $objView = new SC_SiteView(); |
---|
70 | $objCustomer = new SC_Customer(); |
---|
71 | $objCampaignSess = new SC_CampaignSession(); |
---|
72 | $objDb = new SC_Helper_DB_Ex(); |
---|
73 | $CONF = $objDb->sf_getBasisData(); |
---|
74 | $objDate = new SC_Date(START_BIRTH_YEAR, date("Y",strtotime("now"))); |
---|
75 | |
---|
76 | // 規約ページからの遷移でなければエラー画面へ遷移する |
---|
77 | if (empty($_POST) && !preg_match('/kiyaku.php/', basename($_SERVER['HTTP_REFERER']))) { |
---|
78 | SC_Utils_Ex::sfDispSiteError(PAGE_ERROR, "", true); |
---|
79 | } |
---|
80 | |
---|
81 | // レイアウトデザインを取得 |
---|
82 | $layout = new SC_Helper_PageLayout_Ex(); |
---|
83 | $layout->sfGetPageLayout($this, false, DEF_LAYOUT); |
---|
84 | |
---|
85 | //---- 登録用カラム配列 |
---|
86 | $arrRegistColumn = array( |
---|
87 | array( "column" => "name01", "convert" => "aKV" ), |
---|
88 | array( "column" => "name02", "convert" => "aKV" ), |
---|
89 | array( "column" => "kana01", "convert" => "CKV" ), |
---|
90 | array( "column" => "kana02", "convert" => "CKV" ), |
---|
91 | array( "column" => "zip01", "convert" => "n" ), |
---|
92 | array( "column" => "zip02", "convert" => "n" ), |
---|
93 | array( "column" => "pref", "convert" => "n" ), |
---|
94 | array( "column" => "addr01", "convert" => "aKV" ), |
---|
95 | array( "column" => "addr02", "convert" => "aKV" ), |
---|
96 | array( "column" => "email", "convert" => "a" ), |
---|
97 | array( "column" => "email2", "convert" => "a" ), |
---|
98 | array( "column" => "email_mobile", "convert" => "a" ), |
---|
99 | array( "column" => "email_mobile2", "convert" => "a" ), |
---|
100 | array( "column" => "tel01", "convert" => "n" ), |
---|
101 | array( "column" => "tel02", "convert" => "n" ), |
---|
102 | array( "column" => "tel03", "convert" => "n" ), |
---|
103 | array( "column" => "fax01", "convert" => "n" ), |
---|
104 | array( "column" => "fax02", "convert" => "n" ), |
---|
105 | array( "column" => "fax03", "convert" => "n" ), |
---|
106 | array( "column" => "sex", "convert" => "n" ), |
---|
107 | array( "column" => "job", "convert" => "n" ), |
---|
108 | array( "column" => "birth", "convert" => "n" ), |
---|
109 | array( "column" => "reminder", "convert" => "n" ), |
---|
110 | array( "column" => "reminder_answer", "convert" => "aKV"), |
---|
111 | array( "column" => "password", "convert" => "a" ), |
---|
112 | array( "column" => "password02", "convert" => "a" ), |
---|
113 | array( "column" => "mailmaga_flg", "convert" => "n" ), |
---|
114 | ); |
---|
115 | |
---|
116 | //---- 登録除外用カラム配列 |
---|
117 | $arrRejectRegistColumn = array("year", "month", "day", "email02", "email_mobile02", "password02"); |
---|
118 | |
---|
119 | if ($_SERVER["REQUEST_METHOD"] == "POST") { |
---|
120 | |
---|
121 | if (!$this->isValidToken()) { |
---|
122 | SC_Utils_Ex::sfDispSiteError(PAGE_ERROR, "", true); |
---|
123 | } |
---|
124 | |
---|
125 | //-- POSTデータの引き継ぎ |
---|
126 | $this->arrForm = $_POST; |
---|
127 | |
---|
128 | if($this->arrForm['year'] == '----') { |
---|
129 | $this->arrForm['year'] = ''; |
---|
130 | } |
---|
131 | |
---|
132 | $this->arrForm['email'] = strtolower($this->arrForm['email']); // emailはすべて小文字で処理 |
---|
133 | $this->arrForm['email02'] = strtolower($this->arrForm['email02']); // emailはすべて小文字で処理 |
---|
134 | |
---|
135 | //-- 入力データの変換 |
---|
136 | $this->arrForm = $this->lfConvertParam($this->arrForm, $arrRegistColumn); |
---|
137 | |
---|
138 | //-- 入力エラーチェック |
---|
139 | $this->arrErr = $this->lfErrorCheck($this->arrForm); |
---|
140 | |
---|
141 | if ($this->arrErr || $_POST["mode"] == "return") { // 入力エラーのチェック |
---|
142 | foreach($this->arrForm as $key => $val) { |
---|
143 | $this->$key = $val; |
---|
144 | } |
---|
145 | |
---|
146 | } else { |
---|
147 | |
---|
148 | //-- 確認 |
---|
149 | if ($_POST["mode"] == "confirm") { |
---|
150 | foreach($this->arrForm as $key => $val) { |
---|
151 | if ($key != "mode" && $key != "subm") $this->list_data[ $key ] = $val; |
---|
152 | } |
---|
153 | //パスワード表示 |
---|
154 | $passlen = strlen($this->arrForm['password']); |
---|
155 | $this->passlen = SC_Utils_Ex::lfPassLen($passlen); |
---|
156 | |
---|
157 | $this->tpl_css = '/css/layout/entry/confirm.css'; |
---|
158 | $this->tpl_mainpage = 'entry/confirm.tpl'; |
---|
159 | $this->tpl_title = '会員登録(確認ページ)'; |
---|
160 | |
---|
161 | } |
---|
162 | |
---|
163 | //-- 会員登録と完了画面 |
---|
164 | if ($_POST["mode"] == "complete") { |
---|
165 | // キャンペーンからの遷移の時用の値 |
---|
166 | if($objCampaignSess->getIsCampaign()) { |
---|
167 | $this->etc_value = "&cp=".$objCampaignSess->getCampaignId(); |
---|
168 | } |
---|
169 | |
---|
170 | // 会員情報の登録 |
---|
171 | $this->CONF = $CONF; |
---|
172 | $this->uniqid = $this->lfRegistData ($this->arrForm, $arrRegistColumn, $arrRejectRegistColumn, CUSTOMER_CONFIRM_MAIL); |
---|
173 | |
---|
174 | $this->tpl_css = '/css/layout/entry/complete.css'; |
---|
175 | $this->tpl_mainpage = 'entry/complete.tpl'; |
---|
176 | $this->tpl_title = '会員登録(完了ページ)'; |
---|
177 | |
---|
178 | // 完了メール送信 |
---|
179 | $this->name01 = $_POST['name01']; |
---|
180 | $this->name02 = $_POST['name02']; |
---|
181 | $objMailText = new SC_SiteView(); |
---|
182 | $objMailText->assignobj($this); |
---|
183 | |
---|
184 | $mailHelper = new SC_Helper_Mail_Ex(); |
---|
185 | $objQuery = new SC_Query(); |
---|
186 | // 仮会員が有効の場合 |
---|
187 | if(CUSTOMER_CONFIRM_MAIL == true) { |
---|
188 | $subject = $mailHelper->sfMakesubject($objQuery, $objMailText, $this, '会員登録のご確認'); |
---|
189 | $toCustomerMail = $objMailText->fetch("mail_templates/customer_mail.tpl"); |
---|
190 | } else { |
---|
191 | $subject = $mailHelper->sfMakesubject($objQuery, $objMailText, $this, '会員登録のご完了'); |
---|
192 | $toCustomerMail = $objMailText->fetch("mail_templates/customer_regist_mail.tpl"); |
---|
193 | // ログイン状態にする |
---|
194 | $objCustomer->setLogin($_POST["email"]); |
---|
195 | } |
---|
196 | |
---|
197 | $objMail = new SC_SendMail(); |
---|
198 | $objMail->setItem( |
---|
199 | '' // 宛先 |
---|
200 | , $subject // サブジェクト |
---|
201 | , $toCustomerMail // 本文 |
---|
202 | , $CONF["email03"] // 配送元アドレス |
---|
203 | , $CONF["shop_name"] // 配送元 名前 |
---|
204 | , $CONF["email03"] // reply_to |
---|
205 | , $CONF["email04"] // return_path |
---|
206 | , $CONF["email04"] // Errors_to |
---|
207 | ); |
---|
208 | // 宛先の設定 |
---|
209 | $name = $_POST["name01"] . $_POST["name02"] ." 様"; |
---|
210 | $objMail->setTo($_POST["email"], $name); |
---|
211 | $objMail->sendMail(); |
---|
212 | |
---|
213 | // 完了ページに移動させる。 |
---|
214 | $customer_id = $objQuery->get("dtb_customer", "customer_id", "secret_key = ?", array($this->uniqid)); |
---|
215 | $this->sendRedirect($this->getLocation("./complete.php", array("ci" => $customer_id))); |
---|
216 | exit; |
---|
217 | } |
---|
218 | } |
---|
219 | } |
---|
220 | |
---|
221 | if($this->year == '') { |
---|
222 | $this->year = '----'; |
---|
223 | } |
---|
224 | |
---|
225 | $this->transactionid = $this->getToken(); |
---|
226 | |
---|
227 | //---- ページ表示 |
---|
228 | $objView->assignobj($this); |
---|
229 | // フレームを選択(キャンペーンページから遷移なら変更) |
---|
230 | $objCampaignSess->pageView($objView); |
---|
231 | } |
---|
232 | |
---|
233 | /** |
---|
234 | * モバイルページを初期化する. |
---|
235 | * |
---|
236 | * @return void |
---|
237 | */ |
---|
238 | function mobileInit() { |
---|
239 | $this->init(); |
---|
240 | $this->tpl_mainpage = 'entry/index.tpl'; // メインテンプレート |
---|
241 | $this->tpl_title .= '会員登録(1/3)'; // ページタイトル |
---|
242 | } |
---|
243 | |
---|
244 | /** |
---|
245 | * Page のプロセス(モバイル). |
---|
246 | * |
---|
247 | * @return void |
---|
248 | */ |
---|
249 | function mobileProcess() { |
---|
250 | //---- ページ初期設定 |
---|
251 | $objDb = new SC_Helper_DB_Ex(); |
---|
252 | $objMobile = new SC_Helper_Mobile_Ex(); |
---|
253 | $CONF = $objDb->sf_getBasisData(); // 店舗基本情報 |
---|
254 | $objConn = new SC_DbConn(); |
---|
255 | $objView = new SC_MobileView(); |
---|
256 | $objCustomer = new SC_Customer(); |
---|
257 | $objDate = new SC_Date(START_BIRTH_YEAR, date("Y",strtotime("now"))); |
---|
258 | |
---|
259 | // 空メール |
---|
260 | if (isset($_SESSION['mobile']['kara_mail_from'])) { |
---|
261 | $_POST['email'] = $_SESSION['mobile']['kara_mail_from']; |
---|
262 | $this->tpl_kara_mail_from = $_POST['email']; |
---|
263 | } elseif (MOBILE_USE_KARA_MAIL) { |
---|
264 | $token = $objMobile->gfPrepareKaraMail('entry/index.php'); |
---|
265 | if ($token !== false) { |
---|
266 | $this->tpl_mainpage = 'entry/mail.tpl'; |
---|
267 | $this->tpl_title = '会員登録(空メール)'; |
---|
268 | $this->tpl_kara_mail_to = MOBILE_KARA_MAIL_ADDRESS_USER . MOBILE_KARA_MAIL_ADDRESS_DELIMITER . 'entry_' . $token . '@' . MOBILE_KARA_MAIL_ADDRESS_DOMAIN; |
---|
269 | $this->tpl_from_address = $CONF['email03']; |
---|
270 | } |
---|
271 | } |
---|
272 | |
---|
273 | // レイアウトデザインを取得 |
---|
274 | $objLayout = new SC_Helper_PageLayout_Ex(); |
---|
275 | $objLayout->sfGetPageLayout($this, false, DEF_LAYOUT); |
---|
276 | |
---|
277 | //---- 登録用カラム配列 |
---|
278 | $arrRegistColumn = array( |
---|
279 | array( "column" => "name01", "convert" => "aKV" ), |
---|
280 | array( "column" => "name02", "convert" => "aKV" ), |
---|
281 | array( "column" => "kana01", "convert" => "CKV" ), |
---|
282 | array( "column" => "kana02", "convert" => "CKV" ), |
---|
283 | array( "column" => "zip01", "convert" => "n" ), |
---|
284 | array( "column" => "zip02", "convert" => "n" ), |
---|
285 | array( "column" => "pref", "convert" => "n" ), |
---|
286 | array( "column" => "addr01", "convert" => "aKV" ), |
---|
287 | array( "column" => "addr02", "convert" => "aKV" ), |
---|
288 | array( "column" => "email", "convert" => "a" ), |
---|
289 | array( "column" => "email2", "convert" => "a" ), |
---|
290 | array( "column" => "email_mobile", "convert" => "a" ), |
---|
291 | array( "column" => "email_mobile2", "convert" => "a" ), |
---|
292 | array( "column" => "tel01", "convert" => "n" ), |
---|
293 | array( "column" => "tel02", "convert" => "n" ), |
---|
294 | array( "column" => "tel03", "convert" => "n" ), |
---|
295 | array( "column" => "fax01", "convert" => "n" ), |
---|
296 | array( "column" => "fax02", "convert" => "n" ), |
---|
297 | array( "column" => "fax03", "convert" => "n" ), |
---|
298 | array( "column" => "sex", "convert" => "n" ), |
---|
299 | array( "column" => "job", "convert" => "n" ), |
---|
300 | array( "column" => "birth", "convert" => "n" ), |
---|
301 | array( "column" => "reminder", "convert" => "n" ), |
---|
302 | array( "column" => "reminder_answer", "convert" => "aKV"), |
---|
303 | array( "column" => "password", "convert" => "a" ), |
---|
304 | array( "column" => "password02", "convert" => "a" ), |
---|
305 | array( "column" => "mailmaga_flg", "convert" => "n" ), |
---|
306 | ); |
---|
307 | |
---|
308 | //---- 登録除外用カラム配列 |
---|
309 | $arrRejectRegistColumn = array("year", "month", "day", "email02", "email_mobile02", "password02"); |
---|
310 | |
---|
311 | if ($_SERVER["REQUEST_METHOD"] == "POST") { |
---|
312 | |
---|
313 | //-- POSTデータの引き継ぎ |
---|
314 | $this->arrForm = $_POST; |
---|
315 | |
---|
316 | if(isset($this->arrForm['year']) |
---|
317 | && $this->arrForm['year'] == '----') { |
---|
318 | $this->arrForm['year'] = ''; |
---|
319 | } |
---|
320 | |
---|
321 | $this->arrForm['email'] = strtolower($this->arrForm['email']); // emailはすべて小文字で処理 |
---|
322 | |
---|
323 | //-- 入力データの変換 |
---|
324 | $this->arrForm = $this->lfConvertParam($this->arrForm, $arrRegistColumn); |
---|
325 | |
---|
326 | // 戻るボタン用処理 |
---|
327 | if (!empty($_POST["return"])) { |
---|
328 | switch ($_POST["mode"]) { |
---|
329 | case "complete": |
---|
330 | $_POST["mode"] = "set3"; |
---|
331 | break; |
---|
332 | case "confirm": |
---|
333 | $_POST["mode"] = "set2"; |
---|
334 | break; |
---|
335 | default: |
---|
336 | $_POST["mode"] = "set1"; |
---|
337 | break; |
---|
338 | } |
---|
339 | } |
---|
340 | |
---|
341 | //-- 入力エラーチェック |
---|
342 | if ($_POST["mode"] == "set1") { |
---|
343 | $this->arrErr = $this->lfErrorCheck1($this->arrForm); |
---|
344 | $this->tpl_mainpage = 'entry/index.tpl'; |
---|
345 | $this->tpl_title = '会員登録(1/3)'; |
---|
346 | } elseif ($_POST["mode"] == "set2") { |
---|
347 | $this->arrErr = $this->lfErrorCheck2($this->arrForm); |
---|
348 | $this->tpl_mainpage = 'entry/set1.tpl'; |
---|
349 | $this->tpl_title = '会員登録(2/3)'; |
---|
350 | } else { |
---|
351 | $this->arrErr = $this->lfErrorCheck3($this->arrForm); |
---|
352 | $this->tpl_mainpage = 'entry/set2.tpl'; |
---|
353 | $this->tpl_title = '会員登録(3/3)'; |
---|
354 | } |
---|
355 | |
---|
356 | foreach($this->arrForm as $key => $val) { |
---|
357 | $this->$key = $val; |
---|
358 | } |
---|
359 | |
---|
360 | if ($this->arrErr || !empty($_POST["return"])) { // 入力エラーのチェック |
---|
361 | |
---|
362 | //-- データの設定 |
---|
363 | if ($_POST["mode"] == "set1") { |
---|
364 | $checkVal = array("email", "password", "reminder", "reminder_answer", "name01", "name02", "kana01", "kana02"); |
---|
365 | } elseif ($_POST["mode"] == "set2") { |
---|
366 | $checkVal = array("sex", "year", "month", "day", "zip01", "zip02"); |
---|
367 | } else { |
---|
368 | $checkVal = array("pref", "addr01", "addr02", "tel01", "tel02", "tel03", "mailmaga_flg"); |
---|
369 | } |
---|
370 | |
---|
371 | foreach($this->arrForm as $key => $val) { |
---|
372 | if ($key != "mode" && $key != "submit" && $key != "return" && $key != session_name() && !in_array($key, $checkVal)) |
---|
373 | $this->list_data[ $key ] = $val; |
---|
374 | } |
---|
375 | |
---|
376 | |
---|
377 | |
---|
378 | } else { |
---|
379 | |
---|
380 | //-- テンプレート設定 |
---|
381 | if ($_POST["mode"] == "set1") { |
---|
382 | $this->tpl_mainpage = 'entry/set1.tpl'; |
---|
383 | $this->tpl_title = '会員登録(2/3)'; |
---|
384 | } elseif ($_POST["mode"] == "set2") { |
---|
385 | $this->tpl_mainpage = 'entry/set2.tpl'; |
---|
386 | $this->tpl_title = '会員登録(3/3)'; |
---|
387 | |
---|
388 | if (@$this->arrForm['pref'] == "" && @$this->arrForm['addr01'] == "" && @$this->arrForm['addr02'] == "") { |
---|
389 | $address = $this->lfGetAddress($_REQUEST['zip01'].$_REQUEST['zip02']); |
---|
390 | $this->pref = @$address[0]['state']; |
---|
391 | $this->addr01 = @$address[0]['city'] . @$address[0]['town']; |
---|
392 | } |
---|
393 | } elseif ($_POST["mode"] == "confirm") { |
---|
394 | //パスワード表示 |
---|
395 | $passlen = strlen($this->arrForm['password']); |
---|
396 | $this->passlen = $this->lfPassLen($passlen); |
---|
397 | |
---|
398 | //メール受け取り |
---|
399 | if (!isset($this->arrForm['mailmaga_flg'])) $this->arrForm['mailmaga_flg'] = ""; |
---|
400 | if (strtolower($this->arrForm['mailmaga_flg']) == "on") { |
---|
401 | $this->arrForm['mailmaga_flg'] = "2"; |
---|
402 | } else { |
---|
403 | $this->arrForm['mailmaga_flg'] = "3"; |
---|
404 | } |
---|
405 | |
---|
406 | $this->tpl_mainpage = 'entry/confirm.tpl'; |
---|
407 | $this->tpl_title = '会員登録(確認ページ)'; |
---|
408 | |
---|
409 | } |
---|
410 | |
---|
411 | //-- データ設定 |
---|
412 | unset($this->list_data); |
---|
413 | if ($_POST["mode"] == "set1") { |
---|
414 | $checkVal = array("sex", "year", "month", "day", "zip01", "zip02"); |
---|
415 | } elseif ($_POST["mode"] == "set2") { |
---|
416 | $checkVal = array("pref", "addr01", "addr02", "tel01", "tel02", "tel03", "mailmaga_flg"); |
---|
417 | } else { |
---|
418 | $checkVal = array(); |
---|
419 | } |
---|
420 | |
---|
421 | foreach($this->arrForm as $key => $val) { |
---|
422 | if ($key != "mode" && $key != "submit" && $key != "confirm" && $key != "return" && $key != session_name() && !in_array($key, $checkVal)) { |
---|
423 | $this->list_data[ $key ] = $val; |
---|
424 | } |
---|
425 | } |
---|
426 | |
---|
427 | |
---|
428 | //-- 仮登録と完了画面 |
---|
429 | if ($_POST["mode"] == "complete") { |
---|
430 | |
---|
431 | // 確認画面で再度エラーチェックを行う。(画面1) |
---|
432 | $arrErr = $this->lfErrorCheck1($this->arrForm); |
---|
433 | if(count($arrErr) > 0){ |
---|
434 | $this->tpl_mainpage = 'entry/index.tpl'; |
---|
435 | $this->tpl_title = '会員登録(1/3)'; |
---|
436 | $this->arrErr = $arrErr; |
---|
437 | //---- ページ表示 |
---|
438 | $objView->assignobj($this); |
---|
439 | $objView->display(SITE_FRAME); |
---|
440 | exit(); |
---|
441 | } |
---|
442 | |
---|
443 | // 確認画面で再度エラーチェックを行う。(画面2) |
---|
444 | $arrErr = $this->lfErrorCheck2($this->arrForm); |
---|
445 | if(count($arrErr) > 0){ |
---|
446 | $this->tpl_mainpage = 'entry/set1.tpl'; |
---|
447 | $this->tpl_title = '会員登録(2/3)'; |
---|
448 | $this->arrErr = $arrErr; |
---|
449 | //---- ページ表示 |
---|
450 | $objView->assignobj($this); |
---|
451 | $objView->display(SITE_FRAME); |
---|
452 | exit(); |
---|
453 | } |
---|
454 | |
---|
455 | // 確認画面で再度エラーチェックを行う。(画面3) |
---|
456 | $arrErr = $this->lfErrorCheck3($this->arrForm); |
---|
457 | if(count($arrErr) > 0){ |
---|
458 | $this->tpl_mainpage = 'entry/set2.tpl'; |
---|
459 | $this->tpl_title = '会員登録(3/3)'; |
---|
460 | $this->arrErr = $arrErr; |
---|
461 | //---- ページ表示 |
---|
462 | $objView->assignobj($this); |
---|
463 | $objView->display(SITE_FRAME); |
---|
464 | exit(); |
---|
465 | } |
---|
466 | |
---|
467 | $this->CONF = $CONF; |
---|
468 | $this->uniqid = $this->lfRegistData ($this->arrForm, $arrRegistColumn, $arrRejectRegistColumn, CUSTOMER_CONFIRM_MAIL, true, $this->arrForm["email"]); |
---|
469 | |
---|
470 | // 空メールを受信済みの場合はすぐに本登録完了にする。 |
---|
471 | if (isset($_SESSION['mobile']['kara_mail_from'])) { |
---|
472 | $param = array("mode" => "regist", |
---|
473 | "id" => $this->uniqid, |
---|
474 | session_name() => session_id()); |
---|
475 | $this->sendRedirect($this->getLocation(MOBILE_URL_DIR . "regist/index.php", $param)); |
---|
476 | exit; |
---|
477 | } |
---|
478 | |
---|
479 | $this->tpl_mainpage = 'entry/complete.tpl'; |
---|
480 | $this->tpl_title = '会員登録(完了ページ)'; |
---|
481 | |
---|
482 | $objMobile->sfMobileSetExtSessionId('id', $this->uniqid, 'regist/index.php'); |
---|
483 | |
---|
484 | // 仮登録完了メール送信 |
---|
485 | $this->to_name01 = $_POST['name01']; |
---|
486 | $this->to_name02 = $_POST['name02']; |
---|
487 | $objMailText = new SC_MobileView(); |
---|
488 | $objMailText->assignobj($this); |
---|
489 | $objHelperMail = new SC_Helper_Mail_Ex(); |
---|
490 | $objQuery = new SC_Query(); |
---|
491 | |
---|
492 | // 仮会員が有効の場合 |
---|
493 | if(CUSTOMER_CONFIRM_MAIL == true) { |
---|
494 | // Moba8パラメーターを保持する場合はカラム追加 |
---|
495 | if (isset($_SESSION['a8'])) $this->etc_value = "&a8=". $_SESSION['a8']; |
---|
496 | $subject = $objHelperMail->sfMakeSubject($objQuery, $objMailText, $this, '会員登録のご確認'); |
---|
497 | $toCustomerMail = $objMailText->fetch("mail_templates/customer_mail.tpl"); |
---|
498 | } else { |
---|
499 | $subject = $objHelperMail->sfMakesubject($objQuery, $objMailText, $this, '会員登録のご完了'); |
---|
500 | $toCustomerMail = $objMailText->fetch("mail_templates/customer_regist_mail.tpl"); |
---|
501 | // ログイン状態にする |
---|
502 | $objCustomer->setLogin($_POST["email"]); |
---|
503 | } |
---|
504 | |
---|
505 | $objMail = new SC_SendMail(); |
---|
506 | $objMail->setItem( |
---|
507 | '' // 宛先 |
---|
508 | , $subject // サブジェクト |
---|
509 | , $toCustomerMail // 本文 |
---|
510 | , $CONF["email03"] // 配送元アドレス |
---|
511 | , $CONF["shop_name"] // 配送元 名前 |
---|
512 | , $CONF["email03"] // reply_to |
---|
513 | , $CONF["email04"] // return_path |
---|
514 | , $CONF["email04"] // Errors_to |
---|
515 | , $CONF["email01"] // Bcc |
---|
516 | ); |
---|
517 | // 宛先の設定 |
---|
518 | $name = $_POST["name01"] . $_POST["name02"] ." 様"; |
---|
519 | $objMail->setTo($_POST["email"], $name); |
---|
520 | $objMail->sendMail(); |
---|
521 | |
---|
522 | // 完了ページに移動させる。 |
---|
523 | $this->sendRedirect($this->getLocation("./complete.php"), true); |
---|
524 | exit; |
---|
525 | } |
---|
526 | } |
---|
527 | } |
---|
528 | |
---|
529 | //---- ページ表示 |
---|
530 | $objView->assignobj($this); |
---|
531 | $objView->display(SITE_FRAME); |
---|
532 | } |
---|
533 | |
---|
534 | /** |
---|
535 | * デストラクタ. |
---|
536 | * |
---|
537 | * @return void |
---|
538 | */ |
---|
539 | function destroy() { |
---|
540 | parent::destroy(); |
---|
541 | } |
---|
542 | |
---|
543 | // }}} |
---|
544 | // {{{ protected functions |
---|
545 | |
---|
546 | // 会員情報の登録 |
---|
547 | function lfRegistData ($array, $arrRegistColumn, $arrRejectRegistColumn, $confirm_flg, $isMobile = false, $email_mobile = "") { |
---|
548 | $objConn = new SC_DbConn(); |
---|
549 | |
---|
550 | // 登録データの生成 |
---|
551 | foreach ($arrRegistColumn as $data) { |
---|
552 | if (strlen($array[ $data["column"] ]) > 0 && ! in_array($data["column"], $arrRejectRegistColumn)) { |
---|
553 | $arrRegist[ $data["column"] ] = $array[ $data["column"] ]; |
---|
554 | } |
---|
555 | } |
---|
556 | |
---|
557 | // 誕生日が入力されている場合 |
---|
558 | if (strlen($array["year"]) > 0 ) { |
---|
559 | $arrRegist["birth"] = $array["year"] ."/". $array["month"] ."/". $array["day"] ." 00:00:00"; |
---|
560 | } |
---|
561 | |
---|
562 | // パスワードの暗号化 |
---|
563 | $arrRegist["password"] = sha1($arrRegist["password"] . ":" . AUTH_MAGIC); |
---|
564 | |
---|
565 | // 仮会員登録の場合 |
---|
566 | if($confirm_flg == true) { |
---|
567 | // 重複しない会員登録キーを発行する。 |
---|
568 | $count = 1; |
---|
569 | while ($count != 0) { |
---|
570 | $uniqid = SC_Utils_Ex::sfGetUniqRandomId("t"); |
---|
571 | $count = $objConn->getOne("SELECT COUNT(*) FROM dtb_customer WHERE secret_key = ?", array($uniqid)); |
---|
572 | } |
---|
573 | switch($array["mailmaga_flg"]) { |
---|
574 | case 1: |
---|
575 | $arrRegist["mailmaga_flg"] = 4; |
---|
576 | break; |
---|
577 | case 2: |
---|
578 | $arrRegist["mailmaga_flg"] = 5; |
---|
579 | break; |
---|
580 | default: |
---|
581 | $arrRegist["mailmaga_flg"] = 6; |
---|
582 | break; |
---|
583 | } |
---|
584 | |
---|
585 | $arrRegist["status"] = "1"; // 仮会員 |
---|
586 | } else { |
---|
587 | // 重複しない会員登録キーを発行する。 |
---|
588 | $count = 1; |
---|
589 | while ($count != 0) { |
---|
590 | $uniqid = SC_Utils_Ex::sfGetUniqRandomId("r"); |
---|
591 | $count = $objConn->getOne("SELECT COUNT(*) FROM dtb_customer WHERE secret_key = ?", array($uniqid)); |
---|
592 | } |
---|
593 | $arrRegist["status"] = "2"; // 本会員 |
---|
594 | } |
---|
595 | |
---|
596 | /* |
---|
597 | secret_keyは、テーブルで重複許可されていない場合があるので、 |
---|
598 | 本会員登録では利用されないがセットしておく。 |
---|
599 | */ |
---|
600 | $arrRegist["secret_key"] = $uniqid; // 会員登録キー |
---|
601 | $arrRegist["create_date"] = "now()"; // 作成日 |
---|
602 | $arrRegist["update_date"] = "now()"; // 更新日 |
---|
603 | $arrRegist["first_buy_date"] = ""; // 最初の購入日 |
---|
604 | $arrRegist["point"] = $this->CONF["welcome_point"]; // 入会時ポイント |
---|
605 | |
---|
606 | if ($isMobile) { |
---|
607 | // 携帯メールアドレス |
---|
608 | $arrRegist['email_mobile'] = $arrRegist['email']; |
---|
609 | //PHONE_IDを取り出す |
---|
610 | $phoneId = SC_MobileUserAgent::getId(); |
---|
611 | $arrRegist['mobile_phone_id'] = $phoneId; |
---|
612 | } |
---|
613 | |
---|
614 | //-- 仮登録実行 |
---|
615 | $objConn->query("BEGIN"); |
---|
616 | |
---|
617 | $objQuery = new SC_Query(); |
---|
618 | $objQuery->insert("dtb_customer", $arrRegist); |
---|
619 | |
---|
620 | |
---|
621 | /* メルマガ会員機能は現在停止中 2007/03/07 |
---|
622 | |
---|
623 | |
---|
624 | //-- 非会員でメルマガ登録しているかの判定 |
---|
625 | $sql = "SELECT count(*) FROM dtb_customer_mail WHERE email = ?"; |
---|
626 | $mailResult = $objConn->getOne($sql, array($arrRegist["email"])); |
---|
627 | |
---|
628 | //-- メルマガ仮登録実行 |
---|
629 | $arrRegistMail["email"] = $arrRegist["email"]; |
---|
630 | if ($array["mailmaga_flg"] == 1) { |
---|
631 | $arrRegistMail["mailmaga_flg"] = 4; |
---|
632 | } elseif ($array["mailmaga_flg"] == 2) { |
---|
633 | $arrRegistMail["mailmaga_flg"] = 5; |
---|
634 | } else { |
---|
635 | $arrRegistMail["mailmaga_flg"] = 6; |
---|
636 | } |
---|
637 | $arrRegistMail["update_date"] = "now()"; |
---|
638 | |
---|
639 | // 非会員でメルマガ登録している場合 |
---|
640 | if ($mailResult == 1) { |
---|
641 | $objQuery->update("dtb_customer_mail", $arrRegistMail, "email = '" .addslashes($arrRegistMail["email"]). "'"); |
---|
642 | } else { // 新規登録の場合 |
---|
643 | $arrRegistMail["create_date"] = "now()"; |
---|
644 | $objQuery->insert("dtb_customer_mail", $arrRegistMail); |
---|
645 | } |
---|
646 | */ |
---|
647 | $objConn->query("COMMIT"); |
---|
648 | |
---|
649 | return $uniqid; |
---|
650 | } |
---|
651 | |
---|
652 | //---- 取得文字列の変換 |
---|
653 | function lfConvertParam($array, $arrRegistColumn) { |
---|
654 | /* |
---|
655 | * 文字列の変換 |
---|
656 | * K : 「半角(ハンカク)片仮名」を「全角片仮名」に変換 |
---|
657 | * C : 「全角ひら仮名」を「全角かた仮名」に変換 |
---|
658 | * V : 濁点付きの文字を一文字に変換。"K","H"と共に使用します |
---|
659 | * n : 「全角」数字を「半角(ハンカク)」に変換 |
---|
660 | * a : 全角英数字を半角英数字に変換する |
---|
661 | */ |
---|
662 | // カラム名とコンバート情報 |
---|
663 | foreach ($arrRegistColumn as $data) { |
---|
664 | $arrConvList[ $data["column"] ] = $data["convert"]; |
---|
665 | } |
---|
666 | // 文字変換 |
---|
667 | foreach ($arrConvList as $key => $val) { |
---|
668 | // POSTされてきた値のみ変換する。 |
---|
669 | if(isset($array[$key]) && strlen($array[$key]) > 0) { |
---|
670 | $array[$key] = mb_convert_kana($array[$key] ,$val); |
---|
671 | } |
---|
672 | } |
---|
673 | return $array; |
---|
674 | } |
---|
675 | |
---|
676 | //---- 入力エラーチェック |
---|
677 | function lfErrorCheck($array) { |
---|
678 | |
---|
679 | $objErr = new SC_CheckError($array); |
---|
680 | |
---|
681 | $objErr->doFunc(array("お名前(姓)", 'name01', STEXT_LEN), array("EXIST_CHECK", "NO_SPTAB", "SPTAB_CHECK" ,"MAX_LENGTH_CHECK")); |
---|
682 | $objErr->doFunc(array("お名前(名)", 'name02', STEXT_LEN), array("EXIST_CHECK", "NO_SPTAB", "SPTAB_CHECK" , "MAX_LENGTH_CHECK")); |
---|
683 | $objErr->doFunc(array("フリガナ(セイ)", 'kana01', STEXT_LEN), array("EXIST_CHECK", "NO_SPTAB", "SPTAB_CHECK" ,"MAX_LENGTH_CHECK", "KANA_CHECK")); |
---|
684 | $objErr->doFunc(array("フリガナ(メイ)", 'kana02', STEXT_LEN), array("EXIST_CHECK", "NO_SPTAB", "SPTAB_CHECK" ,"MAX_LENGTH_CHECK", "KANA_CHECK")); |
---|
685 | $objErr->doFunc(array("郵便番号1", "zip01", ZIP01_LEN ) ,array("EXIST_CHECK", "SPTAB_CHECK" ,"NUM_CHECK", "NUM_COUNT_CHECK")); |
---|
686 | $objErr->doFunc(array("郵便番号2", "zip02", ZIP02_LEN ) ,array("EXIST_CHECK", "SPTAB_CHECK" ,"NUM_CHECK", "NUM_COUNT_CHECK")); |
---|
687 | $objErr->doFunc(array("郵便番号", "zip01", "zip02"), array("ALL_EXIST_CHECK")); |
---|
688 | $objErr->doFunc(array("都道府県", 'pref'), array("SELECT_CHECK","NUM_CHECK")); |
---|
689 | $objErr->doFunc(array("ご住所1", "addr01", MTEXT_LEN), array("EXIST_CHECK","SPTAB_CHECK" ,"MAX_LENGTH_CHECK")); |
---|
690 | $objErr->doFunc(array("ご住所2", "addr02", MTEXT_LEN), array("EXIST_CHECK","SPTAB_CHECK" ,"MAX_LENGTH_CHECK")); |
---|
691 | $objErr->doFunc(array('メールアドレス', "email", MTEXT_LEN) ,array("NO_SPTAB", "EXIST_CHECK", "EMAIL_CHECK", "SPTAB_CHECK" ,"EMAIL_CHAR_CHECK", "MAX_LENGTH_CHECK")); |
---|
692 | $objErr->doFunc(array('メールアドレス(確認)', "email02", MTEXT_LEN) ,array("NO_SPTAB", "EXIST_CHECK", "EMAIL_CHECK","SPTAB_CHECK" , "EMAIL_CHAR_CHECK", "MAX_LENGTH_CHECK")); |
---|
693 | $objErr->doFunc(array('メールアドレス', 'メールアドレス(確認)', "email", "email02") ,array("EQUAL_CHECK")); |
---|
694 | |
---|
695 | //現会員の判定 → 現会員もしくは仮登録中は、メアド一意が前提になってるので同じメアドで登録不可 |
---|
696 | if (strlen($array["email"]) > 0) { |
---|
697 | $array["email"] = strtolower($array["email"]); |
---|
698 | $objQuery = new SC_Query(); |
---|
699 | $arrRet = $objQuery->select("email, update_date, del_flg", "dtb_customer","email = ? ORDER BY del_flg", array($array["email"])); |
---|
700 | |
---|
701 | if(count($arrRet) > 0) { |
---|
702 | if($arrRet[0]['del_flg'] != '1') { |
---|
703 | // 会員である場合 |
---|
704 | if (!isset($objErr->arrErr['email'])) $objErr->arrErr['email'] = ""; |
---|
705 | $objErr->arrErr["email"] .= "※ すでに会員登録で使用されているメールアドレスです。<br />"; |
---|
706 | } else { |
---|
707 | // 退会した会員である場合 |
---|
708 | $leave_time = SC_Utils_Ex::sfDBDatetoTime($arrRet[0]['update_date']); |
---|
709 | $now_time = time(); |
---|
710 | $pass_time = $now_time - $leave_time; |
---|
711 | // 退会から何時間-経過しているか判定する。 |
---|
712 | $limit_time = ENTRY_LIMIT_HOUR * 3600; |
---|
713 | if($pass_time < $limit_time) { |
---|
714 | if (!isset($objErr->arrErr['email'])) $objErr->arrErr['email'] = ""; |
---|
715 | $objErr->arrErr["email"] .= "※ 退会から一定期間の間は、同じメールアドレスを使用することはできません。<br />"; |
---|
716 | } |
---|
717 | } |
---|
718 | } |
---|
719 | } |
---|
720 | |
---|
721 | $objErr->doFunc(array("お電話番号1", 'tel01'), array("EXIST_CHECK","SPTAB_CHECK" )); |
---|
722 | $objErr->doFunc(array("お電話番号2", 'tel02'), array("EXIST_CHECK","SPTAB_CHECK" )); |
---|
723 | $objErr->doFunc(array("お電話番号3", 'tel03'), array("EXIST_CHECK","SPTAB_CHECK" )); |
---|
724 | $objErr->doFunc(array("お電話番号", "tel01", "tel02", "tel03",TEL_ITEM_LEN) ,array("TEL_CHECK")); |
---|
725 | $objErr->doFunc(array("FAX番号1", 'fax01'), array("SPTAB_CHECK")); |
---|
726 | $objErr->doFunc(array("FAX番号2", 'fax02'), array("SPTAB_CHECK")); |
---|
727 | $objErr->doFunc(array("FAX番号3", 'fax03'), array("SPTAB_CHECK")); |
---|
728 | $objErr->doFunc(array("FAX番号", "fax01", "fax02", "fax03", TEL_ITEM_LEN) ,array("TEL_CHECK")); |
---|
729 | $objErr->doFunc(array("ご性別", "sex") ,array("SELECT_CHECK", "NUM_CHECK")); |
---|
730 | $objErr->doFunc(array("パスワード", 'password', PASSWORD_LEN1, PASSWORD_LEN2), array("EXIST_CHECK", "SPTAB_CHECK" ,"ALNUM_CHECK", "NUM_RANGE_CHECK")); |
---|
731 | $objErr->doFunc(array("パスワード(確認)", 'password02', PASSWORD_LEN1, PASSWORD_LEN2), array("EXIST_CHECK", "SPTAB_CHECK" ,"ALNUM_CHECK", "NUM_RANGE_CHECK")); |
---|
732 | $objErr->doFunc(array('パスワード', 'パスワード(確認)', "password", "password02") ,array("EQUAL_CHECK")); |
---|
733 | $objErr->doFunc(array("パスワードを忘れたときのヒント 質問", "reminder") ,array("SELECT_CHECK", "NUM_CHECK")); |
---|
734 | $objErr->doFunc(array("パスワードを忘れたときのヒント 答え", "reminder_answer", STEXT_LEN) ,array("EXIST_CHECK","SPTAB_CHECK" , "MAX_LENGTH_CHECK")); |
---|
735 | $objErr->doFunc(array("メールマガジン", "mailmaga_flg") ,array("SELECT_CHECK", "NUM_CHECK")); |
---|
736 | |
---|
737 | $objErr->doFunc(array("生年月日", "year", "month", "day"), array("CHECK_DATE")); |
---|
738 | $objErr->doFunc(array("メールマガジン", 'mailmaga_flg'), array("SELECT_CHECK")); |
---|
739 | return $objErr->arrErr; |
---|
740 | } |
---|
741 | |
---|
742 | //確認ページ用パスワード表示用 |
---|
743 | |
---|
744 | function lfPassLen($passlen){ |
---|
745 | $ret = ""; |
---|
746 | for ($i=0;$i<$passlen;true){ |
---|
747 | $ret.="*"; |
---|
748 | $i++; |
---|
749 | } |
---|
750 | return $ret; |
---|
751 | } |
---|
752 | |
---|
753 | // }}} |
---|
754 | // {{{ mobile functions |
---|
755 | |
---|
756 | // 郵便番号から住所の取得 |
---|
757 | function lfGetAddress($zipcode) { |
---|
758 | |
---|
759 | $conn = new SC_DBconn(ZIP_DSN); |
---|
760 | |
---|
761 | // 郵便番号検索文作成 |
---|
762 | $zipcode = mb_convert_kana($zipcode ,"n"); |
---|
763 | $sqlse = "SELECT state, city, town FROM mtb_zip WHERE zipcode = ?"; |
---|
764 | |
---|
765 | $data_list = $conn->getAll($sqlse, array($zipcode)); |
---|
766 | |
---|
767 | // インデックスと値を反転させる。 |
---|
768 | $arrREV_PREF = array_flip($this->arrPref); |
---|
769 | |
---|
770 | /* |
---|
771 | 総務省からダウンロードしたデータをそのままインポートすると |
---|
772 | 以下のような文字列が入っているので 対策する。 |
---|
773 | ・(1・19丁目) |
---|
774 | ・以下に掲載がない場合 |
---|
775 | */ |
---|
776 | $town = $data_list[0]['town']; |
---|
777 | $town = ereg_replace("(.*)$","",$town); |
---|
778 | $town = ereg_replace("以下に掲載がない場合","",$town); |
---|
779 | $data_list[0]['town'] = $town; |
---|
780 | $data_list[0]['state'] = $arrREV_PREF[$data_list[0]['state']]; |
---|
781 | |
---|
782 | return $data_list; |
---|
783 | } |
---|
784 | |
---|
785 | //---- 入力エラーチェック |
---|
786 | function lfErrorCheck1($array) { |
---|
787 | |
---|
788 | $objErr = new SC_CheckError($array); |
---|
789 | $objDb = new SC_Helper_DB_Ex(); |
---|
790 | |
---|
791 | $objErr->doFunc(array("お名前(姓)", 'name01', STEXT_LEN), array("EXIST_CHECK", "NO_SPTAB", "SPTAB_CHECK" ,"MAX_LENGTH_CHECK")); |
---|
792 | $objErr->doFunc(array("お名前(名)", 'name02', STEXT_LEN), array("EXIST_CHECK", "NO_SPTAB", "SPTAB_CHECK" , "MAX_LENGTH_CHECK")); |
---|
793 | $objErr->doFunc(array("お名前(カナ/姓)", 'kana01', STEXT_LEN), array("EXIST_CHECK", "NO_SPTAB", "SPTAB_CHECK" ,"MAX_LENGTH_CHECK", "KANA_CHECK")); |
---|
794 | $objErr->doFunc(array("お名前(カナ/名)", 'kana02', STEXT_LEN), array("EXIST_CHECK", "NO_SPTAB", "SPTAB_CHECK" ,"MAX_LENGTH_CHECK", "KANA_CHECK")); |
---|
795 | $objErr->doFunc(array('メールアドレス', "email", MTEXT_LEN) ,array("NO_SPTAB", "EXIST_CHECK", "EMAIL_CHECK", "SPTAB_CHECK" ,"EMAIL_CHAR_CHECK", "MAX_LENGTH_CHECK", "MOBILE_EMAIL_CHECK")); |
---|
796 | |
---|
797 | //現会員の判定 → 現会員もしくは仮登録中は、メアド一意が前提になってるので同じメアドで登録不可 |
---|
798 | if (strlen($array["email"]) > 0) { |
---|
799 | $array['email'] = strtolower($array['email']); |
---|
800 | $objQuery = new SC_Query(); |
---|
801 | $arrRet = $objQuery->select("email, update_date, del_flg", "dtb_customer","email = ? OR email_mobile = ? ORDER BY del_flg", array($array["email"], $array["email"])); |
---|
802 | |
---|
803 | if(count($arrRet) > 0) { |
---|
804 | if($arrRet[0]['del_flg'] != '1') { |
---|
805 | // 会員である場合 |
---|
806 | $objErr->arrErr["email"] .= "※ すでに会員登録で使用されているメールアドレスです。<br />"; |
---|
807 | } else { |
---|
808 | // 退会した会員である場合 |
---|
809 | $leave_time = SC_Utils_Ex::sfDBDatetoTime($arrRet[0]['update_date']); |
---|
810 | $now_time = time(); |
---|
811 | $pass_time = $now_time - $leave_time; |
---|
812 | // 退会から何時間-経過しているか判定する。 |
---|
813 | $limit_time = ENTRY_LIMIT_HOUR * 3600; |
---|
814 | if($pass_time < $limit_time) { |
---|
815 | $objErr->arrErr["email"] .= "※ 退会から一定期間の間は、同じメールアドレスを使用することはできません。<br />"; |
---|
816 | } |
---|
817 | } |
---|
818 | } |
---|
819 | } |
---|
820 | |
---|
821 | $objErr->doFunc(array("パスワード", 'password', PASSWORD_LEN1, PASSWORD_LEN2), array("EXIST_CHECK", "SPTAB_CHECK" ,"ALNUM_CHECK", "NUM_RANGE_CHECK")); |
---|
822 | $objErr->doFunc(array("パスワード確認用の質問", "reminder") ,array("SELECT_CHECK", "NUM_CHECK")); |
---|
823 | $objErr->doFunc(array("パスワード確認用の質問の答え", "reminder_answer", STEXT_LEN) ,array("EXIST_CHECK","SPTAB_CHECK" , "MAX_LENGTH_CHECK")); |
---|
824 | |
---|
825 | return $objErr->arrErr; |
---|
826 | } |
---|
827 | |
---|
828 | //---- 入力エラーチェック |
---|
829 | function lfErrorCheck2($array) { |
---|
830 | $objErr = new SC_CheckError($array); |
---|
831 | print_r($array); |
---|
832 | $objErr->doFunc(array("郵便番号1", "zip01", ZIP01_LEN ) ,array("EXIST_CHECK", "SPTAB_CHECK" ,"NUM_CHECK", "NUM_COUNT_CHECK")); |
---|
833 | $objErr->doFunc(array("郵便番号2", "zip02", ZIP02_LEN ) ,array("EXIST_CHECK", "SPTAB_CHECK" ,"NUM_CHECK", "NUM_COUNT_CHECK")); |
---|
834 | $objErr->doFunc(array("郵便番号", "zip01", "zip02"), array("ALL_EXIST_CHECK")); |
---|
835 | |
---|
836 | $objErr->doFunc(array("性別", "sex") ,array("SELECT_CHECK", "NUM_CHECK")); |
---|
837 | $objErr->doFunc(array("生年月日", "year", "month", "day"), array("CHECK_DATE")); |
---|
838 | if (isset($array['year'])) { |
---|
839 | $objErr->doFunc(array("生年月日 (年)", "year", $this->objDate->getStartYear()), array("MIN_CHECK")); |
---|
840 | $objErr->doFunc(array("生年月日 (年)", "year", $this->objDate->getEndYear()), array("MAX_CHECK")); |
---|
841 | } |
---|
842 | return $objErr->arrErr; |
---|
843 | } |
---|
844 | |
---|
845 | //---- 入力エラーチェック |
---|
846 | function lfErrorCheck3($array) { |
---|
847 | $objErr = new SC_CheckError($array); |
---|
848 | |
---|
849 | $objErr->doFunc(array("都道府県", 'pref'), array("SELECT_CHECK","NUM_CHECK")); |
---|
850 | $objErr->doFunc(array("市区町村", "addr01", MTEXT_LEN), array("EXIST_CHECK","SPTAB_CHECK" ,"MAX_LENGTH_CHECK")); |
---|
851 | $objErr->doFunc(array("番地", "addr02", MTEXT_LEN), array("EXIST_CHECK","SPTAB_CHECK" ,"MAX_LENGTH_CHECK")); |
---|
852 | $objErr->doFunc(array("電話番号1", 'tel01'), array("EXIST_CHECK","SPTAB_CHECK" )); |
---|
853 | $objErr->doFunc(array("電話番号2", 'tel02'), array("EXIST_CHECK","SPTAB_CHECK" )); |
---|
854 | $objErr->doFunc(array("電話番号3", 'tel03'), array("EXIST_CHECK","SPTAB_CHECK" )); |
---|
855 | $objErr->doFunc(array("電話番号", "tel01", "tel02", "tel03",TEL_ITEM_LEN) ,array("TEL_CHECK")); |
---|
856 | |
---|
857 | return $objErr->arrErr; |
---|
858 | } |
---|
859 | |
---|
860 | } |
---|
861 | ?> |
---|