Source for file LC_Page_Admin_Order.php
Documentation is available at LC_Page_Admin_Order.php
* This file is part of EC-CUBE
* Copyright(c) 2000-2010 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");
if (file_exists(MODULE_PATH . 'mdl_paygent/include.php') === TRUE) {
require_once(MODULE_PATH . 'mdl_paygent/include.php');
* @author LOCKON CO.,LTD.
$this->tpl_subnavi = 'order/subnavi.tpl';
$this->tpl_subno = 'index';
$this->tpl_pager = TEMPLATE_DIR . 'admin/pager.tpl';
$this->tpl_subtitle = '受注管理';
$masterData = new SC_DB_MasterData_Ex();
$this->arrORDERSTATUS = $masterData->getMasterData("mtb_order_status");
$this->arrORDERSTATUS_COLOR = $masterData->getMasterData("mtb_order_status_color");
$this->arrSex = $masterData->getMasterData("mtb_sex");
$this->arrPageMax = $masterData->getMasterData("mtb_page_max");
$this->arrDispKind = sfPaygentOrderPage();
$objDb = new SC_Helper_DB_Ex();
$this->objFormParam->setParam($_POST);
$this->objFormParam->splitParamCheckBoxes('search_order_sex');
$this->objFormParam->splitParamCheckBoxes('search_payment_id');
foreach ($_POST as $key => $val) {
if (ereg("^search_", $key)) {
case 'search_payment_id':
$this->arrHidden[$key] = SC_Utils_Ex::sfMergeParamCheckBoxes($val);
$this->arrHidden[$key] = $val;
$this->arrHidden['search_pageno'] =
isset ($_POST['search_pageno']) ? $_POST['search_pageno'] : "";
SC_Utils_Ex::sfIsSuccess($objSess);
if (!isset ($_POST['mode'])) $_POST['mode'] = "";
if (!isset ($arrRet)) $arrRet = array();
if($_POST['mode'] == 'delete_order' ) {
if(SC_Utils_Ex::sfIsInt($_POST['order_id'])) {
$sqlval['del_flg'] = '1';
$objQuery->update("dtb_order", $sqlval, $where, array($_POST['order_id']));
$this->objFormParam->convParam();
$arrRet = $this->objFormParam->getHashArray();
if (count($this->arrErr) == 0) {
foreach ($arrRet as $key => $val) {
$val = SC_Utils_Ex::sfManualEscape($val);
case 'search_order_name':
$where .= " AND order_name01||order_name02 ILIKE ?";
}elseif(DB_TYPE == "mysql"){
$where .= " AND concat(order_name01,order_name02) ILIKE ?";
$nonsp_val = mb_ereg_replace("[ ]+","",$val);
$arrval[] = "%$nonsp_val%";
case 'search_order_kana':
$where .= " AND order_kana01||order_kana02 ILIKE ?";
}elseif(DB_TYPE == "mysql"){
$where .= " AND concat(order_kana01,order_kana02) ILIKE ?";
$nonsp_val = mb_ereg_replace("[ ]+","",$val);
$arrval[] = "%$nonsp_val%";
$where .= " AND order_id >= ?";
$where .= " AND order_id <= ?";
foreach($val as $element) {
$tmp_where .= " AND (order_sex = ?";
$tmp_where .= " OR order_sex = ?";
$where .= " $tmp_where ";
$where .= " AND (order_tel01 || order_tel02 || order_tel03) LIKE ?";
}elseif(DB_TYPE == "mysql"){
$where .= " AND concat(order_tel01,order_tel02,order_tel03) LIKE ?";
$arrval[] = "%$nonmark_val%";
case 'search_order_email':
$where .= " AND order_email ILIKE ?";
case 'search_payment_id':
foreach($val as $element) {
$tmp_where .= " AND (payment_id = ?";
$tmp_where .= " OR payment_id = ?";
$where .= " $tmp_where ";
$where .= " AND total >= ?";
$where .= " AND total <= ?";
case 'search_sorderyear':
$date = SC_Utils_Ex::sfGetTimestamp($_POST['search_sorderyear'], $_POST['search_sordermonth'], $_POST['search_sorderday']);
$where.= " AND create_date >= ?";
case 'search_eorderyear':
$date = SC_Utils_Ex::sfGetTimestamp($_POST['search_eorderyear'], $_POST['search_eordermonth'], $_POST['search_eorderday'], true);
$where.= " AND create_date <= ?";
case 'search_supdateyear':
$date = SC_Utils_Ex::sfGetTimestamp($_POST['search_supdateyear'], $_POST['search_supdatemonth'], $_POST['search_supdateday']);
$where.= " AND update_date >= ?";
case 'search_eupdateyear':
$date = SC_Utils_Ex::sfGetTimestamp($_POST['search_eupdateyear'], $_POST['search_eupdatemonth'], $_POST['search_eupdateday'], true);
$where.= " AND update_date <= ?";
case 'search_sbirthyear':
$date = SC_Utils_Ex::sfGetTimestamp($_POST['search_sbirthyear'], $_POST['search_sbirthmonth'], $_POST['search_sbirthday']);
$where.= " AND order_birth >= ?";
case 'search_ebirthyear':
$date = SC_Utils_Ex::sfGetTimestamp($_POST['search_ebirthyear'], $_POST['search_ebirthmonth'], $_POST['search_ebirthday'], true);
$where.= " AND order_birth <= ?";
case 'search_order_status':
$where.= " AND status = ?";
if (!isset ($arrval)) $arrval = array();
$order = "update_date DESC";
require_once(CLASS_EX_PATH . "helper_extends/SC_Helper_CSV_Ex.php");
$objCSV = new SC_Helper_CSV_Ex();
$option = "ORDER BY $order";
$arrCsvOutput = SC_Utils_Ex::sfSwapArray($objCSV->sfgetCsvOutput(3, " WHERE csv_id = 3 AND status = 1"));
if (count($arrCsvOutput) <= 0) break;
$arrCsvOutputCols = $arrCsvOutput['col'];
$arrCsvOutputTitle = $arrCsvOutput['disp_name'];
$head = SC_Utils_Ex::sfGetCSVList($arrCsvOutputTitle);
$data = $objCSV->lfGetCSV("dtb_order", $where, $option, $arrval, $arrCsvOutputCols);
SC_Utils_Ex::sfCSVDownload($head. $data);
$objFpdf->setData($arrRet);
$objQuery->update("dtb_order", $sqlval, $where, $arrval);
$linemax = $objQuery->count($from, $where, $arrval);
$this->tpl_linemax = $linemax; // 何件が該当しました。表示用
$page_max = $_POST['search_page_max'];
$objNavi = new SC_PageNavi($this->arrHidden['search_pageno'],
"fnNaviSearchPage", NAVI_PMAX);
$startno = $objNavi->start_row;
$this->arrPagenavi = $objNavi->arrPagenavi;
$objQuery->setLimitOffset($page_max, $startno);
$objQuery->setOrder($order);
$this->arrResults = $objQuery->select($col, $from, $where, $arrval);
$objDate->setStartYear(RELEASE_YEAR);
$objDate->setEndYear(DATE("Y"));
$this->arrRegistYear = $objDate->getYear();
$objDate->setStartYear(BIRTH_YEAR);
$objDate->setEndYear(DATE("Y"));
$this->arrBirthYear = $objDate->getYear();
$this->arrMonth = $objDate->getMonth();
$this->arrDay = $objDate->getDay();
$this->arrForm = $this->objFormParam->getFormParamList();
$arrRet = $objDb->sfGetPayment();
$this->arrPayment = SC_Utils_Ex::sfArrKeyValue($arrRet, 'payment_id', 'payment_method');
$objView->assignobj($this);
$objView->display(MAIN_FRAME);
$this->objFormParam->addParam("注文番号1", "search_order_id1", INT_LEN, "n", array("MAX_LENGTH_CHECK", "NUM_CHECK"));
$this->objFormParam->addParam("注文番号2", "search_order_id2", INT_LEN, "n", array("MAX_LENGTH_CHECK", "NUM_CHECK"));
$this->objFormParam->addParam("対応状況", "search_order_status", INT_LEN, "n", array("MAX_LENGTH_CHECK", "NUM_CHECK"));
$this->objFormParam->addParam("顧客名", "search_order_name", STEXT_LEN, "KVa", array("MAX_LENGTH_CHECK"));
$this->objFormParam->addParam("顧客名(カナ)", "search_order_kana", STEXT_LEN, "KVCa", array("KANA_CHECK","MAX_LENGTH_CHECK"));
$this->objFormParam->addParam("性別", "search_order_sex", INT_LEN, "n", array("MAX_LENGTH_CHECK"));
$this->objFormParam->addParam("年齢1", "search_age1", INT_LEN, "n", array("MAX_LENGTH_CHECK", "NUM_CHECK"));
$this->objFormParam->addParam("年齢2", "search_age2", INT_LEN, "n", array("MAX_LENGTH_CHECK", "NUM_CHECK"));
$this->objFormParam->addParam("メールアドレス", "search_order_email", STEXT_LEN, "KVa", array("MAX_LENGTH_CHECK"));
$this->objFormParam->addParam("TEL", "search_order_tel", STEXT_LEN, "KVa", array("MAX_LENGTH_CHECK"));
$this->objFormParam->addParam("支払い方法", "search_payment_id", INT_LEN, "n", array("MAX_LENGTH_CHECK", "NUM_CHECK"));
$this->objFormParam->addParam("購入金額1", "search_total1", INT_LEN, "n", array("MAX_LENGTH_CHECK", "NUM_CHECK"));
$this->objFormParam->addParam("購入金額2", "search_total2", INT_LEN, "n", array("MAX_LENGTH_CHECK", "NUM_CHECK"));
$this->objFormParam->addParam("表示件数", "search_page_max", INT_LEN, "n", array("MAX_LENGTH_CHECK", "NUM_CHECK"));
$this->objFormParam->addParam("開始日", "search_sorderyear", INT_LEN, "n", array("MAX_LENGTH_CHECK", "NUM_CHECK"));
$this->objFormParam->addParam("開始日", "search_sordermonth", INT_LEN, "n", array("MAX_LENGTH_CHECK", "NUM_CHECK"));
$this->objFormParam->addParam("開始日", "search_sorderday", INT_LEN, "n", array("MAX_LENGTH_CHECK", "NUM_CHECK"));
$this->objFormParam->addParam("終了日", "search_eorderyear", INT_LEN, "n", array("MAX_LENGTH_CHECK", "NUM_CHECK"));
$this->objFormParam->addParam("終了日", "search_eordermonth", INT_LEN, "n", array("MAX_LENGTH_CHECK", "NUM_CHECK"));
$this->objFormParam->addParam("終了日", "search_eorderday", INT_LEN, "n", array("MAX_LENGTH_CHECK", "NUM_CHECK"));
$this->objFormParam->addParam("開始日", "search_supdateyear", INT_LEN, "n", array("MAX_LENGTH_CHECK", "NUM_CHECK"));
$this->objFormParam->addParam("開始日", "search_supdatemonth", INT_LEN, "n", array("MAX_LENGTH_CHECK", "NUM_CHECK"));
$this->objFormParam->addParam("開始日", "search_supdateday", INT_LEN, "n", array("MAX_LENGTH_CHECK", "NUM_CHECK"));
$this->objFormParam->addParam("終了日", "search_eupdateyear", INT_LEN, "n", array("MAX_LENGTH_CHECK", "NUM_CHECK"));
$this->objFormParam->addParam("終了日", "search_eupdatemonth", INT_LEN, "n", array("MAX_LENGTH_CHECK", "NUM_CHECK"));
$this->objFormParam->addParam("終了日", "search_eupdateday", INT_LEN, "n", array("MAX_LENGTH_CHECK", "NUM_CHECK"));
$this->objFormParam->addParam("開始日", "search_sbirthyear", INT_LEN, "n", array("MAX_LENGTH_CHECK", "NUM_CHECK"));
$this->objFormParam->addParam("開始日", "search_sbirthmonth", INT_LEN, "n", array("MAX_LENGTH_CHECK", "NUM_CHECK"));
$this->objFormParam->addParam("開始日", "search_sbirthday", INT_LEN, "n", array("MAX_LENGTH_CHECK", "NUM_CHECK"));
$this->objFormParam->addParam("終了日", "search_ebirthyear", INT_LEN, "n", array("MAX_LENGTH_CHECK", "NUM_CHECK"));
$this->objFormParam->addParam("終了日", "search_ebirthmonth", INT_LEN, "n", array("MAX_LENGTH_CHECK", "NUM_CHECK"));
$this->objFormParam->addParam("終了日", "search_ebirthday", INT_LEN, "n", array("MAX_LENGTH_CHECK", "NUM_CHECK"));
$arrRet = $this->objFormParam->getHashArray();
$objErr->arrErr = $this->objFormParam->checkError();
$objErr->doFunc(array("注文番号1", "注文番号2", "search_order_id1", "search_order_id2"), array("GREATER_CHECK"));
$objErr->doFunc(array("年齢1", "年齢2", "search_age1", "search_age2"), array("GREATER_CHECK"));
$objErr->doFunc(array("購入金額1", "購入金額2", "search_total1", "search_total2"), array("GREATER_CHECK"));
$objErr->doFunc(array("開始日", "search_sorderyear", "search_sordermonth", "search_sorderday"), array("CHECK_DATE"));
$objErr->doFunc(array("終了日", "search_eorderyear", "search_eordermonth", "search_eorderday"), array("CHECK_DATE"));
$objErr->doFunc(array("開始日", "終了日", "search_sorderyear", "search_sordermonth", "search_sorderday", "search_eorderyear", "search_eordermonth", "search_eorderday"), array("CHECK_SET_TERM"));
$objErr->doFunc(array("開始日", "search_supdateyear", "search_supdatemonth", "search_supdateday"), array("CHECK_DATE"));
$objErr->doFunc(array("終了日", "search_eupdateyear", "search_eupdatemonth", "search_eupdateday"), array("CHECK_DATE"));
$objErr->doFunc(array("開始日", "終了日", "search_supdateyear", "search_supdatemonth", "search_supdateday", "search_eupdateyear", "search_eupdatemonth", "search_eupdateday"), array("CHECK_SET_TERM"));
$objErr->doFunc(array("開始日", "search_sbirthyear", "search_sbirthmonth", "search_sbirthday"), array("CHECK_DATE"));
$objErr->doFunc(array("終了日", "search_ebirthyear", "search_ebirthmonth", "search_ebirthday"), array("CHECK_DATE"));
$objErr->doFunc(array("開始日", "終了日", "search_sbirthyear", "search_sbirthmonth", "search_sbirthday", "search_ebirthyear", "search_ebirthmonth", "search_ebirthday"), array("CHECK_SET_TERM"));
Documentation generated on Fri, 24 Feb 2012 13:58:51 +0900 by Seasoft
|