RCV1910.php 3.5 KB
<?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>