?? search.asp
字號(hào):
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>圖書館管理系統(tǒng)</title>
<link href="css.css" rel="stylesheet" type="text/css" />
<style type="text/css">
<style type="text/css">
<!--
body,td,th {
font-size: 12px;
}
body {
background-color: #E7EEF5;
margin-left: 0px;
margin-top: 0px;
margin-right: 0px;
margin-bottom: 0px;
}
.STYLE2 {
font-size: 16px;
font-family: "黑體";
color: #FFFFFF;
}
.tb2{
margin-top: 3px;
margin-right: 0px;
margin-bottom: 3px;
margin-left: 0px;
}
.style4 {font-size: 16px; font-family: "黑體"; color: #000000; }
-->
</style>
</head>
<!--#include file="conn.asp"-->
<%
key=trim(request.Form("key"))
type1=trim(request.Form("type"))
lb=trim(request.Form("lb"))
sql="select * from [book]"
select case type1
case "1"
tt="[b_name]"
case "2"
tt="[b_WRITER]"
case "3"
tt="[b_CONCERN]"
case "4"
tt="[b_ISBN]"
end select
select case trim(request.Form("px"))
case "1"
p="asc"
case "2"
p="desc"
end select
if lb="" and key="" then
sql=sql&" order by [b_CHECK_DATE] "&p&""
elseif lb<>"" and key="" then
sql=sql&" where [b_SORT]="&lb&" order by [b_CHECK_DATE] "&p&""
elseif lb<>"" and key<>"" then
sql=sql&" where [b_SORT]="&lb&" and "&tt&" like '%"&key&"%' order by [b_CHECK_DATE] "&p&""
elseif lb="" and key<>"" then
sql=sql&" where "&tt&" like '%"&key&"%' order by [b_CHECK_DATE] "&p&""
else
end if
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,1
%>
<body>
<form name="form1" method="post" action="">
<center>
<table width="800" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="150"><!--#include file="top.asp"--></td>
</tr>
<tr>
<td align="center" valign="top"><table width="100%" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#C5D5E4" class="tb2">
<tr>
<td height="38" valign="top"><table width="100%" border="0">
<tr></tr>
</table>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="94%" valign="top"><table width="100%" align="center" border="0" cellspacing="0" cellpadding="0" >
<tr>
<td height="30" align="center" valign="middle" background="img/T_bg.gif" class="title_bg"><span class="style4">查詢結(jié)果</span></td>
</tr>
<tr>
<td valign="top">
<%
if rs.recordcount=0 then %>
<table width="100%" border="0" cellspacing="0" cellpadding="5" align="center">
<tr>
<td align="center">暫無符合該條件的信息,請(qǐng)更換查詢條件!</td>
</tr>
</table>
<%
else
rs.PageSize =10
iCount=rs.RecordCount
iPageSize=rs.PageSize
maxpage=rs.PageCount
page=request.QueryString("page")
if Not IsNumeric(page) or page="" then
page=1
else
page=cint(page)
end if
if page<1 then
page=1
elseif page>maxpage then
page=maxpage
end if
rs.AbsolutePage=Page
if page=maxpage then
x=iCount-(maxpage-1)*iPageSize
else
x=iPageSize
end if
%>
<table width="100%" border="0" align="center" cellpadding="2" cellspacing="1" bgcolor="#E7EEF5">
<tr>
<td height="25" align="center" valign="middle" bgcolor="#C5D5E4"><strong>書名</strong></td>
<td width="21%" align="center" valign="middle" bgcolor="#C5D5E4"><strong>類別</strong></td>
<td width="17%" height="25" align="center" valign="middle" bgcolor="#C5D5E4"><strong>作者</strong></td>
<td width="17%" height="25" align="center" valign="middle" bgcolor="#C5D5E4"><strong>出版社</strong></td>
<td width="14%" height="25" align="center" valign="middle" bgcolor="#C5D5E4"><strong>出版時(shí)間</strong></td>
<td width="9%" align="center" valign="middle" bgcolor="#C5D5E4" ><strong>查看</strong></td>
</tr>
<%
For i=1 To x
%>
<tr>
<td height="25" align="center" valign="middle" bgcolor="#C5D5E4"><a href="show.asp?id=<%=rs("id")%>" class="d" target="_self"><%=rs("b_NAME")%></a></td>
<td align="center" valign="middle" bgcolor="#C5D5E4"><% id=rs("b_sort")
response.Write(conn.execute("select id,name from lb where id="&id)("name"))%></td>
<td height="25" align="center" valign="middle" bgcolor="#C5D5E4"><%=rs("b_WRITER")%></td>
<td height="25" align="center" valign="middle" bgcolor="#C5D5E4"><%=rs("b_CONCERN")%></td>
<td height="25" align="center" valign="middle" bgcolor="#C5D5E4"><%=rs("b_DATE")%></td>
<td align="center" valign="middle" bgcolor="#C5D5E4"><a href="show.asp?id=<%=rs("id")%>" class="d" target="_self">查看</a></td>
</tr>
<%
rs.movenext
next
%>
</table>
<%
call PageControl(iCount,maxpage,page,"border=0 align=center","<p align=center>")
end if
rs.close
set rs=nothing
Sub PageControl(iCount,pagecount,page,table_style,font_style)
Dim query, a, x, temp
action = "http://" & Request.ServerVariables("HTTP_HOST") & Request.ServerVariables("SCRIPT_NAME")
query = Split(Request.ServerVariables("QUERY_STRING"), "&")
For Each x In query
a = Split(x, "=")
If StrComp(a(0), "page", vbTextCompare) <> 0 Then
temp = temp & a(0) & "=" & a(1) & "&"
End If
Next
Response.Write("<table width=90% border=0 cellpadding=0 cellspacing=0 align=center >" & vbCrLf )
Response.Write("<form method=get onsubmit=""document.location = '" & action & "?" & temp & "Page='+ this.page.value;return false;""><TR>" & vbCrLf )
Response.Write("<TD align=center height=35>" & vbCrLf )
Response.Write(font_style & vbCrLf )
if page<=1 then
Response.Write ("首頁(yè) " & vbCrLf)
Response.Write ("上頁(yè) " & vbCrLf)
else
Response.Write("<A HREF=" & action & "?" & temp & "Page=1>首頁(yè)</A> " & vbCrLf)
Response.Write("<A HREF=" & action & "?" & temp & "Page=" & (Page-1) & ">上頁(yè)</A> " & vbCrLf)
end if
if page>=pagecount then
Response.Write ("下頁(yè) " & vbCrLf)
Response.Write ("尾頁(yè) " & vbCrLf)
else
Response.Write("<A HREF=" & action & "?" & temp & "Page=" & (Page+1) & ">下頁(yè)</A> " & vbCrLf)
Response.Write("<A HREF=" & action & "?" & temp & "Page=" & pagecount & ">尾頁(yè)</A> " & vbCrLf)
end if
Response.Write(" 頁(yè)次:" & page & "/" & pageCount & "頁(yè)" & vbCrLf)
Response.Write(" 共有" & iCount & "條" & vbCrLf)
Response.Write(" 轉(zhuǎn)到" & "<INPUT TYEP=TEXT NAME=page SIZE=2 Maxlength=5 VALUE=" & page & ">" & "頁(yè)" & vbCrLf & "<INPUT type=submit value=GO>")
Response.Write("</TD>" & vbCrLf )
Response.Write("</TR>" & vbCrLf )
Response.Write("</table>" & vbCrLf )
End Sub
%> </td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
<tr></tr>
</table></td>
</tr>
<tr>
<td height="60"><!--#include file="bottom.asp"--></td>
</tr>
</table>
</center>
</form>
</body>
</html>
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -