📄 jieyue1.asp
字号:
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>图书借阅</title>
</head>
<!--#include file="conn.asp"-->
<!--#include file="checkuser.asp" -->
<style>
BODY{
font-family:verdana,arial,helvetica;
margin:0;
}
td {
font-family:Tahoma,Verdana, Arial;
font-size:11px;
border: 1px solid #CCCCCC;
}
A:link, A:active,A:visited
{
color: #CCCCCC;
text-decoration: none;
padding-left:6px;
padding-right:6px;
}
A:hover
{
color: #FF3300;
text-decoration: none;
padding-left:6px;
padding-right:6px;
}
.STYLE1 {color: #FFFFFF}
</style><title>图书借阅</title>
<%
'增加借阅记录
if trim(request.querystring("action"))="jieyue" then
bookid=cint(trim(request.Form("bookid")))
tiaoxingma=request.form("tiaoxingma")
xingming=request.form("xingming")
beizhu=request.form("beizhu")
caozuoren=session("username")
jcsj=formatdatetime(now(),2)
Set rs=server.createobject("adodb.recordset")
sql="select * from booklog"
rs.open sql,conn,1,3
rs.addnew
rs("tiaoxingma")=tiaoxingma
rs("bookid")=bookid
rs("xingming")=xingming
rs("leixing")=True
rs("jcsj")=jcsj
rs("caozuoren")=caozuoren
rs("beizhu")=beizhu
logid=rs("id")
rs.update
Set rs=conn.execute("update ebook set jieyueshu=jieyueshu+1,yijie=yijie+1,logid="&logid&" where id="&bookid&" ")
response.write "<script>"
response.write "alert('借阅成功!');"
response.write "window.location.href='jieyue.asp';"
response.write "</script>"
response.End()
end if
tiaoxingma=trim(request.form("tiaoxingma"))
set rs=server.CreateObject("adodb.recordset")
sql="select * from [ebook] where tiaoxingma='"&tiaoxingma&"'"
rs.open sql,conn,1,1
if rs.eof then
response.Write "<script>"
response.Write "alert('该书暂未加入系统,请先加入系统!');"
response.write "window.location.href='jieyue.asp';"
response.write "</script>"
rs.close
set rs=nothing
response.end
else
if rs("yijie")>=rs("ceshu") then
response.Write "<script>"
response.Write "alert('该书已经全部借出!');"
response.write "window.location.href='jieyue.asp';"
response.write "</script>"
rs.close
set rs=nothing
response.end
end if
tiaoxingma=rs("tiaoxingma")
shuming=rs("shuming")
bookid=rs("id")
rs.close
set rs=nothing
end if
%>
<body onLoad="xingming();">
<form id="form1" name="form1" method="post" action="?action=jieyue">
<p> </p>
<p> </p>
<table width="307" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td height="24" colspan="2" align="center" bgcolor="#003366"><span class="STYLE1">借阅登记</span></td>
</tr>
<tr>
<td height="26" align="center">书名:</td>
<td><a href="bookinfo.asp?bookid=<%=bookid%>" target="_blank"><font color=red><%=shuming%></font></a>
<input name="bookid" type="hidden" id="bookid" value="<%=bookid%>" />
<input name="tiaoxingma" type="hidden" id="tiaoxingma" value="<%=tiaoxingma%>" />
</td>
</tr>
<tr>
<td align="center">姓名:</td>
<td><input name="xingming" type="text" id="xingming" /></td>
</tr>
<tr>
<td align="center">备注:</td>
<td><textarea name="beizhu" rows="3" id="beizhu"></textarea>
* 班级等信心 </td>
</tr>
<tr>
<td colspan="2" align="center"><input type="submit" name="Submit" value="确认" onClick="return checkform();" />
<input name="fanhui" type="button" id="fanhui" value="返回" onClick="window.location.href='jieyue.asp';" /></td>
</tr>
</table>
</form>
</body>
</html>
<script language="JavaScript" type="text/javascript">
function xingming(){
document.form1.xingming.focus();
document.form1.xingming.select();
}
function checkform(){
if (document.form1.xingming.value=="") {
alert('请输入借阅者姓名!');
document.form1.xingming.focus();
document.form1.xingming.select();
return false;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -