SIM0202.php 1.79 KB
<?PHP 
//*****************************************************************************
//* プログラム名:入金コメント更新処理
//* プログラムID:SIM0202.php
//* 機能        :入金コメント更新処理
//*****************************************************************************
header("Content-type: text/html; charset=EUC-JP");
include("./inc/session_start.inc");
include("./inc/SessionChk.inc");
include("./inc/dbcon.inc");

$SIM_cboYaer = $_POST["SIM_cboYaer"];
$mm = $_POST["mm"];
$sMode = $_POST["sMode"];
$dSeq = $_POST["dSeq"];
$cSeq = $_POST["cSeq"];
$sComment = $_POST["comment"];


//収入コメント更新処理
//DELETE
$strSQL = "DELETE FROM comment_tbl WHERE ";
$strSQL .= "koumoku_seq = ".$cSeq." AND nyukin_year = ".$SIM_cboYaer." ";
$strSQL .= "AND nyukin_month = ".$mm." AND nyukin_mode = ".$sMode." "; 

$objRec = pg_exec($strSQL);
if($objRec==false){
	echo("SQL実行に失敗しました(DELETE)");
	exit;
}

//INSERT nyukin_mode 1:収入 2:支出 
$strSQL = "INSERT INTO comment_tbl (koumoku_seq, nyukin_year, nyukin_month, nyukin_mode, comment_text) ";
$strSQL .= "values(".$cSeq.", ".$SIM_cboYaer.", ".$mm.", ".$sMode.", '". $sComment ."')";
$objRec = pg_exec($strSQL);
if($objRec==false){
	echo("SQL実行に失敗しました(INSERT)");
	exit;
}


?>
<html>
<head>
<meta http-equiv="content-type" content="text/html; cahrset=euc-jp">
<meta http-equiv="content-style-type" content="text/css">
<meta name="robots" content="noindex, nofollow">
<title></title>
<script language="javascript">
function trans(){
	document.frm.action = "SIM0200.php";
	document.frm.method="POST";
	document.frm.submit();
}
</script>
</head>
<body onload="trans();">
<form name="frm">
<input type="hidden" name="sMode" value="<?PHP  echo $_POST["sMode"]?>">
<input type="hidden" name="SIM_cboYaer" value="<?PHP  echo $_POST["SIM_cboYaer"]?>">
</form>
</body>
</html>