CON162_1_1.php 1.49 KB
<?php 
//*****************************************************************************
//* 
//* プログラム名:簡易在席情報DB設定処理
//* プログラムID:CON162_1_1
//* 機能        :簡易在席情報をDB設定する
//* 作成者      :
//* 
//*****************************************************************************
header("Content-type: text/html; charset=EUC-JP");

//*****************************************************************************
//* インクルードファイル
//*****************************************************************************
include("include/session_start.inc");								//セッション開始
include("include/SessionChk.inc");									//セッションチェック
include("include/dbcon.inc");												//DB接続

//新規登録
if ($_POST["seq"] =="") {
	$strSql = "SELECT MAX(seq) as a FROM mst_common_word Where type = 1";
	$rsResult = pg_exec($pg_con,$strSql);
	$intToubanNextValue = pg_result($rsResult,0,"a") + 1;
	$strSql = "INSERT INTO mst_common_word VALUES(";
	$strSql .= "1,'$intToubanNextValue','".addslashes($_POST["zaiseki_name"])."','$zaiseki_collar')";
	$rsResult = pg_exec($pg_con,$strSql);
//修正
}else{
	$strSql = "UPDATE mst_common_word SET ";
	$strSql .= "memo1='".addslashes($_POST["zaiseki_name"])."', ";
	$strSql .= "memo2='$zaiseki_collar' ";
	$strSql .= "WHERE type = 1 ";
	$strSql .= "AND seq =".$_POST["seq"] ;
	$rsResult = pg_exec($pg_con,$strSql);


	if($rsResult==false){
		echo("SQL実行に失敗しました(SELECT)");
		echo "<br>".$strSql."<br>";
		exit;
	}

}
header("Location: CON160.php");
?>