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

📄 return.asp

📁 图书馆模拟管理系统,对里面的功能简单容易懂,一看就会,是学习asp的好东西!
💻 ASP
字号:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file="inc/conn.asp"-->
<%
dim bookid
bookid = trim(request.QueryString("bookid"))
if bookid="" then 
%>
<script language ="javascript">
alert("错误的图书编号,请重试!");
</script>
<%
response.End()
end if
bookid = replace(bookid,"'","''")
'-------------------------------------------------------------------------------------------------------------------------------------------
set rs=server.CreateObject("adodb.recordset")
rs.open "select * from borrow where id='"&bookid&"'",conn,1,3   '------------------打开借书表
'------------------------------------------------以下是超期罚款模块
if datediff("d",rs("rdate"), rs("pdate"))>30 then'定义借书期限为30天
    set rs1=server.CreateObject("adodb.recordset")
	rs1.open "select money from [user] where id='"&session("id")&"'",conn,1,3
	rs1("money")=rs1("money")-0.1*(datediff("d",rs("rdate"), rs("pdate"))-30)
	rs1.update
	rs1.close
	set rs1=nothing
end if
rs("ifreturn")=1'把书本归还
rs("rdate")=date'------------------归还日期,要跟借书日期进行减法操作,如果超过期限的话就要进行罚款,每过一天罚款0.1元
rs.update
rs.close
set rs=nothing
'-----------------------------------------------
set rs2=server.CreateObject("adodb.recordset")
rs2.open "select * from book where bookid='"&bookid&"'",conn,1,3  '--------------------打开总书表
rs2("iflend")=0'把书本归还,同时别人也就可以借这本书了
rs2.update
'------------------------------------------------------------------------------------------------------------------------------------------
rs2.close
set rs2=nothing
%>
<html>
<head>
<style type="text/css">
<!--
body {
	font-size:10pt;
	
}
td {font-size:9pt}
table{font-size:9pt}
.style4 {color: #E8A477}
-->
</style>
<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 + -