Source for file LC_Page_Admin_Customer_Edit.php
Documentation is available at LC_Page_Admin_Customer_Edit.php
* This file is part of EC-CUBE
* Copyright(c) 2000-2011 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_EX_REALDIR . 'page_extends/admin/LC_Page_Admin_Ex.php';
* @author LOCKON CO.,LTD.
* @version $Id: LC_Page_Admin_Customer_Edit.php 21118 2011-08-03 12:28:10Z kajiwara $
$this->tpl_mainpage = 'customer/edit.tpl';
$this->tpl_mainno = 'customer';
$this->tpl_subno = 'index';
$this->tpl_pager = 'pager.tpl';
$this->tpl_maintitle = '顧客管理';
$this->tpl_subtitle = '顧客登録';
$masterData = new SC_DB_MasterData_Ex();
$this->arrPref = $masterData->getMasterData('mtb_pref');
$this->arrJob = $masterData->getMasterData("mtb_job");
$this->arrSex = $masterData->getMasterData("mtb_sex");
$this->arrReminder = $masterData->getMasterData("mtb_reminder");
$this->arrStatus = $masterData->getMasterData("mtb_customer_status");
$this->arrMailMagazineType = $masterData->getMasterData("mtb_mail_magazine_type");
$objDate = new SC_Date_Ex(BIRTH_YEAR);
$this->arrYear = $objDate->getYear();
$this->arrMonth = $objDate->getMonth();
$this->arrDay = $objDate->getDay();
$objDb = new SC_Helper_DB_Ex();
$this->arrPayment = $objDb->sfGetIDValueList("dtb_payment", "payment_id", "payment_method");
$objFormParam = new SC_FormParam_Ex();
$objFormSearchParam = new SC_FormParam_Ex();
switch ($this->getMode()) {
$objFormSearchParam->setParam($_REQUEST);
$this->arrSearchData = $objFormSearchParam->getSearchArray();
if(!SC_Utils_Ex::isBlank($this->arrErr)) {
$this->arrForm = SC_Helper_Customer_Ex::sfGetCustomerData($objFormSearchParam->getValue("edit_customer_id"), true);
list ($this->tpl_linemax, $this->arrPurchaseHistory, $this->objNavi) = $this->lfPurchaseHistory($objFormSearchParam->getValue("edit_customer_id"));
$this->arrPagenavi = $this->objNavi->arrPagenavi;
$this->arrPagenavi['mode'] = 'return';
$objFormParam->setParam($_POST);
$objFormParam->convParam();
$this->arrForm = $objFormParam->getHashArray();
$objFormSearchParam->setParam($objFormParam->getValue("search_data"));
$this->arrSearchData = $objFormSearchParam->getSearchArray();
if(!SC_Utils_Ex::isBlank($this->arrErr) or !SC_Utils_Ex::isBlank($this->arrSearchErr)) {
$this->tpl_mainpage = 'customer/edit_confirm.tpl';
$objFormParam->setParam($_POST);
$objFormParam->convParam();
$this->arrForm = $objFormParam->getHashArray();
$objFormSearchParam->setParam($objFormParam->getValue("search_data"));
$this->arrSearchData = $objFormSearchParam->getSearchArray();
if(!SC_Utils_Ex::isBlank($this->arrErr) or !SC_Utils_Ex::isBlank($this->arrSearchErr)) {
list ($this->tpl_linemax, $this->arrPurchaseHistory, $this->objNavi) = $this->lfPurchaseHistory($objFormParam->getValue("customer_id"), $objFormParam->getValue("search_pageno"));
$this->arrPagenavi = $this->objNavi->arrPagenavi;
$this->arrPagenavi['mode'] = 'return';
$this->tpl_pageno = $objFormParam->getValue("search_pageno");
$objFormParam->setParam($_POST);
$objFormParam->convParam();
$this->arrForm = $objFormParam->getHashArray();
$objFormSearchParam->setParam($objFormParam->getValue("search_data"));
$this->arrSearchData = $objFormSearchParam->getSearchArray();
if(!SC_Utils_Ex::isBlank($this->arrErr) or !SC_Utils_Ex::isBlank($this->arrSearchErr)) {
$this->tpl_mainpage = 'customer/edit_complete.tpl';
$objFormParam->setParam($_POST);
$objFormSearchParam->setParam($objFormParam->getValue("search_data"));
$this->arrSearchData = $objFormSearchParam->getSearchArray();
if(!SC_Utils_Ex::isBlank($this->arrSearchErr)) {
* @param array $objFormParam フォームパラメータークラス
SC_Helper_Customer_Ex::sfCustomerEntryParam($objFormParam, true);
$objFormParam->addParam("検索用データ", "search_data", "", "", array(), "", false);
$objFormParam->addParam("", "search_pageno", INT_LEN, 'n', array("NUM_CHECK", "MAX_LENGTH_CHECK"), "", false);
* @param array $objFormParam フォームパラメータークラス
SC_Helper_Customer_Ex::sfSetSearchParam($objFormParam);
$objFormParam->addParam("編集対象顧客ID", "edit_customer_id", INT_LEN, 'n', array("NUM_CHECK", "MAX_LENGTH_CHECK"));
* @param array $objFormParam フォームパラメータークラス
return SC_Helper_Customer_Ex::sfCheckErrorSearchParam($objFormParam);
* @param array $objFormParam フォームパラメータークラス
$arrErr = SC_Helper_Customer_Ex::sfCustomerMypageErrorCheck($objFormParam, true);
$objQuery = & SC_Query_Ex::getSingletonInstance();
$col = "email, email_mobile, customer_id";
$where = "del_flg <> 1 AND (email Like ? OR email_mobile Like ?)";
$arrVal = array($objFormParam->getValue('email'), $objFormParam->getValue('email_mobile'));
if($objFormParam->getValue("customer_id")) {
$where .= " AND customer_id <> ?";
$arrVal[] = $objFormParam->getValue("customer_id");
$arrData = $objQuery->getRow($col, $table, $where, $arrVal);
if(!SC_Utils_Ex::isBlank($arrData['email'])) {
if($arrData['email'] == $objFormParam->getValue('email')) {
$arrErr['email'] = '※ すでに他の顧客(ID:' . $arrData['customer_id'] . ')が使用しているアドレスです。';
}else if($arrData['email'] == $objFormParam->getValue('email_mobile')) {
$arrErr['email_mobile'] = '※ すでに他の顧客(ID:' . $arrData['customer_id'] . ')が使用しているアドレスです。';
if(!SC_Utils_Ex::isBlank($arrData['email_mobile'])) {
if($arrData['email_mobile'] == $objFormParam->getValue('email_mobile')) {
$arrErr['email_mobile'] = '※ すでに他の顧客(ID:' . $arrData['customer_id'] . ')が使用している携帯アドレスです。';
}else if($arrData['email_mobile'] == $objFormParam->getValue('email')) {
if ($arrErr['email'] == "") {
$arrErr['email'] = '※ すでに他の顧客(ID:' . $arrData['customer_id'] . ')が使用している携帯アドレスです。';
* @param array $objFormParam フォームパラメータークラス
$objQuery = & SC_Query_Ex::getSingletonInstance();
$arrData = $objFormParam->getDbArray();
if(!SC_Utils_Ex::isBlank($objFormParam->getValue('year'))) {
$arrData['birth'] = $objFormParam->getValue('year') . '/'
. $objFormParam->getValue('month') . '/'
. $objFormParam->getValue('day')
$arrData['secret_key'] = SC_Utils_Ex::sfGetUniqRandomId('r');
$arrOldCustomerData = SC_Helper_Customer_Ex::sfGetCustomerData($arrData['customer_id']);
if($arrOldCustomerData['status'] != $arrData['status']) {
$arrData['secret_key'] = SC_Utils_Ex::sfGetUniqRandomId('r');
return SC_Helper_Customer_Ex::sfEditCustomerData($arrData, $arrData['customer_id']);
* @param array $arrParam 検索パラメーター連想配列
* @return array( integer 全体件数, mixed 顧客データ一覧配列, mixed SC_PageNaviオブジェクト)
if(SC_Utils_Ex::isBlank($customer_id)) {
return array('0', array(), NULL);
$objQuery = & SC_Query_Ex::getSingletonInstance();
$where = "customer_id = ? AND del_flg <> 1";
$arrVal = array($customer_id);
$linemax = $objQuery->count($table, $where, $arrVal);
$objNavi = new SC_PageNavi_Ex($pageno, $linemax, $page_max, "fnNaviSearchPage2", NAVI_PMAX);
$objQuery->setLimitOffset($page_max, $objNavi->start_row);
$order = "order_id DESC";
$objQuery->setOrder($order);
$arrPurchaseHistory = $objQuery->select("*", $table, $where, $arrVal);
return array($linemax, $arrPurchaseHistory, $objNavi);
Documentation generated on Fri, 24 Feb 2012 14:01:13 +0900 by Seasoft
|