source: branches/version-2_4/data/class/pages/shopping/LC_Page_Shopping_Deliv.php @ 18368

Revision 18368, 26.3 KB checked in by kajiwara, 14 years ago (diff)

#492 注文者情報の更新漏れ対応

  • Property svn:eol-style set to LF
  • Property svn:keywords set to Id Revision Date
  • Property svn:mime-type set to text/x-httpd-php; charset=UTF-8
Line 
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
25require_once(CLASS_PATH . "pages/LC_Page.php");
26
27/**
28 * お届け先指定 のページクラス.
29 *
30 * @package Page
31 * @author LOCKON CO.,LTD.
32 * @version $Id:LC_Page_Shopping_Deliv.php 15532 2007-08-31 14:39:46Z nanasess $
33 */
34class LC_Page_Shopping_Deliv extends LC_Page {
35
36    // {{{ properties
37
38    /** フォームパラメータの配列 */
39    var $objFormParam;
40
41    /** ログインフォームパラメータ配列 */
42    var $objLoginFormParam;
43
44    // }}}
45    // {{{ functions
46
47    /**
48     * Page を初期化する.
49     *
50     * @return void
51     */
52    function init() {
53        parent::init();
54        $this->tpl_mainpage = 'shopping/deliv.tpl';
55        $this->tpl_column_num = 1;
56        $this->tpl_css = URL_DIR.'css/layout/shopping/index.css';
57        $masterData = new SC_DB_MasterData();
58        $this->arrPref = $masterData->getMasterData("mtb_pref", array("pref_id", "pref_name", "rank"));
59        $this->tpl_title = "お届け先指定";
60
61        $this->allowClientCache();
62    }
63
64    /**
65     * Page のプロセス.
66     *
67     * @return void
68     */
69    function process() {
70        global $objCampaignSess;
71
72        $objView = new SC_SiteView();
73        $objSiteSess = new SC_SiteSession();
74        $objCartSess = new SC_CartSession();
75        $objCampaignSess = new SC_CampaignSession();
76        $objCustomer = new SC_Customer();
77        // クッキー管理クラス
78        $objCookie = new SC_Cookie(COOKIE_EXPIRE);
79        // パラメータ管理クラス
80        $this->objFormParam = new SC_FormParam();
81        // パラメータ情報の初期化
82        $this->lfInitParam();
83        // POST値の取得
84        $this->objFormParam->setParam($_POST);
85
86        $this->objLoginFormParam = new SC_FormParam();  // ログインフォーム用
87        $this->lfInitLoginFormParam();
88        //パスワード・Eメールにある空白をトリム
89        $this->lfConvertEmail($_POST["login_email"]);
90        $this->lfConvertLoginPass($_POST["login_pass"]);
91        $this->objLoginFormParam->setParam($_POST);     // POST値の取得
92
93        // ユーザユニークIDの取得と購入状態の正当性をチェック
94        $uniqid = SC_Utils_Ex::sfCheckNormalAccess($objSiteSess, $objCartSess);
95        $this->tpl_uniqid = $uniqid;
96
97        if (!isset($_POST['mode'])) $_POST['mode'] = "";
98
99        // ログインチェック
100        if($_POST['mode'] != 'login' && !$objCustomer->isLoginSuccess()) {
101            // 不正アクセスとみなす
102            SC_Utils_Ex::sfDispSiteError(CUSTOMER_ERROR);
103        }
104
105        switch($_POST['mode']) {
106        case 'login':
107            $this->objLoginFormParam->toLower('login_email');
108            $this->arrErr = $this->objLoginFormParam->checkError();
109            $arrForm =  $this->objLoginFormParam->getHashArray();
110            // クッキー保存判定
111            if($arrForm['login_memory'] == "1" && $arrForm['login_email'] != "") {
112                $objCookie->setCookie('login_email', $_POST['login_email']);
113            } else {
114                $objCookie->setCookie('login_email', '');
115            }
116
117            if(count($this->arrErr) == 0) {
118                // ログイン判定
119                if(!$objCustomer->getCustomerDataFromEmailPass($arrForm['login_pass'], $arrForm['login_email'])) {
120                    // 仮登録の判定
121                    $objQuery = new SC_Query;
122                    $where = "email = ? AND status = 1 AND del_flg = 0";
123                    $ret = $objQuery->count("dtb_customer", $where, array($arrForm['login_email']));
124
125                    if($ret > 0) {
126                        SC_Utils_Ex::sfDispSiteError(TEMP_LOGIN_ERROR);
127                    } else {
128                        SC_Utils_Ex::sfDispSiteError(SITE_LOGIN_ERROR);
129                    }
130                }
131            } else {
132                // ログインページに戻る
133                $this->sendRedirect(URL_SHOP_TOP);
134                exit;
135            }
136            break;
137        // 削除
138        case 'delete':
139            if (SC_Utils_Ex::sfIsInt($_POST['other_deliv_id'])) {
140                $objQuery = new SC_Query();
141                $where = "other_deliv_id = ?";
142                $arrRet = $objQuery->delete("dtb_other_deliv", $where, array($_POST['other_deliv_id']));
143                $this->objFormParam->setValue('select_addr_id', '');
144            }
145            break;
146        // 会員登録住所に送る
147        case 'customer_addr':
148            // 会員登録住所がチェックされている場合
149            if ($_POST['deliv_check'] == '-1') {
150                // 会員情報の住所を受注一時テーブルに書き込む
151                $this->lfRegistDelivData($uniqid, $objCustomer);
152                // 正常に登録されたことを記録しておく
153                $objSiteSess->setRegistFlag();
154                // お支払い方法選択ページへ移動
155                $this->sendRedirect($this->getLocation(URL_SHOP_PAYMENT, array(), true));
156                exit;
157            // 別のお届け先がチェックされている場合
158            } elseif($_POST['deliv_check'] >= 1) {
159                if (SC_Utils_Ex::sfIsInt($_POST['deliv_check'])) {
160                    $objQuery = new SC_Query();
161                    $deliv_count = $objQuery->count("dtb_other_deliv","customer_id=? and other_deliv_id = ?" ,array($objCustomer->getValue('customer_id'), $_POST['deliv_check']));
162                    if ($deliv_count != 1) {
163                        SC_Utils_Ex::sfDispSiteError(CUSTOMER_ERROR);
164                    }
165
166                    // 登録済みの別のお届け先を受注一時テーブルに書き込む
167                    $this->lfRegistOtherDelivData($uniqid, $objCustomer, $_POST['deliv_check']);
168                    // 正常に登録されたことを記録しておく
169                    $objSiteSess->setRegistFlag();
170                    // お支払い方法選択ページへ移動
171                    $this->sendRedirect($this->getLocation(URL_SHOP_PAYMENT, array(), true));
172                    exit;
173                }
174            }else{
175                // エラーを返す
176                $arrErr['deli'] = '※ お届け先を選択してください。';
177            }
178            break;
179        // 前のページに戻る
180        case 'return':
181            // 確認ページへ移動
182            $this->sendRedirect($this->getLocation(URL_CART_TOP, array(), true));
183            exit;
184            break;
185        default:
186            $objQuery = new SC_Query();
187            $where = "order_temp_id = ?";
188            $arrRet = $objQuery->select("*", "dtb_order_temp", $where, array($uniqid));
189            if (empty($arrRet)) $arrRet = array("");
190            $this->objFormParam->setParam($arrRet[0]);
191            break;
192        }
193
194        /** 表示処理 **/
195
196        // 会員登録住所の取得
197        $col = "name01, name02, pref, addr01, addr02";
198        $where = "customer_id = ?";
199        $objQuery = new SC_Query();
200        $arrCustomerAddr = $objQuery->select($col, "dtb_customer", $where, array($_SESSION['customer']['customer_id']));
201        // 別のお届け先住所の取得
202        $col = "other_deliv_id, name01, name02, pref, addr01, addr02";
203        $objQuery->setorder("other_deliv_id DESC");
204        $objOtherAddr = $objQuery->select($col, "dtb_other_deliv", $where, array($_SESSION['customer']['customer_id']));
205        $this->arrAddr = $arrCustomerAddr;
206        $this->tpl_addrmax = count($objOtherAddr);
207        $cnt = 1;
208        foreach($objOtherAddr as $val) {
209            $this->arrAddr[$cnt] = $val;
210            $cnt++;
211        }
212
213        // 入力値の取得
214        if (!isset($arrErr)) $arrErr = array();
215        $this->arrForm = $this->objFormParam->getFormParamList();
216        $this->arrErr = $arrErr;
217
218        $objView->assignobj($this);
219        // フレームを選択(キャンペーンページから遷移なら変更)
220        $objCampaignSess->pageView($objView);
221    }
222
223    /**
224     * モバイルページを初期化する.
225     *
226     * @return void
227     */
228    function mobileInit() {
229        $this->init();
230    }
231
232    /**
233     * Page のプロセス(モバイル).
234     *
235     * @return void
236     */
237    function mobileProcess() {
238        $objView = new SC_MobileView();
239        $objSiteSess = new SC_SiteSession();
240        $objCartSess = new SC_CartSession();
241        $objCustomer = new SC_Customer();
242        // クッキー管理クラス
243        $objCookie = new SC_Cookie(COOKIE_EXPIRE);
244        // パラメータ管理クラス
245        $this->objFormParam = new SC_FormParam();
246        // パラメータ情報の初期化
247        $this->lfInitParam();
248        // POST値の取得
249        $this->lfConvertEmail($_POST["login_email"]);
250        $this->lfConvertLoginPass($_POST["login_pass"]);
251
252        $this->objFormParam->setParam($_POST);
253
254        $this->objLoginFormParam = new SC_FormParam();  // ログインフォーム用
255        $this->lfInitLoginFormParam();                      // 初期設定
256        $this->objLoginFormParam->setParam($_POST);     // POST値の取得
257
258        // ユーザユニークIDの取得と購入状態の正当性をチェック
259        $uniqid = SC_Utils_Ex::sfCheckNormalAccess($objSiteSess, $objCartSess);
260        $this->tpl_uniqid = $uniqid;
261
262        if (!isset($_POST['mode'])) $_POST['mode'] = "";
263
264        // ログインチェック
265        if($_POST['mode'] != 'login' && !$objCustomer->isLoginSuccess(true)) {
266            // 不正アクセスとみなす
267            SC_Utils_Ex::sfDispSiteError(CUSTOMER_ERROR, "", false, "", true);
268        }
269
270        switch($_POST['mode']) {
271        case 'login':
272            $this->objLoginFormParam->toLower('login_email');
273            $this->arrErr = $this->objLoginFormParam->checkError();
274            $arrForm =  $this->objLoginFormParam->getHashArray();
275            // クッキー保存判定
276            if($arrForm['login_memory'] == "1" && $arrForm['login_email'] != "") {
277                $objCookie->setCookie('login_email', $_POST['login_email']);
278            } else {
279                $objCookie->setCookie('login_email', '');
280            }
281
282            if(count($this->arrErr) == 0) {
283                // ログイン判定
284                if(!$objCustomer->getCustomerDataFromMobilePhoneIdPass($arrForm['login_pass']) &&
285                   !$objCustomer->getCustomerDataFromEmailPass($arrForm['login_pass'], $arrForm['login_email'], true)) {
286                    // 仮登録の判定
287                    $objQuery = new SC_Query;
288                    $where = "(email = ? OR email_mobile = ?) AND status = 1 AND del_flg = 0";
289                    $ret = $objQuery->count("dtb_customer", $where, array($arrForm['login_email'], $arrForm['login_email']));
290
291                    if($ret > 0) {
292                        SC_Utils_Ex::sfDispSiteError(TEMP_LOGIN_ERROR, "", false, "", true);
293                    } else {
294                        SC_Utils_Ex::sfDispSiteError(SITE_LOGIN_ERROR, "", false, "", true);
295                    }
296                }
297            } else {
298                // ログインページに戻る
299                $this->sendRedirect($this->getLocation(MOBILE_URL_SHOP_TOP), true);
300                exit;
301            }
302
303            // ログインが成功した場合は携帯端末IDを保存する。
304            $objCustomer->updateMobilePhoneId();
305
306            /*
307             * 携帯メールアドレスが登録されていない場合は,
308             * 携帯メールアドレス登録画面へ遷移
309             */
310            $objMobile = new SC_Helper_Mobile_Ex();
311            if (!$objMobile->gfIsMobileMailAddress($objCustomer->getValue('email'))) {
312                if (!$objCustomer->hasValue('email_mobile')) {
313                    $this->sendRedirect($this->getLocation("../entry/email_mobile.php"), true);
314                    exit;
315                }
316            }
317            break;
318            // 削除
319        case 'delete':
320            if (SC_Utils_Ex::sfIsInt($_POST['other_deliv_id'])) {
321                $objQuery = new SC_Query();
322                $where = "other_deliv_id = ?";
323                $arrRet = $objQuery->delete("dtb_other_deliv", $where, array($_POST['other_deliv_id']));
324                $this->objFormParam->setValue('select_addr_id', '');
325            }
326            break;
327            // 会員登録住所に送る
328        case 'customer_addr':
329            // お届け先がチェックされている場合には更新処理を行う
330            if ($_POST['deli'] != "") {
331                // 会員情報の住所を受注一時テーブルに書き込む
332                $this->lfRegistDelivData($uniqid, $objCustomer);
333                // 正常に登録されたことを記録しておく
334                $objSiteSess->setRegistFlag();
335                // お支払い方法選択ページへ移動
336                $this->sendRedirect($this->getLocation(MOBILE_URL_SHOP_PAYMENT), true);
337                exit;
338            }else{
339                // エラーを返す
340                $arrErr['deli'] = '※ お届け先を選択してください。';
341            }
342            break;
343
344            // 登録済みの別のお届け先に送る
345        case 'other_addr':
346            // お届け先がチェックされている場合には更新処理を行う
347            if ($_POST['deli'] != "") {
348                if (SC_Utils_Ex::sfIsInt($_POST['other_deliv_id'])) {
349                    $objQuery = new SC_Query();
350                    $deliv_count = $objQuery->count("dtb_other_deliv","customer_id=? and other_deliv_id = ?" ,array($objCustomer->getValue('customer_id'), $_POST['other_deliv_id']));
351                    if ($deliv_count != 1) {
352                        SC_Utils_Ex::sfDispSiteError(CUSTOMER_ERROR);
353                    }
354                    // 登録済みの別のお届け先を受注一時テーブルに書き込む
355                    $this->lfRegistOtherDelivData($uniqid, $objCustomer, $_POST['other_deliv_id']);
356                    // 正常に登録されたことを記録しておく
357                    $objSiteSess->setRegistFlag();
358                    // お支払い方法選択ページへ移動
359                    $this->sendRedirect($this->getLocation(MOBILE_URL_SHOP_PAYMENT), true);
360                    exit;
361                }
362            }else{
363                // エラーを返す
364                $arrErr['deli'] = '※ お届け先を選択してください。';
365            }
366            break;
367
368            // 前のページに戻る
369        case 'return':
370            // 確認ページへ移動
371            $this->sendRedirect($this->getLocation(MOBILE_URL_CART_TOP), true);
372            exit;
373            break;
374        default:
375            $objQuery = new SC_Query();
376            $where = "order_temp_id = ?";
377            $arrRet = $objQuery->select("*", "dtb_order_temp", $where, array($uniqid));
378            $this->objFormParam->setParam($arrRet[0]);
379            break;
380        }
381
382        /** 表示処理 **/
383
384        // 会員登録住所の取得
385        $col = "name01, name02, pref, addr01, addr02, zip01, zip02";
386        $where = "customer_id = ?";
387        $objQuery = new SC_Query();
388        $arrCustomerAddr = $objQuery->select($col, "dtb_customer", $where, array($_SESSION['customer']['customer_id']));
389        // 別のお届け先住所の取得
390        $col = "other_deliv_id, name01, name02, pref, addr01, addr02, zip01, zip02";
391        $objQuery->setorder("other_deliv_id DESC");
392        $objOtherAddr = $objQuery->select($col, "dtb_other_deliv", $where, array($_SESSION['customer']['customer_id']));
393        $this->arrAddr = $arrCustomerAddr;
394        $cnt = 1;
395        foreach($objOtherAddr as $val) {
396            $this->arrAddr[$cnt] = $val;
397            $cnt++;
398        }
399
400        // 入力値の取得
401        if (!isset($arrErr)) $arrErr = array();
402        $this->arrForm = $this->objFormParam->getFormParamList();
403        $this->arrErr = $arrErr;
404        $objView->assignobj($this);
405        $objView->display(SITE_FRAME);
406    }
407
408    /**
409     * デストラクタ.
410     *
411     * @return void
412     */
413    function destroy() {
414        parent::destroy();
415    }
416
417    /* パラメータ情報の初期化 */
418    function lfInitParam() {
419        $this->objFormParam->addParam("お名前1", "deliv_name01", STEXT_LEN, "KVa", array("EXIST_CHECK", "SPTAB_CHECK", "MAX_LENGTH_CHECK"));
420        $this->objFormParam->addParam("お名前2", "deliv_name02", STEXT_LEN, "KVa", array("EXIST_CHECK", "SPTAB_CHECK", "MAX_LENGTH_CHECK"));
421        $this->objFormParam->addParam("フリガナ1", "deliv_kana01", STEXT_LEN, "KVCa", array("EXIST_CHECK", "SPTAB_CHECK", "MAX_LENGTH_CHECK"));
422        $this->objFormParam->addParam("フリガナ2", "deliv_kana02", STEXT_LEN, "KVCa", array("EXIST_CHECK", "SPTAB_CHECK", "MAX_LENGTH_CHECK"));
423        $this->objFormParam->addParam("郵便番号1", "deliv_zip01", ZIP01_LEN, "n", array("EXIST_CHECK", "NUM_CHECK", "NUM_COUNT_CHECK"));
424        $this->objFormParam->addParam("郵便番号2", "deliv_zip02", ZIP02_LEN, "n", array("EXIST_CHECK", "NUM_CHECK", "NUM_COUNT_CHECK"));
425        $this->objFormParam->addParam("都道府県", "deliv_pref", INT_LEN, "n", array("EXIST_CHECK", "MAX_LENGTH_CHECK", "NUM_CHECK"));
426        $this->objFormParam->addParam("住所1", "deliv_addr01", STEXT_LEN, "KVa", array("EXIST_CHECK", "SPTAB_CHECK", "MAX_LENGTH_CHECK"));
427        $this->objFormParam->addParam("住所2", "deliv_addr02", STEXT_LEN, "KVa", array("EXIST_CHECK", "SPTAB_CHECK", "MAX_LENGTH_CHECK"));
428        $this->objFormParam->addParam("電話番号1", "deliv_tel01", TEL_ITEM_LEN, "n", array("EXIST_CHECK", "MAX_LENGTH_CHECK" ,"NUM_CHECK"));
429        $this->objFormParam->addParam("電話番号2", "deliv_tel02", TEL_ITEM_LEN, "n", array("EXIST_CHECK", "MAX_LENGTH_CHECK" ,"NUM_CHECK"));
430        $this->objFormParam->addParam("電話番号3", "deliv_tel03", TEL_ITEM_LEN, "n", array("EXIST_CHECK", "MAX_LENGTH_CHECK" ,"NUM_CHECK"));
431        $this->objFormParam->addParam("", "deliv_check");
432    }
433
434    function lfInitLoginFormParam() {
435        $this->objLoginFormParam->addParam("記憶する", "login_memory", INT_LEN, "n", array("MAX_LENGTH_CHECK", "NUM_CHECK"));
436        $this->objLoginFormParam->addParam("メールアドレス", "login_email", STEXT_LEN, "KVa", array("EXIST_CHECK", "MAX_LENGTH_CHECK"));
437        $this->objLoginFormParam->addParam("パスワード", "login_pass", PASSWORD_LEN1, "", array("EXIST_CHECK"));
438        $this->objLoginFormParam->addParam("パスワード", "login_pass1", PASSWORD_LEN1, "", array("EXIST_CHECK", "MIN_LENGTH_CHECK"));
439        $this->objLoginFormParam->addParam("パスワード", "login_pass2", PASSWORD_LEN2, "", array("EXIST_CHECK", "MAX_LENGTH_CHECK"));
440    }
441
442    /* DBへデータの登録 */
443    function lfRegistNewAddrData($uniqid, $objCustomer) {
444        $arrRet = $this->objFormParam->getHashArray();
445        $sqlval = $this->objFormParam->getDbArray();
446        // 登録データの作成
447        $sqlval['deliv_check'] = '1';
448        $sqlval['order_temp_id'] = $uniqid;
449        $sqlval['update_date'] = 'Now()';
450        $sqlval['customer_id'] = $objCustomer->getValue('customer_id');
451        $sqlval['order_birth'] = $objCustomer->getValue('birth');
452
453        $objDb = new SC_Helper_DB_Ex();
454        $objDb->sfRegistTempOrder($uniqid, $sqlval);
455    }
456
457    /* 会員情報の住所を一時受注テーブルへ */
458    function lfRegistDelivData($uniqid, $objCustomer) {
459        // 登録データの作成
460        $sqlval['order_temp_id'] = $uniqid;
461        $sqlval['update_date'] = 'Now()';
462        $sqlval['customer_id'] = $objCustomer->getValue('customer_id');
463        $sqlval['order_name01'] = $objCustomer->getValue('name01');
464        $sqlval['order_name02'] = $objCustomer->getValue('name02');
465        $sqlval['order_kana01'] = $objCustomer->getValue('kana01');
466        $sqlval['order_kana02'] = $objCustomer->getValue('kana02');
467        $sqlval['order_zip01'] = $objCustomer->getValue('zip01');
468        $sqlval['order_zip02'] = $objCustomer->getValue('zip02');
469        $sqlval['order_pref'] = $objCustomer->getValue('pref');
470        $sqlval['order_addr01'] = $objCustomer->getValue('addr01');
471        $sqlval['order_addr02'] = $objCustomer->getValue('addr02');
472        $sqlval['order_tel01'] = $objCustomer->getValue('tel01');
473        $sqlval['order_tel02'] = $objCustomer->getValue('tel02');
474        $sqlval['order_tel03'] = $objCustomer->getValue('tel03');
475        $sqlval['order_fax01'] = $objCustomer->getValue('fax01');
476        $sqlval['order_fax02'] = $objCustomer->getValue('fax02');
477        $sqlval['order_fax03'] = $objCustomer->getValue('fax03');
478        $sqlval['order_birth'] = $objCustomer->getValue('birth');
479        $sqlval['order_email'] = $objCustomer->getValue('email');
480
481        $sqlval['deliv_check'] = '-1';
482        $sqlval['deliv_name01'] = $objCustomer->getValue('name01');
483        $sqlval['deliv_name02'] = $objCustomer->getValue('name02');
484        $sqlval['deliv_kana01'] = $objCustomer->getValue('kana01');
485        $sqlval['deliv_kana02'] = $objCustomer->getValue('kana02');
486        $sqlval['deliv_zip01'] = $objCustomer->getValue('zip01');
487        $sqlval['deliv_zip02'] = $objCustomer->getValue('zip02');
488        $sqlval['deliv_pref'] = $objCustomer->getValue('pref');
489        $sqlval['deliv_addr01'] = $objCustomer->getValue('addr01');
490        $sqlval['deliv_addr02'] = $objCustomer->getValue('addr02');
491        $sqlval['deliv_tel01'] = $objCustomer->getValue('tel01');
492        $sqlval['deliv_tel02'] = $objCustomer->getValue('tel02');
493        $sqlval['deliv_tel03'] = $objCustomer->getValue('tel03');
494        $sqlval['deliv_fax01'] = $objCustomer->getValue('fax01');
495        $sqlval['deliv_fax02'] = $objCustomer->getValue('fax02');
496        $sqlval['deliv_fax03'] = $objCustomer->getValue('fax03');
497
498        $objDb = new SC_Helper_DB_Ex();
499        $objDb->sfRegistTempOrder($uniqid, $sqlval);
500    }
501
502    /* 別のお届け先住所を一時受注テーブルへ */
503    function lfRegistOtherDelivData($uniqid, $objCustomer, $other_deliv_id) {
504        // 登録データの作成
505        $sqlval['order_temp_id'] = $uniqid;
506        $sqlval['update_date'] = 'Now()';
507        $sqlval['customer_id'] = $objCustomer->getValue('customer_id');
508
509        $sqlval['order_name01'] = $objCustomer->getValue('name01');
510        $sqlval['order_name02'] = $objCustomer->getValue('name02');
511        $sqlval['order_kana01'] = $objCustomer->getValue('kana01');
512        $sqlval['order_kana02'] = $objCustomer->getValue('kana02');
513        $sqlval['order_zip01'] = $objCustomer->getValue('zip01');
514        $sqlval['order_zip02'] = $objCustomer->getValue('zip02');
515        $sqlval['order_pref'] = $objCustomer->getValue('pref');
516        $sqlval['order_addr01'] = $objCustomer->getValue('addr01');
517        $sqlval['order_addr02'] = $objCustomer->getValue('addr02');
518        $sqlval['order_tel01'] = $objCustomer->getValue('tel01');
519        $sqlval['order_tel02'] = $objCustomer->getValue('tel02');
520        $sqlval['order_tel03'] = $objCustomer->getValue('tel03');
521        $sqlval['order_fax01'] = $objCustomer->getValue('fax01');
522        $sqlval['order_fax02'] = $objCustomer->getValue('fax02');
523        $sqlval['order_fax03'] = $objCustomer->getValue('fax03');
524        $sqlval['order_birth'] = $objCustomer->getValue('birth');
525        $sqlval['order_email'] = $objCustomer->getValue('email');
526
527        $objQuery = new SC_Query();
528        $where = "other_deliv_id = ?";
529        $arrRet = $objQuery->select("*", "dtb_other_deliv", $where, array($other_deliv_id));
530
531        $sqlval['deliv_check'] = $other_deliv_id;
532        $sqlval['deliv_name01'] = $arrRet[0]['name01'];
533        $sqlval['deliv_name02'] = $arrRet[0]['name02'];
534        $sqlval['deliv_kana01'] = $arrRet[0]['kana01'];
535        $sqlval['deliv_kana02'] = $arrRet[0]['kana02'];
536        $sqlval['deliv_zip01'] = $arrRet[0]['zip01'];
537        $sqlval['deliv_zip02'] = $arrRet[0]['zip02'];
538        $sqlval['deliv_pref'] = $arrRet[0]['pref'];
539        $sqlval['deliv_addr01'] = $arrRet[0]['addr01'];
540        $sqlval['deliv_addr02'] = $arrRet[0]['addr02'];
541        $sqlval['deliv_tel01'] = $arrRet[0]['tel01'];
542        $sqlval['deliv_tel02'] = $arrRet[0]['tel02'];
543        $sqlval['deliv_tel03'] = $arrRet[0]['tel03'];
544
545        $objDb = new SC_Helper_DB_Ex();
546        $objDb->sfRegistTempOrder($uniqid, $sqlval);
547    }
548
549    /* 入力内容のチェック */
550    function lfCheckError() {
551        // 入力データを渡す。
552        $arrRet =  $this->objFormParam->getHashArray();
553        $objErr = new SC_CheckError($arrRet);
554        $objErr->arrErr = $this->objFormParam->checkError();
555        // 複数項目チェック
556        if ($_POST['mode'] == 'login'){
557            $objErr->doFunc(array("メールアドレス", "login_email", STEXT_LEN), array("EXIST_CHECK"));
558            $objErr->doFunc(array("パスワード", "login_pass", STEXT_LEN), array("EXIST_CHECK"));
559        }
560        $objErr->doFunc(array("TEL", "deliv_tel01", "deliv_tel02", "deliv_tel03", TEL_ITEM_LEN), array("TEL_CHECK"));
561        return $objErr->arrErr;
562    }
563
564    /**
565     * 入力されたEmailから余分な改行・空白を削除する
566     *
567     * @param string $_POST["login_email"]
568     */
569    function lfConvertEmail(){
570        if( strlen($_POST["login_email"]) < 1 ){ return ; }
571        $_POST["login_email"] = preg_replace('/^[  \r\n]*(.*?)[  \r\n]*$/u', '$1', $_POST["login_email"]);
572    }
573
574    /**
575     * 入力されたPassから余分な空白を削除し、最小桁数・最大桁数チェック用に変数に入れる
576     *
577     * @param string $_POST["login_pass"]
578     */
579    function lfConvertLoginPass(){
580    if( strlen($_POST["login_pass"]) < 1 ){ return ; }
581        $_POST["login_pass"] = trim($_POST["login_pass"]); //認証用
582        $_POST["login_pass1"] = $_POST["login_pass"];      //最小桁数比較用
583        $_POST["login_pass2"] = $_POST["login_pass"];      //最大桁数比較用
584    }
585}
586?>
Note: See TracBrowser for help on using the repository browser.