Source for file LC_Page_Admin_Basis_Holiday.php
Documentation is available at LC_Page_Admin_Basis_Holiday.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");
* @author LOCKON CO.,LTD.
* @version $Id: LC_Page_Admin_Basis_Holiday.php 16741 2007-11-08 00:43:24Z adachi $
$this->tpl_subnavi = 'basis/subnavi.tpl';
$this->tpl_subno = 'holiday';
$this->tpl_subtitle = '定休日登録';
$objDb = new SC_Helper_DB_Ex();
$this->arrMonth = $objDate->getMonth();
$this->arrDay = $objDate->getDay();
SC_Utils_Ex::sfIsSuccess($objSess);
if (!isset ($_POST['mode'])) $_POST['mode'] = "";
if(count($this->arrErr) <= 0) {
if($_POST['holiday_id'] == "") {
$this->tpl_holiday_id = $_POST['holiday_id'];
$objDb->sfDeleteRankRecord("dtb_holiday", "holiday_id", $_POST['holiday_id'], "", true);
$where = "holiday_id = ?";
$arrRet = $objQuery->select("title, month, day", "dtb_holiday", $where, array($_POST['holiday_id']));
$this->arrForm['title'] = $arrRet[0]['title'];
$this->arrForm['month'] = $arrRet[0]['month'];
$this->arrForm['day'] = $arrRet[0]['day'];
$this->tpl_holiday_id = $_POST['holiday_id'];
$objDb->sfRankDown("dtb_holiday", "holiday_id", $_POST['holiday_id']);
$objDb->sfRankUp("dtb_holiday", "holiday_id", $_POST['holiday_id']);
$objQuery->setOrder("rank DESC");
$this->arrHoliday = $objQuery->select("holiday_id, title, month, day", "dtb_holiday", $where);
$objView->assignobj($this);
$objView->display(MAIN_FRAME);
$sqlval['title'] = $arrData['title'];
$sqlval['month'] = $arrData['month'];
$sqlval['day'] = $arrData['day'];
$sqlval['creator_id'] = $_SESSION['member_id'];
$sqlval['rank'] = $objQuery->max("dtb_holiday", "rank") + 1;
$sqlval['update_date'] = "Now()";
$sqlval['create_date'] = "Now()";
$ret = $objQuery->insert("dtb_holiday", $sqlval);
$sqlval['title'] = $arrData['title'];
$sqlval['month'] = $arrData['month'];
$sqlval['day'] = $arrData['day'];
$sqlval['update_date'] = "Now()";
$where = "holiday_id = ?";
$ret = $objQuery->update("dtb_holiday", $sqlval, $where, array($_POST['holiday_id']));
$arrConvList['title'] = "KVa";
$arrConvList['month'] = "n";
$arrConvList['day'] = "n";
foreach ($arrConvList as $key => $val) {
if(isset ($array[$key])) {
$array[$key] = mb_convert_kana($array[$key] ,$val);
$objErr->doFunc(array("タイトル", "title", SMTEXT_LEN), array("EXIST_CHECK","SPTAB_CHECK","MAX_LENGTH_CHECK"));
$objErr->doFunc(array("月", "month", INT_LEN), array("SELECT_CHECK","SPTAB_CHECK","MAX_LENGTH_CHECK"));
$objErr->doFunc(array("日", "day", INT_LEN), array("SELECT_CHECK","SPTAB_CHECK","MAX_LENGTH_CHECK"));
if(!isset ($objErr->arrErr['date'])) {
$where = "del_flg = 0 AND month = ? AND day = ?";
$arrval = array($_POST['month'], $_POST['day']);
if (!empty($_POST['holiday_id'])) {
$where .= " AND holiday_id <> ?";
$arrval[] = $_POST['holiday_id'];
$arrRet = $objQuery->select("count(holiday_id)", "dtb_holiday", $where, $arrval);
// 編集中のレコード以外に同じ日付が存在する場合
if ($arrRet[0]['count'] > 0) {
$objErr->arrErr['date'] = "※ 既に同じ日付の登録が存在します。<br>";
Documentation generated on Fri, 24 Feb 2012 13:58:27 +0900 by Seasoft
|