📄 bookin.asp
字号:
<!--#include file="conn.asp"-->
<!--#include file="checkuser.asp" -->
<%
action=request.querystring("action")
step=request.QueryString("step")
if step=1 then
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 not rs.eof then
response.write "<script>"
response.write "alert('该条形码书籍已经存在! \n\n 请重新正确输入!');"
response.write "history.back(-1);"
response.write "</script>"
rs.close
set rs=nothing
End IF
end if
if action="add" then
tiaoxingma=request.form("tiaoxingma")
shuming=request.form("shuming")
folderid=request.form("folderid")
zhubian=request.form("zhubian")
chubanshe=request.form("chubanshe")
ceshu=request.form("ceshu")
dingjia=request.form("dingjia")
jianjie=request.form("jianjie")
beizhu=request.form("beizhu")
shijian=request.form("shijian")
bookpic=request.form("bookpic")
set rs=server.createobject("adodb.recordset")
sql="select * from ebook where tiaoxingma='"&tiaoxingma&"'"
rs.open sql,conn,1,3
if not rs.eof then
response.write "<script>"
response.write "alert('该条形码书籍已经存在! \n\n 请重新正确输入!');"
response.write "history.back(-1);"
response.write "</script>"
rs.close
set rs=nothing
else
rs.addnew
rs("tiaoxingma")=tiaoxingma
rs("shuming")=shuming
rs("folderid")=folderid
rs("zhubian")=zhubian
rs("chubanshe")=chubanshe
rs("ceshu")=ceshu
rs("dingjia")=dingjia
rs("jianjie")=jianjie
rs("shijian")=shijian
rs("beizhu")=beizhu
rs("bookpic")=bookpic
rs("userid")=session("userid")
rs.update
rs.close
set rs=nothing
response.write "<script>"
response.write "alert('添加书籍成功! \n\n 图书管理系统!');"
response.write "window.location.href='bookin.asp'"
response.write "</script>"
end if
end if
%>
<script src="rq.js" type="text/javascript" ></script>
<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;
}
</style>
<title>图书入库</title>
<script type="text/JavaScript">
<!--
function MM_openBrWindow(theURL,winName,features) { //v2.0
window.open(theURL,winName,features);
}
//-->
</script>
<body onLoad="tiaoxingma();">
<%
if step="" then
%>
<form name="form2" method="post" action="bookin.asp?step=1">
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<table width="323" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="84">图书条形码:</td>
<td width="170">
<input name="tiaoxingma" type="text" id="tiaoxingma"></td>
<td width="69"><input type="submit" name="Submit4" value="下一步" ></td>
</tr>
</table>
</form>
<%
ElseIf Step=1 then
%>
<form id="form1" name="form1" method="post" action="?action=add" >
<p> </p>
<table width="640" border="0" align="center">
<tr>
<td width="70" bgcolor="#CCCCCC">条形码:</td>
<td width="400"><input name="tiaoxingma" type="text" id="tiaoxingma" tabindex="0" value="<%=tiaoxingma%>" /></td>
<td width="156"> </td>
</tr>
<tr>
<td width="70" bgcolor="#CCCCCC">书籍类别:</td>
<td width="400">
<select name="folderid" id="folderid">
<option value="0">请选择书籍分类</option>
<%
Set rs=conn.execute("select * from folder where folderParentid=0")
do while not rs.eof
%>
<option value="<%=rs("folderid")%>"><%=rs("foldername")%></option>
<%
rs.movenext
loop
rs.close
set rs=nothing
%>
</select>
</td>
<td width="156" bgcolor="#CCCCCC"><div align="center">缩略图</div></td>
</tr>
<tr>
<td bgcolor="#CCCCCC">书籍名称:</td>
<td><input name="shuming" type="text" id="shuming" tabindex="1" /></td>
<td rowspan="6" align="center" valign="middle"><img src="Images/bookpic.gif" width="120" height="150" border="0" /></td>
</tr>
<tr>
<td bgcolor="#CCCCCC">主编/作者:</td>
<td><input name="zhubian" type="text" id="zhubian" tabindex="2" /></td>
</tr>
<tr>
<td bgcolor="#CCCCCC">出版社:</td>
<td><input name="chubanshe" type="text" id="chubanshe" tabindex="3" /></td>
</tr>
<tr>
<td bgcolor="#CCCCCC">册数:</td>
<td><input name="ceshu" type="text" id="ceshu" value="1" size="10" tabindex="4" onKeyUp="value=value.replace(/[\W]/g,'') "onbeforepaste="clipboardData.setData('text',clipboardData.getData('text').replace(/[^\d]/g,''))" onKeyDown="if(event.keyCode==13)event.keyCode=9" />
册</td>
</tr>
<tr>
<td bgcolor="#CCCCCC">定价:</td>
<td><input name="dingjia" type="text" id="dingjia" size="10" tabindex="5" />
元</td>
</tr>
<tr>
<td bgcolor="#CCCCCC">书籍简介:</td>
<td><textarea name="jianjie" cols="50" rows="5" id="jianjie" tabindex="6"></textarea></td>
</tr>
<tr>
<td bgcolor="#CCCCCC">书籍状况:</td>
<td><input name="beizhu" type="text" id="beizhu" value="完好" size="10" tabindex="7" />
* 完好、破损等</td>
<td><input name="bookpic" type="text" id="bookpic" value="Images/bookpic.gif" /></td>
</tr>
<tr>
<td bgcolor="#CCCCCC">购置时间:</td>
<td><script>arrowtag("shijian","")</script></td>
<td><div align="center">
<input name="Submit3" type="button" tabindex="9" onClick="MM_openBrWindow('post_upload.asp','上传书籍照片','width=300,height=200')" value="上传图片" />
</div></td>
</tr>
<tr>
<td> </td>
<td>
<div align="center">
<input type="button" name="Submit" value="添加" tabindex="10" onClick="checkform();" />
<input type="reset" name="Submit2" value="重置" />
</div></td>
<td> </td>
</tr>
</table>
</form>
<%End IF%>
</body>
<script language="JavaScript" type="text/javascript">
function tiaoxingma(){
document.form2.tiaoxingma.focus();
document.form2.tiaoxingma.select();
}
function checkit(){
if(event.keyCode=="13"){
document.form1.folderid.focus();
document.form1.folderid.select();
}
}
function checkform(){
if (document.form1.tiaoxingma.value==""){
alert('书籍条形码不能为空!');
document.form1.tiaoxingma.focus();
document.form1.tiaoxingma.select();
return false;
}
if (document.form1.shuming.value==""){
alert('书籍名称不能为空!');
document.form1.shuming.focus();
document.form1.shuming.select();
return false;
}
document.form1.submit();
}
</script>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -