CON012_1_1.php 1.09 KB
<?php 
//*****************************************************************************
//* 
//* プログラム名:部門情報DB設定処理
//* プログラムID:CON003_1_1
//* 機能        :部門情報をDB設定する
//* 作成者      :石田 英治
//* 
//*****************************************************************************

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

	//新規登録
	if ($siryo_cd=="") {
		$strSql = "SELECT MAX(ctg_no) as a,MAX(disp_rank) as b FROM mst_siryo";
		$rsResult = pg_exec($pg_con,$strSql);
		$intSiryoNextValue = pg_result($rsResult,0,"a") + 1;
		$intRankNextValue = pg_result($rsResult,0,"b") + 1;
		$strSql = "INSERT INTO mst_siryo VALUES(";
		$strSql = $strSql."'$intSiryoNextValue','$siryo_name',$intRankNextValue)";
		$rsResult = pg_exec($pg_con,$strSql);

	//修正
	}else{
		$strSql = "UPDATE mst_siryo SET ";
		$strSql .= "ctg_name='$siryo_name' ";
		$strSql .= "WHERE ctg_no = $siryo_cd";
		$rsResult = pg_exec($pg_con,$strSql);
	}
//	echo $strSql;

header("Location: CON012.php");

?>