3图书管理系统程序设计说明
3.1程序描述
本系统主要功能的程序描述如下:
1.借阅功能的程序描述:
<%
dim uid,bid
bid=request("id")
uid=request("userid")
if uid="" then
response.write "<script>alert('session已经过期,请重新登陆');window.location.href='login.asp'</script>"
else
'判断是否借过ERP系统环境下内部控制英文文献和翻译
aa="select * from loans where uid="&uid&" and bid="&bid
set xgw=server.CreateObject("adodb.recordset")
xgw.open aa,db,1,3
if not xgw.eof then
response.write "<script>alert('这本书你已经借过了咯');window.location.href='book.asp?query=all_book'</script>"
else
sq="select * from u where id="&uid
set qq=db.execute(sq)
if qq("loan_num")<="8" then
'插入数据向loans
set rs=server.CreateObject("adodb.recordset")
sql="select * from loans"
rs.open sql,db,1,3
rs.addnew
rs("uid")=uid
rs("bid")=bid
rs("time")=date()
rs("loan_")=1
rs.update
'sql="insert into table loans ([uid],[bid],[time])values('"&uid&"','"&r_id&"','"&date&"')"
'db.execute(sql)
'更新book表
sql1="update book set [num]=[num]-1 where id="&bid
db.execute(sql1)
'update table u
sql2="update u set [loan_num]=[loan_num]+1 where id="&uid
db.execute(sql2)
response.write "<script>alert('借书成功');window.location.href='my_borrow.asp?id="&uid&"'</script>"
else
response.write "<script>alert('没有借书余额咯');history.go(-1)</script>"
end if
end if
end if
%>
2.还书功能程序描述:
<%
if request("id")<>"" and request("uid")<>"" then
dim id,uid单片机的岩石磨片机直流调速系统研究与设计任务书和参考文献
id=request("id")
uid=request("uid")
'验证输入正确性
sql="select * from loans where uid='"&uid&"' and bid='"&id&"'"
set rs=server.CreateObject("adodb.recordset")
rs.Open sql,db,1,3
if rs.EOF or rs.BOF then
response.write "<script>alert('输入错误');history.go(-1)</script>"
else
'table book value of num + 1
db.execute("update book set [num]=[num]+1 where id="&id)
'u loan_num -1
db.execute("update u set [loan_num]=[loan_num]-1 where id="&uid)
db.execute("delete from loans where uid="&uid&" and bid="&id )
response.write "<script>alert('还书成功咯');history.go(-1)</script>"
response.End()
end if
else
%>
3.添加图书分类功能程序描述:
<%'图书分类添加 过程:如果请求操作是分类增加,首先判断是否有请求类型,有的话执行添加,没有就执行输入类型
if request("query")="type_add" then
if request("booktype")<>"" then
set rs=server.createobject("adodb.recordset")
sql="select * from booktype where booktype='"&request("booktype")&"'"
rs.open sql,db,1,3
if not rs.eof or not rs.bof then
response.write "<script language=javascript>alert('已经有这个分类');history.back(-1)</script>"
else
rs.addnew
rs("booktype")=request("booktype")
rs.update
rs.close
set rs=nothing
response.redirect ("book.asp?query=all_type")
end if
else'如果分类增加得到确认但是没有数据,提示输入
if request("add")="add" then
response.write "<script language=javascript>alert('分类增加得到确认但是没有数据,提示输入~');history.back(-1)</script>"本文来自辣.文,论-文·网原文请找腾讯752018766
end if双闭环V--M(有环流)直流调速系统的工程设计及仿真
%>
4.删除图书分类程序描述:
<%'分类删除 确认该分类下已经没有图书了再删除该分类
if request("query")="type_del" then
if request("id")<>"" then
sql1="select * from booktype where id ="&request("id")
set rs1=db.execute(sql1)
qq="select * from book where booktype='"&rs1("booktype")&"'"
set rq=db.execute(qq)
if rq.eof or rq.bof then
sql="delete from booktype where id ="&request("id")
db.execute(sql)
response.write "<script>alert('删除成功');window.location.href='book.asp?query=all_type'</script>"
else '分类下存在书,跳到该分类下的书,如果还想继续删除该分类的话
response.write "<script>alert('分类下存在书,不能删除');window.location.href='book.asp?query=books_of_type&booktype="&rs1("booktype")&"'</script>"
end if
else
%>
3.2功能