RCV1910.php
3.5 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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
<?PHP
//*****************************************************************************
//* プログラム名:請求・入金管理
//* プログラムID:RCV1910.php
//* 機能 :請求新規登録
//*****************************************************************************
header("Content-type: text/html; charset=EUC-JP");
include("./inc/session_start.inc");
include("./inc/SessionChk.inc");
include("./inc/dbcon.inc");
$cboInpArea = (int)$_POST["cboInpArea"];
$cboInpGyousya = (int)$_POST["cboInpGyousya"];
$cboInpGyoumu = (int)$_POST["cboInpGyoumu"];
//$cboInpGyoumuKbn = (int)$_POST["cboInpGyoumuKbn"];
//モード 1:売上 2:外注
$uriageMode = (int)$_REQUEST["uriageMode"];
if(ereg("^[0-9]+$",$_POST["txtInpMoney"]) ){
$txtInpMoney = $_POST["txtInpMoney"];
}else{
$txtInpMoney = 0;
}
$txtInpSeikyu = $_POST["txtInpSeikyu"];
$txtInpKigen = $_POST["txtInpKigen"];
$txtInpNDate = $_POST["txtInpNDate"];
if(ereg("^[0-9]+$",$_POST["txtInpNMoney"]) ){
$txtInpNMoney = $_POST["txtInpNMoney"];
}else{
$txtInpNMoney = 0;
}
$txtInpMemo = $_POST["txtInpMemo"];
//新規
//seq設定
$strSQL = "SELECT * FROM rcv_tbl ORDER BY rcv_id DESC";
$objRec = pg_exec($strSQL);
if($objRec==false){
echo("SQL実行に失敗しました(SELECT)");
exit;
}
if(pg_numrows($objRec) > 0){
$objData = pg_fetch_object($objRec, 0);
$rcv_id = $objData->rcv_id + 1;
}else{
$rcv_id = 1;
}
//INSERT
$strSQL = "INSERT INTO rcv_tbl (";
$strSQL .= " rcv_id ,";
$strSQL .= " rcv_area_id ,";
$strSQL .= " rcv_gyousya_id ,";
$strSQL .= " rcv_gyoumu_id ,";
$strSQL .= " rcv_seikyukbn ,";
$strSQL .= " seikyu_money ,";
$strSQL .= " seikyu_kigen ,";
$strSQL .= " nyukin_money ,";
$strSQL .= " nyukin_date ,";
$strSQL .= " memo_txt ,";
$strSQL .= " inp_user ";
$strSQL .= " )values(";
$strSQL .= $rcv_id.",";
$strSQL .= $cboInpArea.",";
$strSQL .= $cboInpGyousya.",";
$strSQL .= $cboInpGyoumu.",";
//$strSQL .= $optSeikyukbn.",";
$strSQL .= $uriageMode.",";
$strSQL .= $txtInpMoney.",";
$strSQL .= "'".$txtInpKigen."',";
$strSQL .= $txtInpNMoney.",";
$strSQL .= "'".$txtInpNDate."',";
$strSQL .= "'".$txtInpMemo."',";
$strSQL .= $PHP_USER_SEQ."";
$strSQL .= ")";
$objRec = pg_exec($strSQL);
if($objRec==false){
echo("SQL実行に失敗しました(INSERT)");
exit;
}
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML>
<HEAD>
<META http-equiv="Content-Type" content="text/html; charset=EUC-JP">
<META http-equiv="Content-Style-Type" content="text/css">
<TITLE>請求・入金管理</TITLE>
<SCRIPT LANGUAGE="JAVASCRIPT">
<!--
function chk(){
document.frm.action="RCV1000.php";
document.frm.method="POST";
document.frm.submit();
return false;
}
-->
</SCRIPT></HEAD>
<BODY onLoad="return chk();">
<form name="frm">
<input name="Kijyun_Year" type="hidden" value="<?PHP echo $Kijyun_Year; ?>">
<input name="Kijyun_Month" type="hidden" value="<?PHP echo $Kijyun_Month; ?>">
<input name="cboMode" type="hidden" value="<?PHP echo $cboMode; ?>">
<input name="cboBunrui" type="hidden" value="<?PHP echo $cboBunrui; ?>">
<input name="cboGyoumu" type="hidden" value="<?PHP echo $cboGyoumu; ?>">
<input name="cboArea" type="hidden" value="<?PHP echo $cboArea; ?>">
<input name="uriageMode" type="hidden" value="<?PHP echo $uriageMode; ?>">
<!-- 資金繰り -->
<input name="SIM_cboYaer" type="hidden" value="<?PHP echo $SIM_cboYaer; ?>">
<input name="SIM_cboMon" type="hidden" value="<?PHP echo $SIM_cboMon; ?>">
<input name="SIM_cboKikan" type="hidden" value="<?PHP echo $SIM_cboKikan; ?>">
</form>
</BODY>
</HTML>