📄 bookcount.asp
字号:
<%response.buffer=true
response.expires=0%>
<html>
<head>
<title>统计</title>
</head>
<body bgcolor="black">
<% bookkind=trim(request.form("bookkind"))
operator1=trim(request.form("operator1"))
set cn=Server.CreateObject("ADODB.Connection")
set rst=server.createobject("adodb.recordset")
strcon= "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath("wsm.mdb")
strsql="select * from book where bookkind='"& bookkind &"'"
select case operator1
case "显示数量":
rst.open strsql,strcon,1,3,adcmdtext
if not rst.eof then
response.write"<table border=1 align=center style='border-color:white' cellspacing=0><tr height=40><td width=220 align=center ><font color=white>书名</font></td><td width=80 align=center><font color=white>数量</font></td><td width=80 align=center><font color=red>单价</font></td></tr>"
do until rst.eof
count1=count1+rst("count")
sum=sum+rst("cost")*rst("count")
response.write"<tr height=40><td width=220 align=center><font color=white>"& rst("bookname") &"</font></td><td width=80 align=center><font color=white>"&rst("count")&"</font></td><td widht=80 align=center><font color=red>"& rst("cost") &"</font></td></tr>"
rst.movenext
loop
response.write"</table>"
else
count1=0
sum=0
end if
response.write"<p align=center><font color=white>"& bookkind &"共有藏书 <font color=red>"&count1&"</font>本</font></p>"
response.write"<p align=center><font color=white>"& bookkind &"总价值达 <font color=red>"& sum &"</font>元</font></p> "
case "统计剩余":
rst.open strsql,strcon,1,3,adcmdtext
if not rst.eof then
response.write"<table border=1 align=center style='border-color:white' cellspacing=0><tr height=40><td width=220 align=center ><font color=white>书名</font></td><td width=80 align=center><font color=white>数量</font></td><td width=80 align=center><font color=red>剩余</font></td></tr>"
do until rst.eof
count1=count1+rst("havecount")
response.write"<tr height=40><td width=220 align=center><font color=white>"& rst("bookname") &"</font></td><td width=80 align=center><font color=white>"&rst("count")&"</font></td><td widht=80 align=center><font color=red>"& rst("havecount") &"</font></td></tr>"
rst.movenext
loop
response.write"</table>"
response.write"<p align=center ><font color=red>该类书总共剩余<font color=white>"&count1&"</font></font></p>"
else
response.write"<p align=center><font color=red>该类书库已经清空了</font></p>"
end if
end select
response.write "<p align=center><font color=red><a href='管理员页面.htm'>返回主控窗口</a> <a href='统计.htm'>返回上级窗口</a></font><p>"
%>
</body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -