我现在已把页页都做好了,
但不知怎么把提过来的数添加到库里,
单个提好用,两条以上就不好用了,
代码是
<!--#include file="common.inc"-->
<%
self="inputzqgl.asp"
tabname="tab_2007_5"
TABCAP="辽河油田重点注汽锅炉运行情况表[数据录入]"
%>
<%if session("manager")<>1 then dw=session("dw")%>
<!--#include file="mouse1.asp"-->
<html>
<head>
<% if session("manager")=1 then
set OraSession=createobject("OracleInProcServer.XOraSession")
Set OraDatabase = OraSession.createdatabase(orahost,orauser&"/"&orapasswd,0)
Set OraDynaset = OraDatabase.CreateDynaset("select danwei from yonghu where manager<>'1' and include='1'",0)
dwstr=""
Do
dwstr=dwstr&" <OPTION value="""&OraDynaset(0)&""">"& mid(OraDynaset(0),2)&" </OPTION>"
OraDynaset.movenext
Loop until OraDynaset.eof
OraDynaset.close
OraDatabase.close
dwstr=dwstr&"</SELECT>"
end if
function dwoutput (stemp)
if session("manager")<>1 then
response.write mid(dw,2)& " <input type=""hidden"" name="""&stemp&"dw"" value="""&dw&""">"
else
response.write "<SELECT name="&stemp&"dw>"&dwstr
end if
end function
%>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta http-equiv="Expires" content="0">
<meta http-equiv="Pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<title><%=tabcap%></title>
<style>
<!--
td { font-size: 9pt ;text-align=center}
input { font-size: 9pt }
-->
</style>
</head><script language="javascript" src="menu.js"></script>
<body background="d_102702.gif" leftmargin=0>
<%
if Request.ServerVariables("request_method")="GET" then
%>
<SCRIPT LANGUAGE=vbscript>
<!--
sub message(str)
f1.t.value=str
end sub
sub check()
yn=msgbox("您真的想提交吗?",36,"提示")
If yn=6 Then
f1.submit
End If
end sub
-->
</SCRIPT>
<script language=javascript>
function jym(obj)
{
if (isNaN(obj.value))
{
alert("日期中含有非法字符!");
obj.focus();
obj.select();
}
else
{
str=obj.value;
str1=str.substring(0,4);
str2=str.substring(4,8);
//obj.value=str2;
if ((str1>9999) || (str1<1) || (str2<1) || (str2>12)||(str.length<8))
{
alert("日期不正确!")
obj.focus();
obj.select();
}
}
}
function jy(obj,f)
{
if (isNaN(obj.value))
{
alert("请输入数字!");
obj.focus();
obj.select();
}
else if (obj.value>f)
{
alert("输入数字超出范围!");
obj.focus();
obj.select();
}
}
function jz(obj)
{
if (isNaN(obj.value))
{
alert("请输入数字!");
obj.focus();
obj.select();
}
}
</script>
<Script Language="Javascript">
function AddRow()
{
//添加一行
var newTr = aaa1.insertRow();
//添加两列
var newTd0 = newTr.insertCell();
var newTd1 = newTr.insertCell();
var newTd2 = newTr.insertCell();
var newTd3 = newTr.insertCell();
var newTd4 = newTr.insertCell();
var newTd5 = newTr.insertCell();
var newTd6 = newTr.insertCell();
var newTd7 = newTr.insertCell();
var newTd8 = newTr.insertCell();
var newTd9 = newTr.insertCell();
var newTd10 = newTr.insertCell();
var newTd11 = newTr.insertCell();
var newTd12 = newTr.insertCell();
var newTd13 = newTr.insertCell();
var newTd14 = newTr.insertCell();
//设置列内容和属性
newTd0.innerHTML = '<input type="text" name="T21" size=10 maxlength=10 value="<%=mid(datestr(date),1,8)%>" style="font-size: 12px" >';
newTd1.innerHTML= '<td nowrap align="center" height="57" width="51"><%dwoutput("")%>';
newTd2.innerHTML=' <select name="select22"> <option value="燃料结构调整">燃料结构调整 <option value="勘探局及外部队伍服务">勘探局及外部队伍服务<option value="重点区块或重大试验项目">重点区块或重大试验项目';
newTd3.innerHTML=' <select name="select23"> <option value="齐40块蒸汽驱">齐40块蒸汽驱 <option value="杜84块SAGD">杜84块SAGD ';
newTd4.innerHTML='<td width="5%" nowrap><input type="text" name=<%=line%>T24 size="8" maxlength="8" value="0">';
newTd5.innerHTML='<select name="select25"> <option value="YZF50-17-P">YZF50-17-P <option value="YZF9-21-P">YZF9-21-P <option value="YZF20-17-P">YZF20-17-P <option value="YZF20-17-P">YZF20-17-P <option value="YZF20-17-P">YZF20-17-P <option value="YZF23-17-P">YZF23-17-P <option value="YZF11-21-P">YZF11-21-P <option value="SF-9.2/17.9-YQ">SF-9.2/17.9-YQ ';
newTd6.innerHTML='<select name="select26"><option value="油">油<option value="燃气">燃气 <option value="渣油">渣油<option value="混配油">混配油<option value="热煤气">热煤气<option value="水焦浆">水焦浆<option value="煤气">煤气 ';
newTd7.innerHTML='<td width="5%" nowrap><input type="text" name=<%=line%>T27 size="8" maxlength="8" value="0">';
newTd8.innerHTML='<td width="5%" nowrap><input type="text" name=<%=line%>T28 size="8" maxlength="8" value="0">';
newTd9.innerHTML='<td width="6%" nowrap><input type="text" name=<%=line%>T29 size="8" maxlength="8" value="0">';
newTd10.innerHTML='<td width="5%" nowrap><input type="text" name=<%=line%>T30 size="8" maxlength="8" value="0">';
newTd11.innerHTML='<td width="6%" nowrap><input type="text" name=<%=line%>T31 size="8" maxlength="8" value="0">';
newTd12.innerHTML='<td width="5%" nowrap><input type="text" name=<%=line%>T32 size="8" maxlength="8" value="0">';
newTd13.innerHTML='<td width="5%" nowrap><input type="text" name=<%=line%>T33 size="50">';}
function DelRow(iIndex)
{
//删除一行
if(iIndex==-99999)
alert("系统提示:没有选中行号!");
else
tab1.deleteRow(iIndex);
}
</script>
<form name="f1" action="<%=self%>" method="post">
<table width="105%" cellspacing="0" cellpadding="0">
<caption>
<h1><font face="隶书" color="#000000" size="6"><strong><center>辽河油田重点注汽锅炉运行情况表[数据录入]</center></strong></font></h1>
</caption>
<tr><td colspan="3">
<td align="center" width="30%"><input type="text" name="T" size="40" readonly style="text-align: center"></td><td align=center width="16%"></td>
<table id="aaa1" border="1" width="100%" cellspacing="0" bordercolordark=#FFFFFF bordercolorlight=#000000>
<tr>
<td width="6%" rowspan="2" align="center" nowrap bgcolor="#FFCC99"><font size="2">日 期</font></td>
<td width="9%" rowspan="2" align="center" nowrap bgcolor="#FFCC99"><font size="2">油 田</font></td>
<td width="11%" rowspan="2" align="center" nowrap bgcolor="#FFCC99"><font size="2">类别1</font></td>
<td width="5%" rowspan="2" align="center" nowrap bgcolor="#FFCC99"><font size="2">类别2</font></td>
<td width="5%" rowspan="2" align="center" nowrap bgcolor="#FFCC99"><font size="2">站号炉号</font></td>
<td width="5%" rowspan="2" align="center" nowrap bgcolor="#FFCC99"><font size="2">锅炉型号</font></td>
<td width="5%" rowspan="2" align="center" nowrap bgcolor="#FFCC99"><font size="2">燃料种类</font></td>
<td width="5%" rowspan="2" align="center" nowrap bgcolor="#FFCC99"><font size="2">燃料消耗量<br>(t)</font></td>
<td width="5%" rowspan="2" align="center" nowrap bgcolor="#FFCC99"><font size="2">期间注汽量<br>(t)</font></td>
<td width="5%" rowspan="2" align="center" nowrap bgcolor="#FFCC99"><font size="2">平均排量<br>(t/d)</font></td>
<td width="5%" rowspan="2" align="center" nowrap bgcolor="#FFCC99"><font size="2">平均干度<br>(%)</font></td>
<td width="5%" rowspan="2" align="center" nowrap bgcolor="#FFCC99"><font size="2">期间运行时间<br>(小时)</font></td>
<td width="5%" rowspan="2" align="center" nowrap bgcolor="#FFCC99"><font size="2">有效运行时率<br>(%)</font></td>
<td width="5%" rowspan="2" align="center" nowrap bgcolor="#FFCC99"><font size="2">备 注</font></td>
</tr>
<% rq=date-1
dw=session("dw")
%>
<% set OraSession=createobject("OracleInProcServer.XOraSession")
Set OraDatabase = OraSession.createdatabase(orahost,orauser&"/"&orapasswd,0)
Set OraDynaset3 = OraDatabase.CreateDynaset("select * from tab_2007_5 where dw='"&dw&"' and to_char(rq,'yyyymmdd')='" & datestr(rq) & "'" ,0)
'response.write("select * from tab_2007_5 where dw='" & dw1 & "' and rq='"&rq&"'") %>
<%if OraDynaset3.bof and OraDynaset3.eof then
OraDynaset3.close
OraDatabase3.close
else%>
<%do%>
<tr align=center>
<tr align=right>
<td nowrap align="center" height="57" width="45">
<input type="text" name="T0" size=10 maxlength=10 value="<%=mid(datestr(date),1,8)%>" style="font-size: 12px" ></td>
<td nowrap><%=mid(dw,2)%></td>
<td width="5%" nowrap><input type="text" name=<%=line%>T1 value="<%=OraDynaset3(2)%>"> </td>
<td width="5%" nowrap><input type="text" name=<%=line%>T2 size="12" value="<%=OraDynaset3(3)%>"> </td>
<td width="6%" nowrap><input type="text" name=<%=line%>T3 size="12" value="<%=OraDynaset3(4)%>" > </td>
<td width="5%" nowrap><input type="text" name=<%=line%>T4 size="12" value="<%=OraDynaset3(5)%>" onFocus="message('数字型字段,99999.99')" οnblur="javascript:jy(this,99999.9999)"> </td>
<td width="6%" nowrap><input type="text" name=<%=line%>T5 size="8" value="<%=OraDynaset3(6)%>" onFocus="message('数字型字段,99999.99')" οnblur="javascript:jy(this,99999.9999)"> </td>
<td width="5%" nowrap><input type="text" name=<%=line%>T6 size="8" value="<%=OraDynaset3(7)%>" onFocus="message('数字型字段,99999.99')" οnblur="javascript:jy(this,99999.9999)"> </td>
<td width="5%" nowrap><input type="text" name=<%=line%>T7 size="8" value="<%=OraDynaset3(8)%>" onFocus="message('数字型字段,99999.99')" οnblur="javascript:jy(this,99999.9999)"> </td>
<td width="6%" nowrap><input type="text" name=<%=line%>T8 size="8" value="<%=OraDynaset3(9)%>" onFocus="message('数字型字段,99999.99')" οnblur="javascript:jy(this,99999.9999)"> </td>
<td width="5%" nowrap><input type="text" name=<%=line%>T9 size="8" value="<%=OraDynaset3(10)%>" onFocus="message('数字型字段,99999.99')" οnblur="javascript:jy(this,99999.9999)"> </td>
<td width="6%" nowrap><input type="text" name=<%=line%>T10 size="8" value="<%=OraDynaset3(11)%>" onFocus="message('数字型字段,99999.99')" οnblur="javascript:jy(this,99999.9999)"> </td>
<td width="5%" nowrap><input type="text" name=<%=line%>T11 size="8" value="<%=OraDynaset3(12)%>" onFocus="message('数字型字段,99999.99')" οnblur="javascript:jy(this,99999.9999)"> </td>
<td width="5%" nowrap><input type="text" name=<%=line%>T12 size="50" value="<%=OraDynaset3(13)%>"> </td>
<%
OraDynaset3.movenext
loop until OraDynaset3.eof
OraDynaset3.close
end if%>
</tr>
</table>
</td>
</tr>
<tr><center>
<td colspan=3 align="center"><br><input type="button" value="提 交" ONCLICK="check()"> <input type="reset" value="复 原">
<input name="button" type="button" onClick="AddRow()" value="继续添加"></td>
</center>
</tr>
</table>
</form>
<%elseif Request.ServerVariables("request_method")="POST" then%>
<%
dim t(30)
for j=1 to 30
t(j)=null
next
ga=request("T0")
t(1)=cdate(mid(ga,1,4) & "-" & mid(ga,5,2) & "-" & mid(ga,7,2))
response.Write(t(1))
t(2)=cstr(session("dw"))
response.Write(t(2))
t(3)=request("T1")
t(4)=request("T2")
t(5)=request("T3")
t(6)=request("T4")
t(7)=request("T5")
t(8)=request("T6")
t(9)=request("T7")
t(10)=request("T8")
t(11)=request("T9")
t(12)=request("T10")
t(13)=request("T11")
t(14)=request("T12")
rq=cdate(year(t(1)) & "-" & month(t(1)) & "-" & day(t(1)))
'rq1=dateadd("m",1,rq)
set OraSession=createobject("OracleInProcServer.XOraSession")
Set OraDatabase = OraSession.createdatabase(orahost,orauser&"/"&orapasswd,0)
'Set OraDynaset = OraDatabase.CreateDynaset("select * from "&tabname&" where dw='" & t(2) & "' and to_char(rq,'yyyymmdd')='" & datestr(rq) &"' and LB1='" & t(3) & "' and LB1='" & t(4) & "' and ZHLH='" & t(5) & "' and GLXH='" & t(6) & "' and RLZL='" & t(7) & "' and ZQL='" & t(8) & "' and PJPL='" & t(9) & "' and PJGD='" & t(10) & "' and YXXS='" & t(11) & "'",0)
response.write("select * from "&tabname&" where dw='" & t(2) & "' and to_char(rq,'yyyymmdd')='" & datestr(rq) &"' and LB1='" & t(3) & "' and LB1='" & t(4) & "' and ZHLH='" & t(5) & "' and GLXH='" & t(6) & "' and RLZL='" & t(7) & "' and ZQL='" & t(8) & "' and PJPL='" & t(9) & "' and PJGD='" & t(10) & "' and YXXS='" & t(11) & "'")
if OraDynaset.bof and OraDynaset.eof then
OraDynaset.dbaddnew
for j=1 to 14
OraDynaset.fields(j-1).value=t(j)
next
OraDynaset.dbupdate
%>
<p align="center"><strong><font face="宋体" size="4" color="#FF0000">提交成功!</font></strong></p>
<%else%>
<p align="center"><strong><font face="宋体" size="4" color="#FF0000">提交不成功,数据已经存在!</font></strong></p>
<%end if
%>
<%
OraDynaset.close
OraDatabase.close
%>
<%end if%>
<font size="2"> </font><a href="jsnblr.asp" target="_top"><font size="2"></font></a><font size="2">
</font>
</body>
</html>