CON010_1_1.php 1.26 KB
<?php 
//*****************************************************************************
//* 
//* プログラム名:業務報告・指示カテゴリ情報DB設定処理
//* プログラムID:CON010_1_1
//* 機能        :業務報告・指示カテゴリ情報をDB設定する
//* 作成者      :
//* 
//*****************************************************************************

header("Content-type: text/html; charset=EUC-JP");
include("include/session_start.inc");
include("include/SessionChk.inc");
include("include/dbcon.inc");

$category_name = addslashes($_POST["category_name"]);

//新規登録
if ($_POST["category_no"]=="") {
	$strSql = "SELECT MAX(category_no) as a,MAX(disp_rank) as b FROM mst_metcategory";
	$rsResult = pg_exec($pg_con,$strSql);
	$intCategoryNextValue = pg_result($rsResult,0,"a") + 1;
	$intRankNextValue = pg_result($rsResult,0,"b") + 1;
	$strSql = "INSERT INTO mst_metcategory VALUES(";
	$strSql = $strSql."$intCategoryNextValue,'$category_name','".date("Y/m/d")."',$intRankNextValue)";
	$rsResult = pg_exec($pg_con,$strSql);
//修正
}else{
	$strSql = "UPDATE mst_metcategory SET ";
	$strSql .= "category_name='$category_name',category_date = '".date("Y/m/d")."'";
	$strSql .= "WHERE category_no = ".$_POST["category_no"];
	$rsResult = pg_exec($pg_con,$strSql);
}

header("Location: CON010.php");

?>