📄 workthings_stat_user_print.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/checked.asp"-->
<!--#include file="setpopedom.asp"-->
<%
oabusyname=request.cookies("oabusyname")
oabusyusername=request.cookies("oabusyusername")
oabusyuserdept=request.cookies("oabusyuserdept")
oabusyuserlevel=request.cookies("oabusyuserlevel")
if oabusyusername="" then
response.write("<script language=""javascript"">")
response.write("alert(""对不起,您已经过期,请重新登录!"");")
response.wirte("window.close();")
response.write("</script>")
response.end
end if
set conn=opendb("oabusy","conn","accessdsn")
set rs1=server.createobject("adodb.recordset")
sql="select * from workthings_type"
rs1.open sql,conn,1
if rs1.eof and rs1.bof then
set rs1=nothing
conn.close
set conn=nothing
response.redirect "../asp/disperrorinfo.asp?errorinfo=没有办公用品,请先增加办公用品!"
response.end
end if
%>
<html>
<head>
<meta http-equiv="Content-Language" content="zh-cn">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta http-equiv="expires" content="no-cache">
<title>办公用品使用统计</title>
<link rel="stylesheet" type="text/css" href="../css/css.css">
</head>
<body topmargin="5" leftmargin="5">
<div align="center">
<%
yearvalue=request("yearvalue")
monthvalue=request("monthvalue")
userdept=request("userdept")
username=request("username")
set conn=opendb("oabusy","conn","accessdsn")
set rs3=server.createobject("adodb.recordset")
sql="select DISTINCT username,name from userinf where userdept='"&userdept&"' and username='"&username&"'"
rs3.open sql,conn,1
while not rs3.eof and not rs3.bof
if rs3("username")=username then
namevalue=rs3("name")
end if
rs3.movenext
wend
set rs3=nothing
%>
<center>
<br><br>
<b><font size="+1">办公用品使用统计表</font></b><p>
用户名:<%=namevalue%> 部门:<%=userdept%> 时间:<%=yearvalue&"年"&monthvalue&"月"%>
</center>
<p>
<table border="1" width="80%" cellpadding="5" cellspacing="0" bordercolorlight="#808080" bordercolordark="#D4D0C8">
<tr>
<td height="25" bgcolor="#D4D0C8" align="center" width="58">编号</td>
<td height="25" bgcolor="#D4D0C8" align="center" width="201">办公用品名称</td>
<td height="25" bgcolor="#D4D0C8" align="center" width="116">申请发放数量</td>
<td height="25" bgcolor="#D4D0C8" align="center" width="115">实际发放数量</td>
</tr>
<%
recordsums=1
do while not rs1.eof
set rs=server.createobject("adodb.recordset")
sql3="select sum(workthings_userthings.putoutnumber) as putoutsums,sum(workthings_userthings.putoutfactnumber) as putoutfactsums from workthings_userthings,userinf,workthings_use where workthings_use.writeuserid=userinf.ID and userinf.userdept='"&userdept&"' and workthings_userthings.recordid=workthings_use.autoid and workthings_userthings.workthingsid="&cstr(rs1("autoid"))&" and workthings_use.putoutusername<>'' and year(workthings_use.writetabletime)="&yearvalue&" and month(workthings_use.writetabletime)="&monthvalue&" and userinf.username='"&username&"'"
rs.open sql3,conn,1
%>
<tr bgcolor="#ffffff">
<td height="25" align="center" width="58"><%=cstr(recordsums)%></td>
<td height="25" align="center" width="201"><%=rs1("workthingsname")%></td>
<td height="25" align="center" width="116">
<%
if isnull(rs("putoutsums")) then
response.write("0")
else
response.write(rs("putoutsums"))
end if
%>
</td>
<td height="25" align="center" width="115">
<%
if isnull(rs("putoutfactsums")) then
response.write("0")
else
response.write(rs("putoutfactsums"))
end if
%>
</td>
</tr>
<%
rs1.movenext
recordsums=recordsums+1
loop
set rs1=nothing
%>
</table>
</div>
<%
conn.close
set conn=nothing
%>
<script language="javascript">
if (confirm('请单击“确定”按钮开始打印,单击“取消”按钮不打印!'))
{
window.print();
}
</script>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -