⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 search.asp

📁 将所有产品、分类、特价、推荐、最新、品牌、热卖、新闻、公告、帮助页面生成静态购物系统
💻 ASP
字号:
<!--#include file="top.asp"-->
<div align="center"><table width=980 border=0 cellpadding=0 cellspacing=0 bgcolor="#FFFFFF">
<tr><td width=181 align="center" valign="top"><!--#include file="log.asp"--><!--#include file="insort.asp"--><script language="javascript" src="inven.asp?ven_id=1"></script></td>
<td align="center"> 
<table width="98%" height="5" border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
<%if request("action")="search" then
page=request("page")
if page="" then page=1
if not(isnumeric(page)) then page=1
if page<1 then page=1
page=int(page)
if request("sort_id")<>"0" then
sort_id=request("sort_id")
end if
hw_name=request("hw_name")
price1=request("price1")
if price1="" or not(isnumeric(price1)) then price1=0
price2=request("price2")
if price2="" or not(isnumeric(price2)) then price2=1000000000
if request("pinpai")<>"0" then
pinpai=request("pinpai")
end if
quehuo=request("quehuo")
if request("order")<>"" then 
order=request("order")
else
order="xu"
end if
if request("pagec")="" or Not(isNumeric(request("pagec"))) then
   pagec=25
else
   pagec=request("pagec")
end if
if hw_name<>"" then
sql="select * from [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
end if
if sort_id<>"" then sera=" and sort_id=" & sort_id & ""
if hw_name<>"" then serb=" and hw_name like '%" & hw_name & "%'"
if pinpai<>"" then serc=" and pinpai_id like '%" & pinpai & "%'"
if quehuo="1" then serd=" and hw_kucun>0"
if order="xu" then
sql="select * from hw where hw_price2>="&price1&" and hw_price2<="&price2&" " &sera&serb&serc&serd&"  order by hw_xu desc"
elseif order="price1" then
sql="select * from hw where hw_price2>="&price1&" and hw_price2<="&price2&" " &sera&serb&serc&serd&"  order by hw_price2 asc"
elseif order="price2" then
sql="select * from hw where hw_price2>="&price1&" and hw_price2<="&price2&" " &sera&serb&serc&serd&"  order by hw_price2 desc"
elseif order="time" then
sql="select * from hw where hw_price2>="&price1&" and hw_price2<="&price2&" " &sera&serb&serc&serd&"  order by hw_id desc"
end if
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 height="2" align="center">
<table width="98%" border="0" bgcolor="#F7F7F7"><tr><td style="border-left-width: 1px; border-right-width: 1px; border-top: 1px solid #C8C8C8; border-bottom: 1px solid #C8C8C8" bgcolor="#F7F7F7" height="25"> 
&nbsp; <%=rs.pagesize%>共<%=totalrec%>件商品,这是第<%=(page-1)*rs.pagesize+1%>-<%if page+1<=totalpage then%><%=page*rs.pagesize%><%else%><%=totalrec%><%end if%>件
排列:价格<a href="search.asp?action=search&sort_id=<%=sort_id%>&hw_name=<%=hw_name%>&pinpai=<%=pinpai%>&price1=<%=request("price1")%>&price2=<%=request("price2")%>&order=price1&pagec=<%=pagec%>">低-高</a>
&nbsp;<a href="search.asp?action=search&sort_id=<%=sort_id%>&hw_name=<%=hw_name%>&pinpai=<%=pinpai%>&price1=<%=request("price1")%>&price2=<%=request("price2")%>&order=price2&pagec=<%=pagec%>">高-低</a>
&nbsp;<a href="search.asp?action=search&sort_id=<%=sort_id%>&hw_name=<%=hw_name%>&pinpai=<%=pinpai%>&price1=<%=request("price1")%>&price2=<%=request("price2")%>&order=time&pagec=<%=pagec%>">上架时间</a></td></tr>
</table></td></tr>
<tr> <td width="100%"> <table width="98%" border="0" cellpadding="0" cellspacing="0"><%if lookt="image" then
i=0
do while not rs.eof and (i<rs.pagesize)
i=i+1%><tr><td width="25%" height="134" align="center"><!--#include file="insimage.asp"--></td></tr><%rs.movenext
loop
else%><tr><%i=0
do while not rs.eof and (i<rs.pagesize)
i=i+1%><td width="25%" height="134" align="center"><!--#include file="ins.asp"--></td>
<%if (i mod lookhang=0) and i>=lookhang then%></tr><tr><%end if
rs.movenext
loop%></tr><%end if%></table></td></tr>
<form action="<%=filename%>?action=search&sort_id=<%=sort_id%>&hw_name=<%=hw_name%>&pinpai=<%=pinpai%>&price1=<%=request("price1")%>&price2=<%=request("price2")%>&quehuo=<%=quehuo%>&order=<%=order%>&pagec=<%=pagec%>" method=post>
<tr><td height="23" align="center"> 
第<%=page%>页/共<%=totalpage%>页&nbsp;&nbsp;
<%if page-1>0 then%><a href="search.asp?action=search&page=<%=page-1%>&sort_id=<%=sort_id%>&hw_name=<%=hw_name%>&pinpai=<%=pinpai%>&price1=<%=request("price1")%>&price2=<%=request("price2")%>&quehuo=<%=quehuo%>&order=<%=order%>&pagec=<%=pagec%>">上一页</a><%else%>上一页<%end if%>&nbsp;&nbsp;
<%if page+1<=totalpage then%> <a href="search.asp?action=search&page=<%=page+1%>&sort_id=<%=sort_id%>&hw_name=<%=hw_name%>&pinpai=<%=pinpai%>&price1=<%=request("price1")%>&price2=<%=request("price2")%>&quehuo=<%=quehuo%>&order=<%=order%>&pagec=<%=pagec%>">下一页</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></td></tr></form><%end if%><%end if
rs.close%></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>
<td width="223"><input type="checkbox" name="quehuo" value="1"<%if request("quehuo")="1" then response.write" checked"%>>不显示缺货</td></tr>
<tr><td align="right" width="100">选择分类:</td><td colspan="2" width="423"><%rs.open "select * from 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 request("sort_id")<>"0" and int(request("sort_id"))=rs("sort_id") then%> selected<%end if%>><%=rs("sort_name")%></option>
<%rs.movenext
loop
rs.close%></select></td></tr>
<tr><td align="right" width="100">选择品牌:</td>
<td colspan="2" width="423"><%rs.open "select * from pinpai order by pinpai_id DESC",conn,1,1%><select name="pinpai">
<option value="0">查讯所有品牌</option><%do while not rs.eof%>
<option value="<%=rs("pinpai_id")%>"<%if request("pinpai")<>"0" and int(request("pinpai"))=rs("pinpai_id") then%> selected<%end if%>><%=rs("pinpai_name")%></option>
<%rs.movenext
loop
rs.close%></select></td></tr>
<tr><td align="right" width="100">价格范围:</td><td colspan="2" 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="3" width="100%">热门搜索:<%
sql="select top 10 * from [search] order by hits desc"
rs.open sql,conn,1,1
if rs.eof then
response.write "没有数据"
else
do while not rs.eof%><a href="search.asp?action=search&hw_name=<%=rs("search_name")%>"><%=rs("search_name")%></a>,
<%rs.movenext
loop
rs.close
end if
%></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" name="imageField" 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="copy.asp"-->

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -