📄 book_input.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")
id=replace(trim(request("id")),"'","")
companyid=session("companyid")
classid=replace(trim(request.Form("classid")),"'","")
booknum=replace(trim(request.Form("booknum")),"'","")
bookname=trim(request.Form("bookname"))
price=replace(trim(request.Form("price")),"'","")
anthor=replace(trim(request.Form("anthor")),"'","")
buytime=trim(request.Form("buytime"))
bookout=replace(trim(request.Form("bookout")),"'","")
bookflag=replace(trim(request.Form("bookflag")),"'","")
txt=replace(trim(request.Form("txt")),"'","")
insql="insert into oa_book(booknum,bookname,price,anthor,buytime,bookout,txt,bookflag,classid,companyid) "& _
"values('"&booknum&"','"&bookname&"','"&price&"','"&anthor&"','"&buytime&"','"&bookout&"','"&txt&"','在库',"&classid&","&companyid&")"
upsql="update oa_book set "&_
"booknum='"&booknum&"',"&_
"bookname='"&bookname&"',"&_
"price='"&price&"',"&_
"anthor='"&anthor&"',"&_
"buytime='"&buytime&"',"&_
"bookout='"&bookout&"',"&_
"txt='"&txt&"',"&_
"bookflag='"&bookflag&"',"&_
"classid="&classid&""&_
" where id="&request.Form("ids")
if act="add" then
conn.execute(insql)
call Message("发布成功","booklist.asp")
elseif act="edit" then
conn.execute(upsql)
call Message("修改成功","booklist.asp")
END IF
%>
<body>
<%if act="" then%>
<table width="99%" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#F2F2F2" class="tabel1">
<form name="myform" method="post" action="book_input.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="classid" id="classid">
<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="<%=rs("id")%>"><%=rs("classname")%></option>
<%
rs.movenext
loop
rs.close
set rs=nothing
%>
</select></td>
</tr>
<tr bgcolor="#F9F9F9">
<td height="25" align="center"> 编号</td>
<td height="25" align="left"><input name="booknum" type="text" class="tabel1" id="booknum" size="40">
<span class="style2">*</span></td>
</tr>
<tr bgcolor="#F9F9F9">
<td height="25" align="center"> 书名</td>
<td height="25" align="left"><input name="bookname" type="text" class="tabel1" id="bookname" size="40">
<span class="style2">*</span></td>
</tr>
<tr bgcolor="#F9F9F9">
<td height="25" align="center"> 作者</td>
<td height="25" align="left"><input name="anthor" type="text" class="tabel1" id="anthor"> </td>
</tr>
<tr bgcolor="#F9F9F9">
<td height="25" align="center">价格</td>
<td height="25" align="left"><input name="price" type="text" class="tabel1" id="price" value="0">
¥</td>
</tr>
<tr bgcolor="#F9F9F9">
<td height="25" align="center">出版社</td>
<td height="25" align="left"><input name="bookout" type="text" class="tabel1" id="bookout" size="50">
<span class="style2">*</span></td>
</tr>
<tr bgcolor="#F9F9F9">
<td height="25" align="center">购买日期</td>
<td height="25" align="left"><input name="buytime" 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)">
</font></span></td>
</tr></form>
</table>
<%
elseif act="edits" then
sqle="select a.*,b.classname from oa_book as a inner join oa_bookclass as b on a.classid=b.id where a.id="&id
set rs=conn.execute(sqle)
if not rs.eof then
classid1=trim(rs("classid"))
booknum1=trim(rs("booknum"))
bookname1=trim(rs("bookname"))
price1=trim(rs("price"))
anthor1=trim(rs("anthor"))
bookout1=trim(rs("bookout"))
buytime1=trim(rs("buytime"))
txt1=trim(rs("txt"))
bookflag1=trim(rs("bookflag"))
classname1=trim(rs("classname"))
end if
rs.close
set rs=nothing
%>
<table width="99%" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#F2F2F2" class="tabel1">
<form name="myform" method="post" action="book_input.asp?act=edit" 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="classid" id="classid">
<option value="<%=classid1%>" selected><%=classname1%></option>
<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="<%=rs("id")%>"><%=rs("classname")%></option>
<%
rs.movenext
loop
rs.close
set rs=nothing
%>
</select></td>
</tr>
<tr bgcolor="#F9F9F9">
<td height="25" align="center"> 编号</td>
<td height="25" align="left"><input name="booknum" type="text" class="tabel1" id="booknum" size="40" value="<%=booknum1%>">
<span class="style2">*</span></td>
</tr>
<tr bgcolor="#F9F9F9">
<td height="25" align="center"> 书名</td>
<td height="25" align="left"><input name="bookname" type="text" class="tabel1" id="bookname" size="40" value="<%=bookname1%>">
<span class="style2">*</span></td>
</tr>
<tr bgcolor="#F9F9F9">
<td height="25" align="center"> 作者</td>
<td height="25" align="left"><input name="anthor" type="text" class="tabel1" id="anthor" value="<%=anthor1%>"></td>
</tr>
<tr bgcolor="#F9F9F9">
<td height="25" align="center">价格</td>
<td height="25" align="left"><input name="price" type="text" class="tabel1" id="price" value="<%=price1%>">
¥</td>
</tr>
<tr bgcolor="#F9F9F9">
<td height="25" align="center">出版社</td>
<td height="25" align="left"><input name="bookout" type="text" class="tabel1" id="bookout" size="50" value="<%=bookout1%>">
<span class="style2">*</span></td>
</tr>
<tr bgcolor="#F9F9F9">
<td height="25" align="center">购买日期</td>
<td height="25" align="left"><input name="buytime" type="text" class="tabel1" id="buytime3" value="<%=buytime1%>" onFocus="setday(this)">
</td>
</tr>
<tr bgcolor="#F9F9F9">
<td height="25" align="center">状态</td>
<td height="25" align="left"><input name="bookflag" type="radio" value="在库" <%if bookflag1="在库" then response.Write("checked")%>>
在库 <input type="radio" name="bookflag" value="借出" <%if bookflag1="借出" then response.Write("checked")%>>
借出</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"><%=txt1%></textarea>
</span></td>
</tr>
<tr bgcolor="#F9F9F9">
<td height="25" align="center"> </td>
<td height="25" align="left">
<input name="Submit" type="submit" class="bon" id="Submit" value="修改">
<span class="style1"><font style="font-size:15px "> </font></span>
<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)">
<font style="font-size:15px ">
<input name="ids" type="hidden" id="ids" value="<%=id%>">
</font> </font></span></td>
</tr></form>
</table>
<%end if%>
<%
set conn=nothing
%>
</body>
</html>
<script language="javascript">
function CheckForm()
{
var objFrm=document.myform;
if(objFrm.booknum.value=="")
{
alert("请选择编号!");
objFrm.booknum.focus();
return false;
}
if(objFrm.bookname.value=="")
{
alert("请输入书名!");
objFrm.bookname.focus();
return false;
}
if(objFrm.bookout.value=="")
{
alert("请输入出版社!");
objFrm.bookout.focus();
return false;
}
return true;
}
</script>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -