gusucode.com > 爱美尔女性商城源码 1.0源码程序 > search.asp
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <!--#include file="conn.asp"--> <!--#include file="webconfig.asp"--> <% mkey=request("mkey") if mkey<>""then tj3="and bookname like '%"&mkey&"%'" else tj3="" end if if orderby<>""then if orderby="priceasc" then tj5="order by huiyuanjia asc" elseif orderby="pricedesc" then tj5="order by huiyuanjia desc" elseif orderby="datetime" then tj5="order by adddate asc" elseif orderby="datetimedesc" then tj5="order by adddate desc" end if else tj5="" end if %> <meta http-equiv="Content-Type" content="text/html; charset=gb2312" /> <title><%=mkey%>搜索--<%=webname%></title> <meta name="keywords" content="<%=keywords%>" /> <meta name="description" content="<%=description1%>" /> <link href="css/style.css" rel="stylesheet" type="text/css" /> <script type="text/javascript" src="js/jquery.js"></script> <script type="text/javascript" src="js/jquery.idtabs.js"></script> <script type="text/javascript" src="js/swf.js"></script> </head> <body> <!--#include file="top.asp" --> <table width="995" border="0" cellspacing="0" cellpadding="0"> <tr> <td height="20"><div align="center"></div></td> </tr> </table> <table width="995" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td width="189" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td style="background:url(images/index_left_top.gif) top no-repeat left; height:50px;"> </td> </tr> </table> <!--#include file="left.asp"--> </td> <td width="10" valign="top"><div align="center"></div></td> <td valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td><a href="<%=url7%>"><img src="<%=pic7%>" width="800" height="95" /></a></td> </tr> </table> <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td height="40">您当前的位置: <a title="" href="index.asp" alt="">首页</a> >> <b><%=mkey%>搜索</b> </td> </tr> </table> <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td height="10"><div align="center"></div></td> </tr> </table> <% set rs=server.createobject("adodb.recordset") rs.open "select * from BJX_goods where (1=1) "&tj3&" "&tj53&"",conn,1,1 if rs.recordcount=0 then %> <table width="100%" cellpadding="0" cellspacing="0"> <tr valign="top"> <td width="25%" align="center" id="pdt-916" product="916">暂无内容</td> </tr> </table> <% else rs.PageSize =20 '每页记录条数 iCount=rs.RecordCount '记录总数 iPageSize=rs.PageSize maxpage=rs.PageCount page=request("page") if Not IsNumeric(page) or page="" then page=1 else page=cint(page) end if if page<1 then page=1 elseif page>maxpage then page=maxpage end if rs.AbsolutePage=Page if page=maxpage then x=iCount-(maxpage-1)*iPageSize else x=iPageSize end if %> <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td height="30"><div>总共找到<font style="color:#FF0000"><%=iCount%></font>个商品</div></td> </tr> </table> <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td><font style="color:#ff0000;"><%=page%></font>/<%=maxpage%></td> <td align="right">排序方式: <select name="orderby" onchange="window.location='search.asp?mkey=<%=mkey%>&orderby=' + this.options[this.selectedIndex].value; "> <optgroup label="排序"> <option selected="selected" value="">默认</option> <option value="datetimedesc">按发布时间 新->旧</option> <option value="datetime">按发布时间 旧->新</option> <option value="pricedesc">按价格 从高到低</option> <option value="priceasc">按价格 从低到高</option> <option value="">访问周次数</option> <option value="">总访问次数</option> <option value="">周购买次数</option> <option value="">总购买次数</option> <option value="">评论次数</option> </optgroup> </select></td> </tr> </table> <table width="100%" cellpadding="0" cellspacing="0"> <tr valign="top"> <% ii=0 For i=1 To x %> <td width="25%" align="center" id="pdt-916" product="916"><div> <div><a href="#" target="_blank"></a></div> <div> <table border="0" cellspacing="0" cellpadding="0" width="100%"> <tbody> <tr> <td height="170" align="center"><a href="showpro.asp?id=<%=rs("bookid")%>" target="_blank"><img alt="<%=rs("bookname")%>" src="<%=rs("bookpic")%>" width="150" height="150" style="border:1px solid #ccc;" /></a></td> </tr> <tr> <td align="center"><a title="ZA 沁漾保湿眼霜 20g" href="showpro.asp?id=<%=rs("bookid")%>"><%if len(trim(rs("bookname")))>15 then response.write left(trim(rs("bookname")),12)&".." else response.write trim(rs("bookname")) end if%></a></td> </tr> <tr> <td align="center" style="color:#ff3399; font-weight:bold;">¥<%=formatnumber(rs("shichangjia"),2)&"元"%></td> </tr> <tr> <td align="center" style="color:#ff3399; font-weight:bold;">¥<%=formatnumber(rs("huiyuanjia"),2)&"元"%></td> </tr> <tr> <td height="40" align="center" style="color:#ff3399; font-weight:bold;"><a href="ShoppingCart.asp?id=<%=rs("bookid")%>&action=add" target="_blank"><img src="images/bt2.gif" width="100" height="25" /></a> <a href="shoucang.asp?id=<%=rs("bookid")%>&action=add" target="_blank"><img src="images/bt3.gif" width="62" height="25" /></a></td> </tr> </tbody> </table> </div> </div></td> <%rs.movenext ii=ii+1%> <%if ii mod 4 =0 then%> </tr> <%end if%> <% next%> </table> <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td height="40" align="center"><% call PageControl(iCount,maxpage,page,"border=0 align=center","<p align=center>") rs.close set rs=nothing Sub PageControl(iCount,pagecount,page,table_style,font_style) '生成上一页下一页链接 Dim query, a, x, temp action = "http://" & Request.ServerVariables("HTTP_HOST") & Request.ServerVariables("SCRIPT_NAME") query = Split(Request.ServerVariables("QUERY_STRING"), "&") For Each x In query a = Split(x, "=") If StrComp(a(0), "page", vbTextCompare) <> 0 Then temp = temp & a(0) & "=" & a(1) & "&" End If Next Response.Write("<table width=100% border=0 cellpadding=0 cellspacing=0 >" & vbCrLf ) Response.Write("<form method=get onsubmit=""document.location = '" & action & "?" & temp & "Page='+ this.page.value;return false;""><TR >" & vbCrLf ) Response.Write("<TD align=center height=40>" & vbCrLf ) Response.Write(font_style & vbCrLf ) if page<=1 then Response.Write ("首 页 " & vbCrLf) Response.Write ("上一页 " & vbCrLf) else Response.Write("<A HREF=" & action & "?" & temp & "Page=1>首 页</A> " & vbCrLf) Response.Write("<A HREF=" & action & "?" & temp & "Page=" & (Page-1) & ">上一页</A> " & vbCrLf) end if if page>=pagecount then Response.Write ("下一页 " & vbCrLf) Response.Write ("尾 页 " & vbCrLf) else Response.Write("<A HREF=" & action & "?" & temp & "Page=" & (Page+1) & ">下一页</A> " & vbCrLf) Response.Write("<A HREF=" & action & "?" & temp & "Page=" & pagecount & ">尾 页</A> " & vbCrLf) end if Response.Write(" 页次:" & page & "/" & pageCount & "页" & vbCrLf) Response.Write(" 共有" & iCount & "条产品" & vbCrLf) Response.Write(" 转到" & "<INPUT CLASS=wenbenkuang TYEP=TEXT NAME=page SIZE=2 Maxlength=5 VALUE=" & page & ">" & "页" & vbCrLf & "<INPUT CLASS=go-wenbenkuang type=submit value=GO>") Response.Write("</TD>" & vbCrLf ) Response.Write("</TR></form>" & vbCrLf ) Response.Write("</table>" & vbCrLf ) End Sub %></td> </tr> </table> <%end if%> </td> </tr> </table> <!--#include file="bottom.asp" --> </body> </html>