?? old.asp
字號:
<html>
<head>
<title>借閱圖書歷史信息</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<STYLE type=text/css>.main {
FONT-SIZE: 12px
}
.main1 {
FONT-SIZE: 9pt
}
.main2 {
FONT-SIZE: 16px
}
.main3 {
FONT-SIZE: 7px
}
.main4 {
FONT-SIZE: 10px
}
A:link {
COLOR: #ffffff; TEXT-DECORATION: none
}
A:visited {
COLOR: #ffffff; TEXT-DECORATION: none
}
A:active {
COLOR: #ff0000; TEXT-DECORATION: none
}
A:hover {
COLOR: #aa0000; TEXT-DECORATION: underline
}
</STYLE>
</head>
<body text="#000000">
<br>
<div align="center">
<center>
<!--#include file="conn.asp"-->
<%
set rs=server.createobject("adodb.recordset")
sqltext="select * from borecorder where bo_flag=1 order by return_time desc"
rs.open sqltext,conn,1,1
dim MaxPerPage
MaxPerPage=20
'假如沒有數據時
If rs.eof and rs.bof then
call showpages
response.write "<p align='center'><font color='#ff0000'>還沒任何借閱信息</font></p>"
response.end
End if
'取得頁數,并判斷用戶輸入的是否數字類型的數據,如不是將以第一頁顯示
dim text,checkpage
text="0123456789"
Rs.PageSize=MaxPerPage
for i=1 to len(request("page"))
checkpage=instr(1,text,mid(request("page"),i,1))
if checkpage=0 then
exit for
end if
next
If checkpage<>0 then
If NOT IsEmpty(request("page")) Then
CurrentPage=Cint(request("page"))
If CurrentPage < 1 Then CurrentPage = 1
If CurrentPage > Rs.PageCount Then CurrentPage = Rs.PageCount
Else
CurrentPage= 1
End If
If not Rs.eof Then Rs.AbsolutePage = CurrentPage end if
Else
CurrentPage=1
End if
call showpages
call list
If Rs.recordcount > MaxPerPage then
call showpages
end if
'顯示帖子的子程序
Sub list()%> <form method='POST' action='Old_Search.asp'>
<TABLE cellSpacing=1 cellPadding=4 width=100% bgColor=#416327 height="136">
<TBODY>
<TR vAlign=top bgColor=#e1f0ff>
<TD class=main1 height="10" bgcolor="#1f60a0" background="images/bg.gif"></TD></TR>
<TR vAlign=top bgColor=#e1f0ff>
<TD class=main1 height="18">借閱圖書歷史信息-- <input type="button" value="當前借閱信息" onclick=" window.location='default.asp'" style="font-family: 新細明體, 宋體, Arial; font-size: 9pt; height:20px;background-color:#D4D0C8;" onMouseOver ="this.style.backgroundColor='#FFC864'" onMouseOut ="this.style.backgroundColor='#D4D0C8'">
借閱圖書歷史信息檢索: <select name='Class' size='1' tabindex='0' style="font-size: 9pt">
<option value='按圖書名稱'>按圖書名稱</option>
<option value='按借閱人'>按借閱人</option>
<option value='按借閱種類'>按借閱種類</option>
<option value='按借閱數量'>按借閱數量</option>
<option value='按過期天數'>按過期天數</option>
</select>
<input type='text' name='Name' size='11' onMouseOver = "this.style.backgroundColor = '#E5F0FF'" onMouseOut = "this.style.backgroundColor = ''" style="font-family: 新細明體, 宋體, Arial; font-size: 9pt; height:18px;background-color:#f3f3f3;border:1 solid black">
<input type='submit' value='查詢' name='Submit' style="font-family: 新細明體, 宋體, Arial; font-size: 9pt; height:20px;background-color:#D4D0C8;" onMouseOver ="this.style.backgroundColor='#FFC864'" onMouseOut ="this.style.backgroundColor='#D4D0C8'">
</TD></TR>
<TR vAlign=top bgColor=#e1f0ff>
<TD class=main1 height="15">
<table border="1" cellpadding="0" cellspacing="0" width="100%" bordercolorlight="#1f60a0" bordercolordark="#e1f0ff" height="49">
<tr class=main1>
<td width="6%" bgcolor="#1f60a0" align="center" height="22"><font color="#FFFFFF">序號</font></td>
<td width="17%" bgcolor="#1f60a0" align="center" height="22"><font color="#FFFFFF">借閱圖書名稱</font></td>
<td width="6%" bgcolor="#1f60a0" align="center" height="22"><font color="#FFFFFF">數量</font></td>
<td width="9%" bgcolor="#1f60a0" align="center" height="22"><font color="#FFFFFF">種類</font></td>
<td width="9%" bgcolor="#1f60a0" align="center" height="22"><font color="#FFFFFF">借閱人</font></td>
<td width="11%" bgcolor="#1f60a0" align="center" height="22"><font color="#FFFFFF">借閱時間</font></td>
<td width="10%" bgcolor="#1f60a0" align="center" height="22"><font color="#FFFFFF">歸還時間</font></td>
<td width="8%" bgcolor="#1f60a0" align="center" height="22"><font color="#FFFFFF">備注</font></td>
<td width="12%" bgcolor="#1f60a0" align="center" height="22"><font color="#FFFFFF">實際歸還時間</font></td>
<td width="9%" bgcolor="#1f60a0" align="center" height="22"><font color="#FFFFFF">過期(天)</font></td>
</tr>
<%
if not rs.eof then
i=0
do while not rs.eof
%>
<tr class=main1>
<td width="6%" align="center" height="23"><%=rs("bo_id")%></td>
<td width="17%" align="center" height="23"><%=rs("bo_name")%></td>
<td width="6%" align="center" height="23"><%=rs("bo_total")%></td>
<td width="9%" align="center" height="23"><%=rs("bo_dep")%></td>
<td width="9%" align="center" height="23"><%=rs("bo_owner")%></td>
<td width="11%" align="center" height="23"><%=rs("bo_time")%></td>
<td width="10%" align="center" height="23"><%=rs("bo_retime")%></td>
<td width="8%" align="center" height="23"><a href="#" title=<%=rs("bo_remark")%>><font color="#000000"><u>備注</u></font></a></td>
<td width="12%" align="center" height="23"><%=rs("return_time")%></td>
<td width="9%" align="center" height="23"><%if DateDiff("d", rs("bo_retime"), rs("return_time"))<0 then %>0<%else%><font color=red><%=DateDiff("d", rs("bo_retime"), rs("return_time"))%></font><%end if%></td>
</tr>
<%
i=i+1
if i >= MaxPerpage then exit do
rs.movenext
loop
end if
%>
</table>
</TD></TR>
<TR bgColor=#e1f0ff>
<TD class=main1 width="662" height="27">
<p align="center">
</TD></TR>
<TR bgColor=#e1f0ff>
<TD class=main1 width="662" height="4" bgcolor="#1f60a0" background="images/bg.gif"></TD></TR></TBODY></TABLE><br>
<%
End sub
rs.close
conn.close
%> </center>
</div>
<div align="center">
<center>
</form>
<%
'顯示翻頁的子程序
sub showpages()%>
<table bgColor="#f8e8a0" border="0" cellPadding="0" cellSpacing="0" width="100%" >
<tr><td >
<%
response.write "<form method=Post action='old.asp'>"
%>
<table bgColor="#1f60a0" border="0" cellPadding="0" cellSpacing="0" width="100%" height="30">
<tr>
<td bgcolor="#e1f0ff" class=main1>
<font color="#000000">
<p align="left">
<%
Response.write "<font color='#000000'>分頁-</font>"
If currentpage > 1 Then
response.write "<a href='old.asp?&page="+cstr(1)+"'><font color='#000000'>首頁</font></a><font color='#000000'><b>-</b></font>"
Response.write "<a href='old.asp?page="+Cstr(currentpage-1)+"'><font color='#000000'>前頁</font></a><font color='#000000'><b>-</b></font>"
Else
Response.write "<font color='#000000'>首頁-</font>"
Response.write "<font color='#000000'>前頁-</font>"
End if
If currentpage < Rs.PageCount Then
Response.write "<a href='old.asp?page="+Cstr(currentPage+1)+"'><font color='#000000'>后頁</font></a><font color='#000000'><b>-</b></font>"
Response.write "<a href='old.asp?page="+Cstr(Rs.PageCount)+"'><font color='#000000'>尾頁</font></a> "
Else
Response.write "<font color='#000000'>后頁-</font>"
Response.write "<font color='#000000'>尾頁</font> "
End if
Response.write "<font color='#000000'>頁次:</font>" & "<font color=#FF0000>" & Cstr(CurrentPage) & "</font>" & "<font color='#000000'>/" & Cstr(rs.pagecount) & "</font> "
Response.write "<font color=#ff0000>" & Cstr(MaxPerPage) & "</font>" & "<font color='#000000'>條記錄/頁 " & "共</font>" & "<font color=#FF0000>" & Cstr(Rs.RecordCount) & "</font>" & "<font color='#000000'>條記錄</font> "
response.write "</td><td align='right'>"
response.write "<font color='#ffffff' class=main1>轉到:</font><input type='text' name='page' size=4 maxlength=4 class=smallInput value="&Currentpage&"> "
response.write "<input class=buttonface type='submit' value='Go' name='cndok' style='background-color: #e1f0ff'></span> "
%>
</font>
</td>
</tr>
</table>
</center>
</td></tr>
</table>
</form>
<%end sub%>
</body>
</html>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -