Source for file LC_Page_Admin_Basis_Kiyaku.php
Documentation is available at LC_Page_Admin_Basis_Kiyaku.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_Kiyaku.php 18735 2010-06-22 08:53:31Z nanasess $
$this->tpl_subnavi = 'basis/subnavi.tpl';
$this->tpl_subno = 'kiyaku';
$this->tpl_subtitle = '会員規約登録';
$objDb = new SC_Helper_DB_Ex();
SC_Utils_Ex::sfIsSuccess($objSess);
if (!isset ($_POST['mode'])) $_POST['mode'] = "";
if(count($this->arrErr) <= 0) {
if($_POST['kiyaku_id'] == "") {
$this->tpl_kiyaku_id = $_POST['kiyaku_id'];
$objDb->sfDeleteRankRecord("dtb_kiyaku", "kiyaku_id", $_POST['kiyaku_id'], "", true);
$where = "kiyaku_id = ?";
$arrRet = $objQuery->select("kiyaku_text, kiyaku_title", "dtb_kiyaku", $where, array($_POST['kiyaku_id']));
$this->arrForm['kiyaku_title'] = $arrRet[0]['kiyaku_title'];
$this->arrForm['kiyaku_text'] = $arrRet[0]['kiyaku_text'];
$this->tpl_kiyaku_id = $_POST['kiyaku_id'];
$objDb->sfRankDown("dtb_kiyaku", "kiyaku_id", $_POST['kiyaku_id']);
$objDb->sfRankUp("dtb_kiyaku", "kiyaku_id", $_POST['kiyaku_id']);
$objQuery->setOrder("rank DESC");
$this->arrKiyaku = $objQuery->select("kiyaku_title, kiyaku_text, kiyaku_id", "dtb_kiyaku", $where);
$objView->assignobj($this);
$objView->display(MAIN_FRAME);
$sqlval['kiyaku_title'] = $arrData['kiyaku_title'];
$sqlval['kiyaku_text'] = $arrData['kiyaku_text'];
$sqlval['creator_id'] = $_SESSION['member_id'];
$sqlval['rank'] = $objQuery->max("dtb_kiyaku", "rank") + 1;
$sqlval['update_date'] = "Now()";
$sqlval['create_date'] = "Now()";
$ret = $objQuery->insert("dtb_kiyaku", $sqlval);
$sqlval['kiyaku_title'] = $arrData['kiyaku_title'];
$sqlval['kiyaku_text'] = $arrData['kiyaku_text'];
$sqlval['update_date'] = "Now()";
$where = "kiyaku_id = ?";
$ret = $objQuery->update("dtb_kiyaku", $sqlval, $where, array($_POST['kiyaku_id']));
$arrConvList['kiyaku_title'] = "KVa";
$arrConvList['kiyaku_text'] = "KVa";
foreach ($arrConvList as $key => $val) {
if(isset ($array[$key])) {
$array[$key] = mb_convert_kana($array[$key] ,$val);
$objErr->doFunc(array("規約タイトル", "kiyaku_title", SMTEXT_LEN), array("EXIST_CHECK","SPTAB_CHECK","MAX_LENGTH_CHECK"));
$objErr->doFunc(array("規約内容", "kiyaku_text", MLTEXT_LEN), array("EXIST_CHECK","SPTAB_CHECK","MAX_LENGTH_CHECK"));
if(!isset ($objErr->arrErr['name'])) {
$arrRet = $objQuery->select("kiyaku_id, kiyaku_title", "dtb_kiyaku", "del_flg = 0 AND kiyaku_title = ?", array($_POST['kiyaku_title']));
// 編集中のレコード以外に同じ名称が存在する場合
if ($arrRet[0]['kiyaku_id'] != $_POST['kiyaku_id'] && $arrRet[0]['kiyaku_title'] == $_POST['kiyaku_title']) {
$objErr->arrErr['name'] = "※ 既に同じ内容の登録が存在します。<br>";
Documentation generated on Fri, 24 Feb 2012 13:58:27 +0900 by Seasoft
|