⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 wantbo.asp

📁 图书馆模拟管理系统,对里面的功能简单容易懂,一看就会,是学习asp的好东西!
💻 ASP
字号:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file="inc/conn.asp"-->
<%
dim i,bookid
bookid = trim(request.QueryString("bookid"))
if bookid="" then 
%>
<script language ="javascript">
alert("Wrong bookid");
</script>
<%
response.End()
end if
bookid = replace(bookid,"'","''")
'------------------------------------------------------------------------------------
set rsfrom=server.CreateObject("adodb.recordset")
rsfrom.open "select book.name,book.author,book.class,book.press,book.bookid,book.iflend,user.name,user.id from [book],[user] where ((book.bookid='" & bookid & "') and (user.id='" & session("id") & "'))",conn,1,3
'response.Write(bookid & rsfrom("author"))
'response.End()
if rsfrom.eof then '----如果空
%>
	<script language ="javascript">
	alert("No Found this book");
	location='index.asp';
	</script>
<%
response.End()
rsfrom.close
set rsfrom = nothing
end if
if rsfrom("iflend")=1 then'如果书已经借出
%>
	<script language ="javascript">
	alert("lent!");
	location='index.asp';
	</script>
<%
rsfrom.close
set rsfrom = nothing
response.End()
end if

set rsto=server.CreateObject("adodb.recordset")
rsto.open "select id,name,sname,author,press,class,stuid,pdate,ifreturn from [borrow] where stuid='" & session("id") & "' order by pdate desc",conn,1,3 
if rsto.recordcount > 10 then'借书的最大限度
%>
	<script language ="javascript">
	alert("Too Much!");
	location='index.asp';
	</script>
<%
rsfrom.close
rsto.close
set rsto = nothing
set rsfrom = nothing
response.End()
end if
rsto.addnew
'----------------------------------------------------------------------------把user和book表中的数据复制到borrow表中
rsto("pdate")=date'借书日期
rsto("ifreturn")=0'图书默认为没有归还
rsto("id") = bookid'图书编号
rsto("name") = rsfrom("book.name")'图书名称
rsto("sname") = rsfrom("user.name")'学生姓名
rsto("author") = rsfrom("author")'图书作者
rsto("press") = rsfrom("press")'出版社
rsto("class") = rsfrom("class")'图书类别
rsto("stuid") = rsfrom("id")'学号
'----------------------------------------------------------------------------------
rsto.update
rsfrom("iflend") = 1 '把book表中是否借出由0改为1,标志已经借出
rsfrom.update
rsfrom.close
rsto.close
set rsfrom = nothing
set rsto = nothing
%>










<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
</head>
<body>
<script language="javascript">
alert("借阅成功!")
location = 'noreturn.asp';
</script>
</body>
</html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -