<!-- #include file="Inc/Inc.asp" -->
<!-- #include file="Inc/Function.asp" -->


<%call head()
Call saycardd("搜索结果")
dim keyword,sear
keyword=request("keyword")
if keyword="" then
  Call Error("关键字不能为空！")
  end if
sear=request("sear")
if sear="" or IsNumeric(sear)=False then
  Call Error("搜索类型无效！")
  end if
if sear=1 then
set rs=Server.CreateObject("ADODB.Recordset")
rs.open"select * from wjfile where typeID=1 and name like '%" & keyword & "%' order by [ID] desc",conn,1,1
else
set rs=Server.CreateObject("ADODB.Recordset")
rs.open"select * from wjfile where typeID=1 and title like '%" & keyword & "%' order by [ID] desc",conn,1,1
end if
If Not rs.eof	Then
Dim PageSize,i
	PageSize=10							
	Dim Count,page,pagecount,gopage	
	gopage="soft_search.asp?keyword="&keyword&"&amp;sear="&sear&"&amp;sid="&sid&"&amp;"
	Count=rs.recordcount
	page=int(request.QueryString ("page"))
	if page<=0 or page="" then page=1    
	pagecount=(count+pagesize-1)\pagesize
        if page>pagecount then page=pagecount	
	rs.move(pagesize*(page-1))
        response.write ("共:"&count&"条相关图片<br/>")				
	For i=1 To PageSize       						
	If rs.eof Then Exit For				
Response.write "<a href=""soft_view.asp?class="&rs("lid")&"&amp;id="&rs("id")&"&amp;cid="&rs("idd")&"&amp;sid="&sid&""">"&i+(page-1)*PageSize&"."&ubb(rs("name"))&"</a><br/>" 
	rs.moveNext 								
	Next	
	if page-pagecount<0 then response.write "<a href="""&gopage&"page="&page+1&""">下页</a>"
	if page>1 then response.write "<a href="""&gopage&"page="&page-1&""">上页</a>"
	if pagecount>1 then response.write "<br/><b>"&page&"</b>/"&pagecount&"页<input name=""page"" format=""*N"" value="""&page&""" type=""text"" maxlength=""5"" emptyok=""true"" size=""3""/><a href="""&gopage&"page=$(page)"">[GO]</a><br/>"
Else
response.write"没有符合条件的图片<br/>"
end if
rs.close
set rs=nothing
conn.close
set conn=nothing
response.write"----------<br/>"
response.write"<anchor>返回上级<prev/></anchor>"
response.write"<br/><a href='index.asp ?sid="&sid&"'>返回首页</a>"

%>    
<%call headsay()%>                        