SIM0221.php
2.46 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
<?PHP
//*****************************************************************************
//* プログラム名:入金コメント更新処理
//* プログラムID:SIM0221.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 = htmlspecialchars($_POST["comment"], ENT_QUOTES );
//収入コメント削除処理
//DELETE nyukin_mode 1:収入 2:支出
$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;
}
if (Trim($sComment) != "") {
//収入コメント登録処理
//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(){
var strUrl = "";
var ret = 0;
// objParent = window.opener;
// objParent.name = "parentWin";
// strUrl = objParent.document.URL;
// ret = strUrl.indexOf("SIM0210.php");
// if (ret > 0) {
// objParent.document.frm.target = "parentWin";
// objParent.document.frm.action = "SIM0210.php";
// objParent.document.frm.method = "POST";
// objParent.document.frm.submit();
// }
self.close();
}
</script>
</head>
<body onload="trans();">
<form name="frmsub">
<input type="hidden" name="sMode" value="<?PHP echo $_POST["sMode"] ?>">
<input type="hidden" name="SIM_cboYaer" value="<?PHP echo $_POST["SIM_cboYaer"] ?>">
<input type="hidden" name="bSeq" value="<?PHP echo $_POST["bSeq"] ?>">
<input type="hidden" name="dSeq" value="<?PHP echo $_POST["dSeq"] ?>">
<input type="hidden" name="cSeq" value="<?PHP echo $_POST["cSeq"] ?>">
</form>
</body>
</html>