📄 searchresult.asp
字号:
<!--#include file="conn.asp"-->
<% if request.cookies("okadmin")="" and request.cookies("rank")="" then
response.redirect "login.asp"
end if %>
<%
set rs=server.createobject("adodb.recordset")
if request("chumaifang")="" and request("shoumaifang")="" and request("quyu")="" then
sqltext="select * from hetongb "
else
sqltext="select * from hetongb where "
end if
if request("chumaifang")<>"" then
sqltext=sqltext &" chumaifang like '%"& request("chumaifang") &"%' and "
end if
if request("shoumaifang")<>"" then
sqltext=sqltext &" shoumairen like '%"& request("shoumaifang") &"%' and "
end if
if request("quyu")<>"" then
sqltext=sqltext &" quyu like '%"& request("quyu") &"%' "
end if
sqltext=sqltext &" order by id desc"
'response.write ""&sqltext&""
'response.end
rs.open sqltext,conn,1,1
%>
<HTML><HEAD><TITLE>欢迎您光临房产信息网!</TITLE>
<META http-equiv=Content-Type content="text/html; charset=gb2312">
<LINK
href="../images/style.css" type=text/css rel=stylesheet>
<META content="Microsoft FrontPage 5.0" name=GENERATOR></HEAD>
<BODY text=#000000 bgColor=#666666 leftMargin=0 topMargin=0 marginwidth="0"
marginheight="0">
<TABLE cellSpacing=0 cellPadding=0 width=778 align=center border=0 height="556">
<TBODY>
<TR>
<TD align=middle width=610 bgColor=#ffffff valign="top" height="523">
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="98%" id="AutoNumber1">
<tr>
<TD>
<TABLE cellSpacing=0 cellPadding=0 width="100%" align=center
border=0>
<TBODY>
<TR>
<TD>
</TD></TR></TBODY></TABLE>
<br>
<%
dim MaxPerPage
MaxPerPage=200
'假如没有数据时
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 list
'call showpages
If Rs.recordcount > MaxPerPage then
'call showpages
end if
%>
<%
'显示帖子的子程序
Sub list()
%>
<TABLE class=p14 borderColor=#333333 cellSpacing=0
borderColorDark=#ffffff cellPadding=0 width="100%" align=center
borderColorLight=#666666 border=1 height="46">
<TBODY>
<TR>
<TD class=p14 width="21%" bgColor=#f3f3f3 height=22>
<DIV align=center>项目名称</DIV></TD>
<TD class=p14 width="15%" bgColor=#f3f3f3 height=22>
<DIV align=center>合同编号</DIV></TD>
<TD class=p14 width="20%" bgColor=#f3f3f3 height=22>
<p align="center">提交日期</TD>
<TD class=p14 width="24%" bgColor=#f3f3f3 height=22>
<p align="center"><span lang="zh-cn">出卖方</span></TD>
<TD class=p14 width="7%" bgColor=#f3f3f3 height=22>
<DIV align=center>修改</DIV></TD>
<TD class=p14 width="7%" bgColor=#f3f3f3 height=22>
<DIV align=center>删除</DIV></TD></TR>
<%
if not rs.eof then
i=0
do while not rs.eof
%> <TR>
<TD class=p14 align=middle width="21%" height="20"><A class=blue
href="infodetail.asp?id=<%=rs("id")%>"><%=rs("name")%></A> </TD>
<TD class=p14 align=middle width="15%" height="20"><%=rs("hetongid")%> </TD>
<TD class=p14 align=middle width="20%" height="20"><%=rs("dateandtime")%> </TD>
<TD class=p14 align=middle width="24%" height="20"><%=rs("chumaifang")%></TD>
<TD class=p14 align=middle width="7%" height="20"><a href="modify.asp?id=<%=rs("id")%>">
<font color="#000080">修改</font></a></TD>
<TD class=p14 align=middle width="7%" height="20"><a href="#" onclick="if (confirm('确实要将此条信息删除?')) window.location='del.asp?id=<%=rs("id")%>'">
<font color="#000080">删除</font></a></TD></TR>
<%
i=i+1
if i >= MaxPerpage then exit do
rs.movenext
loop
end if
%></TBODY></TABLE>
<%end sub%>
</TD>
</tr>
<tr>
<td width="100%"> </td>
</tr>
</table>
</TD></TR>
</TBODY></TABLE>
<%
'显示翻页的子程序
sub showpages()%>
<table border="0" cellPadding="0" cellSpacing="0" width="100%" >
<tr><td >
<%
response.write "<form method=Post action='all.asp'>"
%>
<input type=hidden name=userid value=<%=request("userid")%>>
<table border="0" cellPadding="0" cellSpacing="0" width="100%" height="30">
<tr>
<td class=main1>
<font color="#000000">
<p align="left">
<%
userid=request("userid")
Response.write "<font color='#000000'>分页-</font>"
If currentpage > 1 Then
response.write "<a href='all.asp?&page="+cstr(1)+"&userid="+userid+"'><font color='#000000'>首页</font></a><font color='#ffffff'><b>-</b></font>"
Response.write "<a href='all.asp?page="+Cstr(currentpage-1)+"&userid="+userid+"'><font color='#000000'>前页</font></a><font color='#ffffff'><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='all.asp?page="+Cstr(currentPage+1)+"&userid="+userid+"'><font color='#000000'>后页</font></a><font color='#ffffff'><b>-</b></font>"
Response.write "<a href='all.asp?page="+Cstr(Rs.PageCount)+"&userid="+userid+"'><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=main2>转到:</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>
</td></tr>
</table>
</form>
<%end sub%>
</BODY></HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -