📄 book_out.asp
字号:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file="../../config.asp"-->
<!--#include file="../checklogin.asp"-->
<%
if ChkAdmin("oa_book")=False then
call message("您没有管理图书借阅的权限","back")
call endexit()
end if
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
<SCRIPT language=JavaScript src="../../inc/meizzDate.js"></SCRIPT>
<link href="../img/css1.css" type=text/css rel=stylesheet>
<style type="text/css">
<!--
body {
margin-left: 0px;
margin-top: 0px;
margin-right: 0px;
margin-bottom: 0px;
}
.style1 {
color: #FFFFFF;
font-weight: bold;
}
.style2 {color: #CC0000}
-->
</style>
</head>
<%
act=request.QueryString("act")
companyid=session("companyid")
bookid=replace(trim(request.Form("bookid")),"'","")
uname=replace(trim(request.Form("uname")),"'","")
out_time=trim(request.Form("out_time"))
back_time=replace(trim(request.Form("back_time")),"'","")
txt=replace(trim(request.Form("txt")),"'","")
ssql="select bookflag from oa_book where id="&bookid
insql="insert into oa_bookout(bookid,uname,out_time,back_time,txt,companyid) "& _
"values("&bookid&",'"&uname&"','"&out_time&"','"&back_time&"','"&txt&"',"&companyid&")"
upsql="update oa_book set bookflag='借出' where id="&bookid
if act="add" then
set srs=conn.execute(ssql)
if trim(srs(0))="借出" then
call message("该书已借出","back")
call endexit()
end if
srs.close
conn.execute(upsql)
conn.execute(insql)
call Message("发布成功","book_outlist.asp?bookid="&request.Form("bookid")&"")
END IF
%>
<body>
<table width="99%" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#F2F2F2" class="tabel1">
<form name="myform" method="post" action="book_out.asp?act=add" onSubmit="return CheckForm();">
<tr align="center">
<td height="25" colspan="2" bgcolor="#CC0000"><span class="style1">图书借阅登记</span></td>
</tr>
<tr bgcolor="#F9F9F9">
<td width="13%" height="25" align="center"> <strong><img src="../img/item_point.gif" width="4" height="7"> 图书借阅登记</strong></td>
<td width="87%" height="25" align="left"> </td>
</tr>
<tr bgcolor="#F9F9F9">
<td height="25" align="center">选择图书</td>
<td height="25" align="left"><select name="bookid" id="bookid">
<option value="">请选择图书</option>
<%
sql="select id, classname from oa_bookclass where companyid="&session("companyid")
set rs=conn.execute(sql)
do while not rs.eof
%>
<option value=""><%=trim(rs("classname"))%></option>
<%
fsql="select * from oa_book where classid="&rs(0)
set frs=conn.execute(fsql)
do while not frs.eof
%>
<option value="<%=trim(frs("id"))%>" style="color:#cc0000 ">--<%=frs("bookname")%>【<%=trim(frs("bookflag"))%>】</option>
<%
frs.movenext
loop
frs.close
set frs=nothing
%>
<%
rs.movenext
loop
rs.close
set rs=nothing
%>
</select>
<span class="style2">*</span></td>
</tr>
<tr bgcolor="#F9F9F9">
<td height="25" align="center"> 借阅者</td>
<td height="25" align="left"><select name="uname" id="uname">
<%
sql="select id, truename from oa_Admin where companyid="&session("companyid")
set rs=conn.execute(sql)
do while not rs.eof
%>
<option value="<%=trim(rs("truename"))%>"><%=rs("truename")%></option>
<%
rs.movenext
loop
rs.close
set rs=nothing
%>
</select> <span class="style2">*</span></td>
</tr>
<tr bgcolor="#F9F9F9">
<td height="25" align="center"> 借书日期</td>
<td height="25" align="left"><input name="out_time" type="text" class="tabel1" id="buytime" value="<%=date()%>" onFocus="setday(this)">
<span class="style2">*</span></td>
</tr>
<tr bgcolor="#F9F9F9">
<td height="25" align="center"> 预计归还日期 </td>
<td height="25" align="left"><input name="back_time" type="text" class="tabel1" id="buytime3" value="<%=date()%>" onFocus="setday(this)">
</td>
</tr>
<tr bgcolor="#F9F9F9">
<td height="25" align="center"> 备注 </td>
<td height="25" align="left"> <span class="style2">
<textarea name="txt" cols="50" rows="4" class="tabel1" id="txt"></textarea>
</span></td>
</tr>
<tr bgcolor="#F9F9F9">
<td height="25" align="center"> </td>
<td height="25" align="left"><input name="Submit2" type="submit" class="bon" value="添加">
<input name="Submit3" type="reset" class="bon" value="重置">
<span class="style1"><font style="font-size:15px ">
<input name="Submit" type="button" class="bon" value="返回" onClick="window.history.go(-1)">
<input name="bid" type="hidden" id="bid" value="<%=bookid%>">
</font></span></td>
</tr></form>
</table>
<%
set conn=nothing
%>
</body>
</html>
<script language="javascript">
function CheckForm()
{
var objFrm=document.myform;
if(objFrm.bookid.value=="")
{
alert("请选择图书!");
objFrm.bookid.focus();
return false;
}
if(objFrm.out_time.value=="")
{
alert("请输入借阅日期!");
objFrm.out_time.focus();
return false;
}
if(objFrm.back_time.value=="")
{
alert("请输入归还日期!");
objFrm.back_time.focus();
return false;
}
return true;
}
</script>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -