<!--#include file="conn.asp"-->
<%call head()%>
<%
title=request("title")
p=cint(request("p"))
if p="" or p<1 then p=1
Call saycarda("搜索结果")
%>
<!--#INCLUDE file="../bbs/sy1.asp"-->


<%
pag=10
set rs=Server.CreateObject("ADODB.Recordset")
rsstr="select * from [shop_xx] where (name like '%" & title & "%') order by [id] desc"
rs.open rsstr,connshop,1,2

if rs.eof and rs.bof then
 response.write("没有你想找的商品哦<br/>")
	else
maxpage=int((rs.recordcount-1)/pag)+1
if p>maxpage then p=maxpage

response.write("搜索结果" & rs.recordcount & "个<br/>")
rs.Move((p-1)*pag)
dim j
j=1

response.write("---------<br/>")
do while ((not rs.EOF) and j<=clng(pag))

%>
<%=((p-1)*pag+j)%>.<a href='view.asp?sid=<%=sid%>&amp;id=<%=rs("id")%>'><%=ubb(rs("name"))%></a><br/>
<%
rs.MoveNext
j=j+1
loop
end if

if p*pag<rs.recordcount then response.write("<a href='searchok.asp?sid=" & sid & "sear=" & sear & "&amp;search=" & search & "&amp;p=" & p+1 & "'>[下页]</a>")
if p>1 then response.write("<a href='searchok.asp?sid=" & sid & "&amp;sear=" & sear & "&amp;search=" & search & "&amp;p=" & p-1 & "'>[上页]</a>")
if p*pag<rs.recordcount or p>1 then response.write("<br/>")
if p*pag<rs.recordcount or p>1 then response.write("(第" & p & "/" & (int((rs.recordcount-1)/pag)+1) & "页)<br/>")
%>
<%if p*pag<rs.recordcount or p>1 then%>
<input name="page<%=minute(now)%><%=second(now)%>" title="页码" type="text" format="*N" emptyok="true" size="3" maxlength="4" value="<%if p>=maxpage then response.write(p-1) else response.write(p+1)%>"/>
<anchor>[跳转页面]
    <go href="searchok.asp?sid=<%=sid%>&amp;sear=<%=sear%>&amp;search=<%=search%>" accept-charset='utf-8'>
        <postfield name="p" value="$(page<%=minute(now)%><%=second(now)%>)"/>
    </go>
</anchor><br/>
<%end if%>
---------<br/>
<a href="search.asp?sid=<%=sid%>">详细搜索</a>
<!--#include file="fanhui.asp"-->

<%Call headsay()
rs.close
set rs=nothing
connshop.close
set connshop=nothing
%>