CON147.php 1.34 KB
<?php 
//*****************************************************************************
//* 
//* プログラム名:カテゴリDB設定処理
//* プログラムID:CON147
//* 機能        :カテゴリをDB設定する
//* 作成者      :
//* 
//*****************************************************************************

header("Content-type: text/html; charset=EUC-JP");
include("include/session_start.inc");
include("include/SessionChk.inc");
include("include/dbcon.inc");
$bumon_name = addslashes($bumon_name);
	//新規登録
	if ($syozoku_cd=="") {
		//$strSql = "SELECT MAX(syozoku_cd) as a,MAX(disp_rank) as b FROM mst_bumon Where del_flg=0 ";

		$strSql = "SELECT MAX(ctg_seq) as a FROM mst_prj_category";
		$rsResult = pg_exec($pg_con,$strSql);
		$intSyozokuNextValue = pg_result($rsResult,0,"a") + 1;

		$strSql = "SELECT MAX(disp_rank) as b FROM mst_prj_category";
		$rsResult = pg_exec($pg_con,$strSql);
		$intRankNextValue = pg_result($rsResult,0,"b") + 1;

		$strSql = "INSERT INTO mst_prj_category (ctg_seq, ctg_name, disp_rank) VALUES(";
		$strSql = $strSql . "$intSyozokuNextValue,'$bumon_name',$intRankNextValue)";

		$rsResult = pg_exec($pg_con,$strSql);

	//修正
	}else{
		$strSql = "UPDATE mst_prj_category SET ";
		$strSql .= "ctg_name='$bumon_name' ";
		$strSql .= "WHERE ctg_seq = $syozoku_cd";

		$rsResult = pg_exec($pg_con,$strSql);

	}

header("Location: CON140.php");

?>