?? jieyuelog.asp
字號:
<!--#include file="conn.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>
<body onload="tiaoxingma();">
<form id="form1" name="form1" method="post" action="?action=zhao">
<table width="680" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td height="22" align="center" bgcolor="#003366"><span class="STYLE1">借閱查詢管理</span></td>
</tr>
<tr>
<td align="center">書籍條形碼:
<input name="tiaoxingma" type="text" id="tiaoxingma" />
<input type="submit" name="Submit" value="查找借閱記錄" onclick="return checktxm();" /></td>
</tr>
</table>
</form>
<table width="680" border="1" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="53" height="18" bgcolor="#003366"><div align="center" class="STYLE1">編號</div></td>
<td width="130" bgcolor="#003366"><div align="center" class="STYLE1">條形碼</div></td>
<td width="197" bgcolor="#003366"><div align="center" class="STYLE1">書籍名稱</div></td>
<td width="82" bgcolor="#003366"><div align="center" class="STYLE1">借閱者</div></td>
<td width="54" bgcolor="#003366"><div align="center" class="STYLE1">是否歸還</div></td>
<td width="69" bgcolor="#003366"><div align="center" class="STYLE1">借閱時間</div></td>
<td width="79" bgcolor="#003366"><div align="center" class="STYLE1">歸還時間</div></td>
</tr>
<%
action=trim(request.querystring("action"))
if action="zhao" then
tiaoxingma=request.form("tiaoxingma")
Set rs=conn.execute("select * from booklog where tiaoxingma='"&tiaoxingma&"'")
else
set rs=conn.execute("select * from booklog ")
end if
if not rs.eof then
const maxperpage=25 '定義每一頁顯示的數據記錄的常量
dim currentpage '定義當前頁的變量
rs.pagesize=maxperpage
currentpage=request("page")
if currentpage="" or not Isnumeric(currentpage) then
currentpage=1
elseif currentpage<1 then
c1urrentpage=1
else
currentpage=clng(currentpage)
if currentpage > rs.pagecount then
currentpage=rs.pagecount
end if
end if
'如果變量c1urrentpage的數據類型不是數值型
'就1賦給變量c1urrentpage
if not isnumeric(currentpage) then
currentpage=1
end if
dim totalput,n '定義變量
totalput=rs.recordcount
if totalput mod maxperpage=0 then
n=totalput\maxperpage
else
n=totalput\maxperpage+1
end if
if n=0 then
n=1
end if
rs.move(currentpage-1)*maxperpage
i=0
do while i< maxperpage and not rs.eof
i=i+1
%>
<tr>
<td align="center"> <%=rs("id")%></td>
<td align="center"> <%=rs("tiaoxingma")%></td>
<td align="center"> <%
Set rs1=conn.execute("select * from ebook where tiaoxingma='"&rs("tiaoxingma")&"'")
'response.write "<a href=bookinfo.asp?bookid="&rs("bookid")&" target=_blank>"&rs1("shuming")&"</a>"%></td>
<td align="center"> <%=rs("xingming")%></td>
<td align="center"> <%
if rs("leixing")=true then
response.write "未歸還"
else
response.Write "已歸還"
end if
%></td>
<td align="center"> <%=rs("jcsj")%></td>
<td align="center">
<%=rs("jcsj")%></td>
</tr>
<%
rs.movenext
loop
end if
rs.close
set rs=nothing
%>
<tr>
<td colspan="7" align="right">
頁數 <font color="red"><%=currentpage%></font>/<% =n%>
<% k=currentpage
if k<>1 then%>
[<a class="link" href="jieyuelog.asp?page=1">首頁</a>]
[<a class="link" href="jieyuelog.asp?page=<%=k-1%>">上一頁</a>]
<%else%>
[首頁] [上一頁]
<%end if%>
<%if k<>n then%>
[<a class="link" href="jieyuelog.asp?page=<%=k+1%>">下一頁</a>]
[<a class="link" href="jieyuelog.asp?page=<%=n%>">尾頁</a>]
<%else%>
[下一頁] [尾頁]
<%end if%>
共有<font color="red"><%=totalput%></font>條記錄 <font color="red"><%=maxperpage%></font>個/頁
共有<font color="red"><%=n%></font>頁 </td>
</tr>
</table>
</body>
<script language="JavaScript" type="text/javascript">
function tiaoxingma(){
document.form1.tiaoxingma.focus();
document.form1.tiaoxingma.select();
}
function checktxm(){
if (document.form1.tiaoxingma.value==""){
alert('請輸入條形碼!');
document.form1.tiaoxingma.focus();
document.form1.tiaoxingma.select();
return false;
}
}
</script>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -