📄 hs~write_putout_table.asp
字号:
<%response.expires=0%>
<!--#include file="../asp/sqlstr.asp"-->
<%
'session.abandon
'Server.ScriptTimeOut=500
function opendb(DBPath,sessionname,dbsort)
dim conn
'if not isobject(session(sessionname)) then
Set conn=Server.CreateObject("ADODB.Connection")
'if dbsort="accessdsn" then conn.Open "DSN=" & DBPath
'if dbsort="access" then conn.Open "driver={Microsoft Access Driver (*.mdb)};dbq=" & DBPath
'if dbsort="sqlserver" then conn.Open "DSN=" & DBPath & ";uid=wsw;pwd=wsw"
DBPath1=server.mappath("../db/jzud-oa.asa")
conn.Open "driver={Microsoft Access Driver (*.mdb)};dbq=" & DBPath1
set session(sessionname)=conn
'end if
set opendb=session(sessionname)
end function
%>
<!--#include file="../asp/bgsub.asp"-->
<%
oabusyname=request.cookies("oabusyname")
oabusyusername=request.cookies("oabusyusername")
oabusyuserid=request.cookies("oabusyuserid")
oabusyuserdept=request.cookies("oabusyuserdept")
oabusyuserlevel=request.cookies("oabusyuserlevel")
if oabusyusername="" or oabusyuserid="" then
response.write("<script language=""javascript"">")
response.write("window.top.location.href='default.asp';")
response.write("</script>")
response.end
end if
on error resume next
set conn=opendb("oabusy","conn","accessdsn")
conn.begintrans
set rs=server.createobject("adodb.recordset")
sql="select * from workthings_type"
rs.open sql,conn,1
if rs.eof and rs.bof then
set rs=nothing
conn.close
set conn=nothing
response.redirect "../asp/disperrorinfo.asp?errorinfo=没有办公用品,请先增加办公用品!"
response.end
end if
if request.form("ok")=" 提交 " then
d1=request.form("D1")
t1=trim(request.form("T1"))
d2=request.form("D2")
t2=trim(request.form("T2"))
d3=request.form("D3")
t3=trim(request.form("T3"))
d4=request.form("D4")
t4=trim(request.form("T4"))
d5=request.form("D5")
t5=trim(request.form("T5"))
if d1<>"0|no" or d2<>"0|no" or d3<>"0|no" or d4<>"0|no" or d5<>"0|no" then
dim sql,sql1,sql2,sql3,sql4,sql5
sql1=""
sql2=""
sql3=""
sql4=""
sql5=""
nowtime=cstr(date())&" "&cstr(time())
if instr(d1&d2&d3&d4&d5,"yes")>0 then
auditingflag="true"
else
auditingflag="false"
end if
sql="insert into workthings_use (writeuserid,putouttime,auditingflag) values("&oabusyuserid&",#"&nowtime&"#,"&auditingflag&")"
conn.execute(sql)
set rs1=server.createobject("adodb.recordset")
rs1.open "select autoid from workthings_use where putouttime=#"&nowtime&"#",conn,1
autoid=rs1("autoid")
strvalue1=left(d1,instr(d1,"|")-1)
response.write(strvalue1)
if strvalue1<>"0" then
sql1="insert into workthings_userthings (recordid,workthingsid,putoutnumber) values("&autoid&","&strvalue1&","&t1&")"
end if
strvalue1=left(d2,instr(d2,"|")-1)
response.write(strvalue1)
if strvalue1<>"0" then
sql2="insert into workthings_userthings (recordid,workthingsid,putoutnumber) values("&autoid&","&strvalue1&","&t2&")"
end if
strvalue1=left(d3,instr(d3,"|")-1)
response.write(strvalue1)
if strvalue1<>"0" then
sql3="insert into workthings_userthings (recordid,workthingsid,putoutnumber) values("&autoid&","&strvalue1&","&t3&")"
end if
strvalue1=left(d4,instr(d4,"|")-1)
response.write(strvalue1)
if strvalue1<>"0" then
sql4="insert into workthings_userthings (recordid,workthingsid,putoutnumber) values("&autoid&","&strvalue1&","&t4&")"
end if
strvalue1=left(d5,instr(d5,"|")-1)
response.write(strvalue1)
if strvalue1<>"0" then
sql5="insert into workthings_userthings (recordid,workthingsid,putoutnumber) values("&autoid&","&strvalue1&","&t5&")"
end if
if sql1<>"" then
conn.execute(sql1)
end if
if sql2<>"" then
conn.execute(sql2)
end if
if sql3<>"" then
conn.execute(sql3)
end if
if sql4<>"" then
conn.execute(sql4)
end if
if sql5<>"" then
conn.execute(sql5)
end if
if err.number<>0 then
conn.rollbacktrans
conn.close
response.redirect "../asp/disperrorinfo.asp?errorinfo=对不起,提交办公用品领用表出错!"
response.end
else
conn.committrans
conn.close
response.redirect "../asp/dispsucceedinfo.asp?succeedinfo=成功提交办公用品领用表,请等待回复!"
response.end
end if
else
conn.close
response.redirect "../asp/disperrorinfo.asp?errorinfo=请至少选择一件办公用品!"
response.end
end if
end if
%>
<html>
<head>
<meta http-equiv="Content-Language" content="zh-cn">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>领取办公用品</title>
<link rel="stylesheet" type="text/css" href="../css/css.css">
<script language="vbscript">
sub checkkey()
if window.event.keyCode >57 or window.event.keyCode <48 then
if window.event.keyCode <>46 then
window.event.keyCode=0
end if
end if
end sub
</script>
</head>
<body topmargin="5" leftmargin="5">
<%
%>
<center>
<table align="center">
<tr>
<td><b>领用办公用品</b></td>
</tr>
</table>
</center>
<%
%>
<br>
<p align="center" style="margin-bottom: 0"><b><font color="#FF0000" size="3">办公用品领用表</font></b></p>
<div align="center">
<center>
<table border="0" cellpadding="0" cellspacing="0" width="500">
<tr>
<td>
<hr color="#FF0000" width="50%">
</td>
</tr>
</table>
</center>
</div>
<form method="POST" action="write_putout_table.asp">
<div align="center">
<table border="0" cellpadding="0" cellspacing="0" width="500">
<tr>
<td>
<p align="center">领取人:<%=oabusyname%>
部门:<%=oabusyuserdept%>
时间:<%=cstr(date())&" "&cstr(time())%></td>
</tr>
</table>
</div>
<div align="center">
<center>
<table border="1" cellpadding="5" cellspacing="0" width="80%" bordercolorlight="#808080" bordercolordark="#D4D0C8">
<tr>
<td height="25" width="50" align="center" bgcolor="#D4D0C8">编号</td>
<td height="25" width="334" align="center" bgcolor="#D4D0C8">办公用品名称</td>
<td height="25" width="108" align="center" bgcolor="#D4D0C8">领取数量</td>
</tr>
<tr>
<td height="25" width="50" align="center">1</td>
<td height="25" width="334" align="center"><select size="1" name="D1">
<option value="0|no" selected>请选择</option>
<%
rs.movefirst
do while not rs.eof
if rs("auditingflag") then
response.write("<option value="&cstr(rs("autoid"))&"|yes"&">"&rs("workthingsname")&"</option>")
else
response.write("<option value="&cstr(rs("autoid"))&"|no"&">"&rs("workthingsname")&"</option>")
end if
rs.movenext
loop
%>
</select></td>
<td height="25" width="108" align="center"><input type="text" name="T1" size="12" onkeypress="checkkey()" maxlength="2" value="1"></td>
</tr>
<tr>
<td height="25" width="50" align="center">2</td>
<td height="25" width="334" align="center"><select size="1" name="D2">
<option value="0|no" selected>请选择</option>
<%
rs.movefirst
do while not rs.eof
if rs("auditingflag") then
response.write("<option value="&cstr(rs("autoid"))&"|yes"&">"&rs("workthingsname")&"</option>")
else
response.write("<option value="&cstr(rs("autoid"))&"|no"&">"&rs("workthingsname")&"</option>")
end if
rs.movenext
loop
%>
</select></td>
<td height="25" width="108" align="center"><input type="text" name="T2" size="12" onkeypress="checkkey()" maxlength="2" value="1"></td>
</tr>
<tr>
<td height="25" width="50" align="center">3</td>
<td height="25" width="334" align="center"><select size="1" name="D3">
<option value="0|no" selected>请选择</option>
<%
rs.movefirst
do while not rs.eof
if rs("auditingflag") then
response.write("<option value="&cstr(rs("autoid"))&"|yes"&">"&rs("workthingsname")&"</option>")
else
response.write("<option value="&cstr(rs("autoid"))&"|no"&">"&rs("workthingsname")&"</option>")
end if
rs.movenext
loop
%>
</select></td>
<td height="25" width="108" align="center"><input type="text" name="T3" size="12" onkeypress="checkkey()" maxlength="2" value="1"></td>
</tr>
<tr>
<td height="25" width="50" align="center">4</td>
<td height="25" width="334" align="center"><select size="1" name="D4">
<option value="0|no" selected>请选择</option>
<%
rs.movefirst
do while not rs.eof
if rs("auditingflag") then
response.write("<option value="&cstr(rs("autoid"))&"|yes"&">"&rs("workthingsname")&"</option>")
else
response.write("<option value="&cstr(rs("autoid"))&"|no"&">"&rs("workthingsname")&"</option>")
end if
rs.movenext
loop
%>
</select></td>
<td height="25" width="108" align="center"><input type="text" name="T4" size="12" onkeypress="checkkey()" maxlength="2" value="1"></td>
</tr>
<tr>
<td height="25" width="50" align="center">5</td>
<td height="25" width="334" align="center"><select size="1" name="D5">
<option value="0|no" selected>请选择</option>
<%
rs.movefirst
do while not rs.eof
if rs("auditingflag") then
response.write("<option value="&cstr(rs("autoid"))&"|yes"&">"&rs("workthingsname")&"</option>")
else
response.write("<option value="&cstr(rs("autoid"))&"|no"&">"&rs("workthingsname")&"</option>")
end if
rs.movenext
loop
%>
</select></td>
<td height="25" width="108" align="center"><input type="text" name="T5" size="12" onkeypress="checkkey()" maxlength="2" value="1"></td>
</tr>
</table>
</center>
</div>
<p align="center"><input type="submit" value=" 提交 " name="ok">
<input type="reset" value=" 重填 " name="reset"></p>
</form>
<%
conn.close
set rs=nothing
set conn=nothing
%>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -