source: branches/version-2_5-dev/data/class/pages/shopping/LC_Page_Shopping_Deliv.php @ 19860

Revision 19860, 27.0 KB checked in by nanasess, 13 years ago (diff)

#843(複数配送先の指定)

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