Source for file LC_Page_Shopping_Deliv.php
Documentation is available at LC_Page_Shopping_Deliv.php
* This file is part of EC-CUBE
* Copyright(c) 2000-2007 LOCKON CO.,LTD. All Rights Reserved.
* http://www.lockon.co.jp/
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
require_once(CLASS_PATH .
"pages/LC_Page.php");
* @author LOCKON CO.,LTD.
* @version $Id:LC_Page_Shopping_Deliv.php 15532 2007-08-31 14:39:46Z nanasess $
$this->tpl_css =
URL_DIR.
'css/layout/shopping/index.css';
$this->arrPref =
$masterData->getMasterData("mtb_pref", array("pref_id", "pref_name", "rank"));
// ユーザユニークIDの取得と購入状態の正当性をチェック
$uniqid =
SC_Utils_Ex::sfCheckNormalAccess($objSiteSess, $objCartSess);
$this->tpl_uniqid =
$uniqid;
if (!isset
($_POST['mode'])) $_POST['mode'] =
"";
if($_POST['mode'] !=
'login' &&
!$objCustomer->isLoginSuccess()) {
if($arrForm['login_memory'] ==
"1" &&
$arrForm['login_email'] !=
"") {
$objCookie->setCookie('login_email', $_POST['login_email']);
$objCookie->setCookie('login_email', '');
if(count($this->arrErr) ==
0) {
if(!$objCustomer->getCustomerDataFromEmailPass($arrForm['login_pass'], $arrForm['login_email'])) {
$where =
"email = ? AND status = 1 AND del_flg = 0";
$ret =
$objQuery->count("dtb_customer", $where, array($arrForm['login_email']));
$where =
"other_deliv_id = ?";
$arrRet =
$objQuery->delete("dtb_other_deliv", $where, array($_POST['other_deliv_id']));
if ($_POST['deliv_check'] ==
'-1') {
$objSiteSess->setRegistFlag();
} elseif($_POST['deliv_check'] >=
1) {
$deliv_count =
$objQuery->count("dtb_other_deliv","customer_id=? and other_deliv_id = ?" ,array($objCustomer->getValue('customer_id'), $_POST['deliv_check']));
// 登録済みの別のお届け先を受注一時テーブルに書き込む
$objSiteSess->setRegistFlag();
$arrErr['deli'] =
'※ お届け先を選択してください。';
$where =
"order_temp_id = ?";
$arrRet =
$objQuery->select("*", "dtb_order_temp", $where, array($uniqid));
if (empty($arrRet)) $arrRet =
array("");
$col =
"name01, name02, pref, addr01, addr02";
$where =
"customer_id = ?";
$arrCustomerAddr =
$objQuery->select($col, "dtb_customer", $where, array($_SESSION['customer']['customer_id']));
$col =
"other_deliv_id, name01, name02, pref, addr01, addr02";
$objQuery->setorder("other_deliv_id DESC");
$objOtherAddr =
$objQuery->select($col, "dtb_other_deliv", $where, array($_SESSION['customer']['customer_id']));
$this->arrAddr =
$arrCustomerAddr;
$this->tpl_addrmax =
count($objOtherAddr);
foreach($objOtherAddr as $val) {
$this->arrAddr[$cnt] =
$val;
if (!isset
($arrErr)) $arrErr =
array();
$objView->assignobj($this);
// フレームを選択(キャンペーンページから遷移なら変更)
$objCampaignSess->pageView($objView);
// ユーザユニークIDの取得と購入状態の正当性をチェック
$uniqid =
SC_Utils_Ex::sfCheckNormalAccess($objSiteSess, $objCartSess);
$this->tpl_uniqid =
$uniqid;
if (!isset
($_POST['mode'])) $_POST['mode'] =
"";
if($_POST['mode'] !=
'login' &&
!$objCustomer->isLoginSuccess(true)) {
SC_Utils_Ex::sfDispSiteError(CUSTOMER_ERROR, "", false, "", true);
if($arrForm['login_memory'] ==
"1" &&
$arrForm['login_email'] !=
"") {
$objCookie->setCookie('login_email', $_POST['login_email']);
$objCookie->setCookie('login_email', '');
if(count($this->arrErr) ==
0) {
if(!$objCustomer->getCustomerDataFromMobilePhoneIdPass($arrForm['login_pass']) &&
!$objCustomer->getCustomerDataFromEmailPass($arrForm['login_pass'], $arrForm['login_email'], true)) {
$where =
"(email = ? OR email_mobile = ?) AND status = 1 AND del_flg = 0";
$ret =
$objQuery->count("dtb_customer", $where, array($arrForm['login_email'], $arrForm['login_email']));
SC_Utils_Ex::sfDispSiteError(TEMP_LOGIN_ERROR, "", false, "", true);
SC_Utils_Ex::sfDispSiteError(SITE_LOGIN_ERROR, "", false, "", true);
// ログインが成功した場合は携帯端末IDを保存する。
$objCustomer->updateMobilePhoneId();
if (!$objMobile->gfIsMobileMailAddress($objCustomer->getValue('email'))) {
if (!$objCustomer->hasValue('email_mobile')) {
$where =
"other_deliv_id = ?";
$arrRet =
$objQuery->delete("dtb_other_deliv", $where, array($_POST['other_deliv_id']));
// お届け先がチェックされている場合には更新処理を行う
if ($_POST['deli'] !=
"") {
$objSiteSess->setRegistFlag();
$arrErr['deli'] =
'※ お届け先を選択してください。';
// お届け先がチェックされている場合には更新処理を行う
if ($_POST['deli'] !=
"") {
$deliv_count =
$objQuery->count("dtb_other_deliv","customer_id=? and other_deliv_id = ?" ,array($objCustomer->getValue('customer_id'), $_POST['other_deliv_id']));
// 登録済みの別のお届け先を受注一時テーブルに書き込む
$objSiteSess->setRegistFlag();
$arrErr['deli'] =
'※ お届け先を選択してください。';
$where =
"order_temp_id = ?";
$arrRet =
$objQuery->select("*", "dtb_order_temp", $where, array($uniqid));
$col =
"name01, name02, pref, addr01, addr02, zip01, zip02";
$where =
"customer_id = ?";
$arrCustomerAddr =
$objQuery->select($col, "dtb_customer", $where, array($_SESSION['customer']['customer_id']));
$col =
"other_deliv_id, name01, name02, pref, addr01, addr02, zip01, zip02";
$objQuery->setorder("other_deliv_id DESC");
$objOtherAddr =
$objQuery->select($col, "dtb_other_deliv", $where, array($_SESSION['customer']['customer_id']));
$this->arrAddr =
$arrCustomerAddr;
foreach($objOtherAddr as $val) {
$this->arrAddr[$cnt] =
$val;
if (!isset
($arrErr)) $arrErr =
array();
$objView->assignobj($this);
$objView->display(SITE_FRAME);
$this->objFormParam->addParam("お名前1", "deliv_name01", STEXT_LEN, "KVa", array("EXIST_CHECK", "SPTAB_CHECK", "MAX_LENGTH_CHECK"));
$this->objFormParam->addParam("お名前2", "deliv_name02", STEXT_LEN, "KVa", array("EXIST_CHECK", "SPTAB_CHECK", "MAX_LENGTH_CHECK"));
$this->objFormParam->addParam("フリガナ1", "deliv_kana01", STEXT_LEN, "KVCa", array("EXIST_CHECK", "SPTAB_CHECK", "MAX_LENGTH_CHECK"));
$this->objFormParam->addParam("フリガナ2", "deliv_kana02", STEXT_LEN, "KVCa", array("EXIST_CHECK", "SPTAB_CHECK", "MAX_LENGTH_CHECK"));
$this->objFormParam->addParam("郵便番号1", "deliv_zip01", ZIP01_LEN, "n", array("EXIST_CHECK", "NUM_CHECK", "NUM_COUNT_CHECK"));
$this->objFormParam->addParam("郵便番号2", "deliv_zip02", ZIP02_LEN, "n", array("EXIST_CHECK", "NUM_CHECK", "NUM_COUNT_CHECK"));
$this->objFormParam->addParam("都道府県", "deliv_pref", INT_LEN, "n", array("EXIST_CHECK", "MAX_LENGTH_CHECK", "NUM_CHECK"));
$this->objFormParam->addParam("住所1", "deliv_addr01", STEXT_LEN, "KVa", array("EXIST_CHECK", "SPTAB_CHECK", "MAX_LENGTH_CHECK"));
$this->objFormParam->addParam("住所2", "deliv_addr02", STEXT_LEN, "KVa", array("EXIST_CHECK", "SPTAB_CHECK", "MAX_LENGTH_CHECK"));
$this->objFormParam->addParam("電話番号1", "deliv_tel01", TEL_ITEM_LEN, "n", array("EXIST_CHECK", "MAX_LENGTH_CHECK" ,"NUM_CHECK"));
$this->objFormParam->addParam("電話番号2", "deliv_tel02", TEL_ITEM_LEN, "n", array("EXIST_CHECK", "MAX_LENGTH_CHECK" ,"NUM_CHECK"));
$this->objFormParam->addParam("電話番号3", "deliv_tel03", TEL_ITEM_LEN, "n", array("EXIST_CHECK", "MAX_LENGTH_CHECK" ,"NUM_CHECK"));
$this->objLoginFormParam->addParam("記憶する", "login_memory", INT_LEN, "n", array("MAX_LENGTH_CHECK", "NUM_CHECK"));
$this->objLoginFormParam->addParam("メールアドレス", "login_email", STEXT_LEN, "KVa", array("EXIST_CHECK", "MAX_LENGTH_CHECK"));
$this->objLoginFormParam->addParam("パスワード", "login_pass", STEXT_LEN, "KVa", array("EXIST_CHECK", "MAX_LENGTH_CHECK"));
$sqlval['deliv_check'] =
'1';
$sqlval['order_temp_id'] =
$uniqid;
$sqlval['update_date'] =
'Now()';
$sqlval['customer_id'] =
$objCustomer->getValue('customer_id');
$sqlval['order_birth'] =
$objCustomer->getValue('birth');
$objDb->sfRegistTempOrder($uniqid, $sqlval);
$sqlval['order_temp_id'] =
$uniqid;
$sqlval['update_date'] =
'Now()';
$sqlval['customer_id'] =
$objCustomer->getValue('customer_id');
$sqlval['deliv_check'] =
'-1';
$sqlval['order_name01'] =
$objCustomer->getValue('name01');
$sqlval['order_name02'] =
$objCustomer->getValue('name02');
$sqlval['order_kana01'] =
$objCustomer->getValue('kana01');
$sqlval['order_kana02'] =
$objCustomer->getValue('kana02');
$sqlval['order_zip01'] =
$objCustomer->getValue('zip01');
$sqlval['order_zip02'] =
$objCustomer->getValue('zip02');
$sqlval['order_pref'] =
$objCustomer->getValue('pref');
$sqlval['order_addr01'] =
$objCustomer->getValue('addr01');
$sqlval['order_addr02'] =
$objCustomer->getValue('addr02');
$sqlval['order_tel01'] =
$objCustomer->getValue('tel01');
$sqlval['order_tel02'] =
$objCustomer->getValue('tel02');
$sqlval['order_tel03'] =
$objCustomer->getValue('tel03');
$sqlval['order_fax01'] =
$objCustomer->getValue('fax01');
$sqlval['order_fax02'] =
$objCustomer->getValue('fax02');
$sqlval['order_fax03'] =
$objCustomer->getValue('fax03');
$sqlval['deliv_name01'] =
$objCustomer->getValue('name01');
$sqlval['deliv_name02'] =
$objCustomer->getValue('name02');
$sqlval['deliv_kana01'] =
$objCustomer->getValue('kana01');
$sqlval['deliv_kana02'] =
$objCustomer->getValue('kana02');
$sqlval['deliv_zip01'] =
$objCustomer->getValue('zip01');
$sqlval['deliv_zip02'] =
$objCustomer->getValue('zip02');
$sqlval['deliv_pref'] =
$objCustomer->getValue('pref');
$sqlval['deliv_addr01'] =
$objCustomer->getValue('addr01');
$sqlval['deliv_addr02'] =
$objCustomer->getValue('addr02');
$sqlval['deliv_tel01'] =
$objCustomer->getValue('tel01');
$sqlval['deliv_tel02'] =
$objCustomer->getValue('tel02');
$sqlval['deliv_tel03'] =
$objCustomer->getValue('tel03');
$sqlval['deliv_fax01'] =
$objCustomer->getValue('fax01');
$sqlval['deliv_fax02'] =
$objCustomer->getValue('fax02');
$sqlval['deliv_fax03'] =
$objCustomer->getValue('fax03');
$objDb->sfRegistTempOrder($uniqid, $sqlval);
$sqlval['order_temp_id'] =
$uniqid;
$sqlval['update_date'] =
'Now()';
$sqlval['customer_id'] =
$objCustomer->getValue('customer_id');
$sqlval['order_birth'] =
$objCustomer->getValue('birth');
$where =
"other_deliv_id = ?";
$arrRet =
$objQuery->select("*", "dtb_other_deliv", $where, array($other_deliv_id));
$sqlval['deliv_check'] =
$other_deliv_id;
$sqlval['deliv_name01'] =
$arrRet[0]['name01'];
$sqlval['deliv_name02'] =
$arrRet[0]['name02'];
$sqlval['deliv_kana01'] =
$arrRet[0]['kana01'];
$sqlval['deliv_kana02'] =
$arrRet[0]['kana02'];
$sqlval['deliv_zip01'] =
$arrRet[0]['zip01'];
$sqlval['deliv_zip02'] =
$arrRet[0]['zip02'];
$sqlval['deliv_pref'] =
$arrRet[0]['pref'];
$sqlval['deliv_addr01'] =
$arrRet[0]['addr01'];
$sqlval['deliv_addr02'] =
$arrRet[0]['addr02'];
$sqlval['deliv_tel01'] =
$arrRet[0]['tel01'];
$sqlval['deliv_tel02'] =
$arrRet[0]['tel02'];
$sqlval['deliv_tel03'] =
$arrRet[0]['tel03'];
$objDb->sfRegistTempOrder($uniqid, $sqlval);
if ($_POST['mode'] ==
'login'){
$objErr->doFunc(array("メールアドレス", "login_email", STEXT_LEN), array("EXIST_CHECK"));
$objErr->doFunc(array("パスワード", "login_pass", STEXT_LEN), array("EXIST_CHECK"));
$objErr->doFunc(array("TEL", "deliv_tel01", "deliv_tel02", "deliv_tel03", TEL_ITEM_LEN), array("TEL_CHECK"));
Documentation generated on Tue, 28 Apr 2009 18:12:56 +0900 by phpDocumentor 1.4.2