www.gusucode.com > 凡人网络购物系统 2008源码程序 > search.asp

    <!--#include file="conn.asp"-->
<!--#include file="IncAsp/venshop_top.asp"-->
<div align="center">
<table cellpadding="0" cellspacing="0" class="all_t1">
<tr><td class="all_l_td" valign="top">
<!--#include file="IncAsp/venshop_log.asp"--><div class="d5"></div><!--#include file="IncAsp/venshop_sort.asp"--><div class="d5"></div>
</td>
<td valign="top" class="all_c_td">
<table width="99%" border="0" cellpadding="0" cellspacing="0">
<%
if request("action")="search" then
order=request("order")
page=request("page")
orderx=getorder(order)
page=getpage(page)
sert=sert&"&order="&order
hw_name=request("hw_name")
if hw_name<>"" then
set rs=server.createobject("adodb.recordset")
sql="select * from venshop_search where search_name='"&hw_name&"'"
rs.open sql,conn,1,3
if rs.eof then
rs.addnew
rs("search_name")=hw_name
rs("hits")=1
else
rs("hits")=rs("hits")+1
end if
rs.update
rs.close
set rs=nothing
hwn=split(hw_name," ")
for i=0 to ubound(hwn)
hwna=trim(hwn(i))
if hwna<>" " and hwna<>"" then
sera=sera&" and hw_name like '%"&hwna&"%'"
end if
next
sert=sert&"&hw_name="&hw_name
end if
price1=DelStr(request("price1"))
if price1="" or not(isnumeric(price1)) then price1=0
price2=DelStr(request("price2"))
if price2="" or not(isnumeric(price2)) then price2=1000000000
sert=sert&"&price1="&price1
sert=sert&"&price2="&price2
if request("pagec")="" or Not(isNumeric(request("pagec"))) then
   pagec=25
else
   pagec=DelStr(request("pagec"))
end if
sert=sert&"&pagec="&pagec
sort_id=Request("sort_id")
if sort_id<>"" and sort_id<>0 then
chkid(sort_id)
sera=sera&" and sort_id=" & sort_id & ""
sert=sert&"&sort_id="&sort_id
end if
pinpai=request("pinpai")
if pinpai<>"" and pinpai<>0 then
chkid(pinpai)
sera=sera&" and pinpai_id=" & pinpai & ""
sert=sert&"&pinpai="&pinpai
end if
set rs=server.createobject("adodb.recordset")
sql="select hw_id,hw_name,hw_price1,hw_price2,hw_pic,hw_content from venshop_hw where hw_price2>="&price1&" and hw_price2<="&price2&" " &sera&"  order by "&orderx&""
rs.open sql,conn,1,1
if rs.eof then%><tr><td align="center" height="30">你所选的类别没有商品</td></tr><%else
rs.pagesize=pagec
totalrec=rs.recordcount
totalpage=rs.pagecount
if page>totalpage then page=totalpage
rs.absolutepage=page
rs.cachesize=rs.pagesize%>                
<tr><td class="sort">&nbsp;<IMG src="Skin/<%=venshop_skin%>/home.gif" border=0 align="absmiddle"> 您的位置:  
	<a href="index.asp">首页</a> >>&nbsp;商品查询&nbsp;(共<%=totalrec%>件商品,
这是第<%=(page-1)*rs.pagesize+1%>-<%if page+1<=totalpage then%><%=page*rs.pagesize%><%else%><%=totalrec%><%end if%>件)
</td></tr>
<tr><td height=5></td></tr>
<tr><td width="100%" align="center" style="border: 1px solid #E1E1E1">
<!--#include file="IncAsp/venshop_ins.asp"-->
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<form action="<%=filename%>?action=search<%=sert%>" method=post>
<tr><td height="2"></td></tr>
<tr><td height="23" class="sortb"> 
<p style="line-height: 150%; margin: 5px">第<%=page%>页/共<%=totalpage%>页&nbsp;&nbsp;
<%if page-1>0 then%><a href="search.asp?action=search&page=<%=page-1%><%=sert%>">上一页</a><%else%>上一页<%end if%>&nbsp;&nbsp;
<%if page+1<=totalpage then%> <a href="search.asp?action=search&page=<%=page+1%><%=sert%>">下一页</a><%else%>下一页<%end if%>&nbsp;&nbsp;
页面跳转:<input type="text" name="page" value="<%=page+1%>" size="1" style="text-align: center" class=input><input type="submit" value="GO" class=input><br>
选择页数:<%for i=1 to totalpage
if i=page then%>
<font color="#FF0000"><b><%=i%></b></font>
<%else%>
<a href="search.asp?action=search&page=<%=i%><%=sert%>"><%=i%></a>
<%end if
next%></td></tr></form></table>
</td></tr>
<%end if%><%
rs.close
set rs=nothing
end if%></table>
<table width="581" border="0" cellpadding="0" cellspacing="0"><form method="POST" action="search.asp?action=search">
<tr><td height="41"><img border="0" src="img/s-0.gif" width="581" height="41"></td></tr>
<tr><td background="img/s-1.gif" align="center">
<table border="0" cellpadding="5" cellspacing="0" width="90%">
<tr><td align="right" width="100">关键字:</td>
<td width="200"><input type="text" name="hw_name" size="20" class=input value="<%=request("hw_name")%>"></td>
</tr>
<tr><td align="right" width="100">选择分类:</td><td width="423"><%set rs=server.createobject("adodb.recordset")
rs.open "select sort_id,sort_name from venshop_sort order by sort_id DESC",conn,1,1%>
<select name="sort_id"><option value="0">查询所有分类</option>
<%do while not rs.eof%>
<option value="<%=rs("sort_id")%>"<%if int(request("sort_id"))=rs("sort_id") then%> selected<%end if%>><%=rs("sort_name")%></option>
<%rs.movenext
loop
rs.close
set rs=nothing%></select></td></tr>
<tr><td align="right" width="100">选择品牌:</td>
<td width="423"><select name="pinpai">
<option value="0">查询所有品牌</option>
<%set rs=server.createobject("adodb.recordset")
rs.open "select pinpai_id,pinpai_name from venshop_pinpai order by pinpai_id DESC",conn,1,1%><%do while not rs.eof%>
<option value="<%=rs("pinpai_id")%>"<%if int(request("pinpai"))=rs("pinpai_id") then%> selected<%end if%>><%=rs("pinpai_name")%></option>
<%rs.movenext
loop
rs.close
set rs=nothing%></select></td></tr>
<tr><td align="right" width="100">价格范围:</td><td width="423">
<input type="text" name="price1" size="3" class=input value="<%=request("price1")%>"> -
<input type="text" name="price2" size="3" class=input value="<%=request("price2")%>"></td></tr>
<tr><td colspan="2" width="100%">热门搜索:<%call getsearch(10,10,"")%></td></tr></table></td></tr>
<tr><td height="86"><img border="0" src="img/s-2.gif" width="581" height="86"></td></tr>
<tr><td align="center" background="img/s-1.gif"><table width="90%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr><td height="30" width="100" align="right">排列方式:</td><td height="30" width="423"><select size="1" name="order">
<option selected value="">默认</option>
<option value="price1">价格由低到高</option>
<option value="price2">价格由高到低</option>
<option value="time">添加时间</option></select></td></tr>
<tr><td height="30" width="100" align="right">每页数量:</td><td height="30" width="423"><select size="1" name="pagec">
<option>10</option>
<option selected>25</option>
<option>50</option>
<option>100</option></select></td></tr>
<tr><td width="100" height="30"></td><td height="30" width="423"><input type="submit" value="提交查询" style="height:23;width:107"></td></tr>
</table></td></tr>
<tr><td height="17"><img border="0" src="img/s-3.gif" width="581" height="17"></td></tr></form>
</table></td></tr></table></div><!--#include file="IncAsp/venshop_copy.asp"-->