📄 workthings_stat_things.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"-->
<!--#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("window.top.location.href='default.asp';")
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-Type" content="text/html; charset=gb2312">
<title>办公用品使用统计</title>
<link rel="stylesheet" type="text/css" href="../css/css.css">
<script language="javascript">
function printsub()
{
window.open('workthings_stat_things_print.asp?yearvalue='+document.form1.yearvalue.value+'&workthings='+document.form1.workthings.value,'kqprintwindow','location=no,height=500, width=600, toolbar=no, menubar=no, scrollbars=yes, resizable=no, location=no, status=no');
}
</script>
</head>
<body bgcolor="#ffffff" topmargin="5" leftmargin="5">
<%
%>
<div align="center">
<table border="0">
<tr>
<td align="center"><b><font size="+1">办公用品使用统计(<font color="#ee0000">按办公用品统计</font>)</font></b></td></tr>
<tr><td align="center">
<input type="button" name="btn1" value="编辑领用表" onclick="location.href='edit_putouttable.asp';"> <input type="button" name="btn2" value="按部门查看统计" onclick="location.href='workthings_stat_dept.asp';"> <input type="button" name="btn3" value="按员工查看统计" onclick="location.href='workthings_stat_user.asp';">
</td></tr>
</table>
</div>
<%
yearvalue=request("yearvalue")
workthings=request("workthings")
if yearvalue="" then
yearvalue=year(date())
end if
if workthings="" then
workthings=cstr(rs1("autoid"))
end if
%>
<div align="center">
<table align="center">
<tr>
<form method="post" action="workthings_stat_things.asp" name="form1">
<td align="center">
<select size="1" name="yearvalue">
<%
for i=2001 to cint(year(date()))
if cstr(i)=cstr(yearvalue) then
response.write("<option selected value="&chr(34)&cstr(i)&chr(34)&">"&cstr(i)&"年"&"</option>")
else
response.write("<option value="&chr(34)&cstr(i)&chr(34)&">"&cstr(i)&"年"&"</option>")
end if
next
%>
</select>
<select size="1" name="workthings">
<%
do while not rs1.eof
if workthings=cstr(rs1("autoid")) then
workthingsname=rs1("workthingsname")
response.write("<option selected value="&chr(34)&rs1("autoid")&chr(34)&">"&rs1("workthingsname")&"</option>")
else
response.write("<option value="&chr(34)&rs1("autoid")&chr(34)&">"&rs1("workthingsname")&"</option>")
end if
rs1.movenext
loop
%>
</select>
<%
allow_lookallinfo_workthings=request.cookies("allow_lookallinfo_workthings")
%>
<input type="submit" value="查看">
<%
if allow_lookallinfo_workthings="yes" then
%>
<input type="button" name="pintbtn" value="打印" onclick="printsub();">
<%
end if
%>
</td>
</form>
</tr>
<tr><td><center><b><font size="+1"><%=workthingsname%></font><b><font color="#ee0000" size="+1"><%=yearvalue&"年"%></font><font size="+1">使用统计</font></b></center></b></td></tr>
</table>
<br>
<div align="center">
<center>
<table border="1" cellpadding="5" cellspacing="0" width="80%" bordercolorlight="#808080" bordercolordark="#D4D0C8">
<tr>
<td bgcolor="#D4D0C8" height="25" align="center" width="160">月份</td>
<td bgcolor="#D4D0C8" height="25" align="center" width="160">申请发放数量</td>
<td bgcolor="#D4D0C8" height="25" align="center" width="180">实际发放数量</td>
</tr>
<%
workthingssums=0
workthingsfactsums=0
for i=1 to 12
if i mod 2 =0 then
bgcolor="#eeeeee"
else
bgcolor="#ffffff"
end if
set rs2=server.createobject("adodb.recordset")
sql="select sum(workthings_userthings.putoutnumber) as putoutsums,sum(workthings_userthings.putoutfactnumber) as putoutfactsums from workthings_userthings,workthings_use where workthings_use.autoid=workthings_userthings.recordid and workthings_userthings.workthingsid="&workthings&" and workthings_use.putoutusername<>'' and year(workthings_use.writetabletime)="&yearvalue&" and month(workthings_use.writetabletime)="&i
'response.write(sql)
'response.end
rs2.open sql,conn,1
%>
<tr bgcolor="<%=bgcolor%>">
<td align="center" width="160" height="25"><font color="#EE0000"><%=i%>月</font></td>
<td align="center" width="160" height="25">
<%
if isnull(rs2("putoutsums")) then
response.write("0")
else
response.write(rs2("putoutsums"))
workthingssums=workthingssums+rs2("putoutsums")
end if
%>
</td>
<td align="center" width="180" height="25">
<%
if isnull(rs2("putoutfactsums")) then
response.write("0")
else
response.write(rs2("putoutfactsums"))
workthingsfactsums=workthingsfactsums+rs2("putoutfactsums")
monthsums=monthsums+rs2("putoutfactsums")
end if
%>
</td>
</tr>
<%
set rs2=nothing
next
%>
</table>
<p><font color="#ee0000"><%=yearvalue%></font>年<font color="#ee0000"><%=workthingsname%></font>申请发放数量:<font color="#ee0000"><b><%=workthingssums%></b></font>实际发放数量:<font color="#ee0000"><b><%=workthingsfactsums%></b></font></p>
</center>
</div>
<%
conn.close
set rs1=nothing
%>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -