<!--#include file="conn.asp"-->
<!--#include file="webconfig.asp"-->
<%if IsNumeric(request.QueryString("jiage"))=False then
        response.write"<script>alert(""输入错误，如有疑问请联系管理员！"");location.href=""index.asp"";</script>"
        response.end
	end if
dim action,searchkey,anclassid,jiage,selectname
anclassid=request("anclassid")
searchkey=request("searchkey")
jiage=request("jiage")
action=request("action")
selectname=request("selectname")
if InStr(searchkey,"'")>0 then
response.write"<script>alert(""非法访问!"");location.href=""../index.asp"";</script>"
response.end
end if
if anclassid<>"" then
if not isnumeric(anclassid) then 
response.write"<script>alert(""非法访问!"");location.href=""../index.asp"";</script>"
response.end
else
if not isinteger(anclassid) then
response.write"<script>alert(""非法访问!"");location.href=""../index.asp"";</script>"
end if
end if
end if

if jiage<>"" then
if not isnumeric(jiage) then 
response.write"<script>alert(""非法访问!"");location.href=""../index.asp"";</script>"
response.end
else
if not isinteger(jiage) then
response.write"<script>alert(""非法访问!"");location.href=""../index.asp"";</script>"
end if
end if
end if

if action<>"" then
if not isnumeric(action) then 
response.write"<script>alert(""非法访问!"");location.href=""../index.asp"";</script>"
response.end
else
if not isinteger(action) then
response.write"<script>alert(""非法访问!"");location.href=""../index.asp"";</script>"
end if
end if
end if

%>
<HTML><HEAD><TITLE><%=webname%>--商品搜索结果</TITLE>
<meta name="description" content="免费开店 网上开店 免费网上开店 网上购物 电脑 网络 软件 随身视听 家用电器 音响 照相机 摄像机 数码产品 手机 电话 鲜花 玩具 礼品 游戏 汽车 摩托 服装 鞋帽 箱包 服饰 香水 彩妆 化妆品 保健品 珠宝首饰 影视 音乐 音像 动漫 办公用品 设备 耗材 运动休闲 户外野营 居家 日用 装饰 宠物 邮币 古董 字画 收藏 乐器 明星 工艺品 游戏卡 电话卡 邮箱卡 成人用品 情趣用品"> 
<meta name="keywords" content="免费开店,网上开店,免费网上开店,网上购物">
<META http-equiv=Content-Type content='text/html; charset=gb2312'>
<LINK href=imagess/shop.css type=text/css rel=stylesheet>
<style type="text/css">
<!--
.gogo {
	border-bottom-width: 1px;
	border-bottom-style: solid;
	border-bottom-color: #CCCCCC;
}
.style5 {color: #FF0000}
.style6 {color: #FFFFFF}
.style7 {
	color: #CCCCCC;
	font-weight: bold;
}
.style8 {color: #000000}
.unnamed1 {
	border-bottom-width: 1px;
	border-bottom-style: solid;
	border-bottom-color: #CCCCCC;
}
-->
</style>
</HEAD>
<NOSCRIPT><IFRAME SRC=*.html></IFRAME></NOSCRIPT>
<!--#include file=top.asp-->
<table width="98%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr> 
<td height=25>
        <%if jiage="" then%>
            <%if searchkey="" then
		response.write "<script language=javascript>alert('对不起，请您输入查讯关键字');history.go(-1);</script>"
		response.End
	      else
		response.write "　您查讯的关键字是：　"
		if anclassid<>0 then
			set rs=server.CreateObject("adodb.recordset")
			rs.open "select * from shop_anclass where anclassid="&anclassid,conn,1,1
			response.write "<a href=class.asp?lx=big&anid="&anclassid&"><font color=red>"&rs("anclass")&"</font></a>"&" &gt;&gt; "
			rs.close
			set rs=nothing
		end if
		response.write "<font color=red>"&searchkey&"</font>"
		s_bookname=searchkey
	      end if%>
        <%else%>
            <%if (action="1" or action="3") and searchkey="" then
		response.write "<script language=javascript>alert('对不起，请您输入查讯关键字');history.go(-1);</script>"
		response.End
	      else
	        response.write "　您查讯的关键字是：　"
		if anclassid<>0 then
			set rs=server.CreateObject("adodb.recordset")
			rs.open "select * from shop_anclass where anclassid="&anclassid,conn,1,1
			response.write "<a href=class.asp?lx=big&anid="&anclassid&"><font color=red>"&rs("anclass")&"</font></a>"&" &gt;&gt; "
			rs.close
			set rs=nothing
		end if
		if action="1" or action="3" then 
			response.write "<font color=red>"&searchkey&"</font>"
			s_bookname=searchkey
		else
			response.write "<font color=red>"&selectname&"</font>"
			s_bookname=selectname
end if
end if%>
<%end if%>
</td>
</tr>
</table>
<table width="98%" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td><%'开始分页
				Const MaxPerPage=20
   				dim totalPut   
   				dim CurrentPage
   				dim TotalPages
   				dim j
   				dim sql
    				if Not isempty(request("page")) then
      				currentPage=Cint(request("page"))
   				else
      				currentPage=1
   				end if 

if jiage="" then  '//普通查询
sql2="searchkey="&searchkey&"&anclassid="&anclassid
select case request("anclassid")
case "0"
sql1=" bookname like '%"&searchkey&"%' "
case else
sql1=" bookname like '%"&searchkey&"%' and anclassid="&request("anclassid")&" "
end select
else
'//高级查讯
sql2="searchkey="&searchkey&"&anclassid="&anclassid&"&jiage="&jiage&"&action="&action&"&selectname="&selectname
if anclassid<>0 then  '//判断查讯分类,分类不为空。  
select case action
case "1"
sql1=" bookname like '%"&searchkey&"%' and (shichangjia<"&jiage&" or huiyuanjia<"&jiage&" or vipjia<"&jiage&") and anclassid="&anclassid&" "
case "2"
sql1=" pingpai like '%"&selectname&"%' and (shichangjia<"&jiage&" or huiyuanjia<"&jiage&" or vipjia<"&jiage&") and anclassid="&anclassid&" "
case "3"
sql1=" bookcontent like '%"&selectname&"%' and (shichangjia<"&jiage&" or huiyuanjia<"&jiage&" or vipjia<"&jiage&") and anclassid="&anclassid&" "
end select
else
'//分类为空。
select case action
case "1"
sql1=" bookname like '%"&searchkey&"%' and (shichangjia<"&jiage&" or huiyuanjia<"&jiage&" or vipjia<"&jiage&") "
case "2"
sql1=" pingpai like '%"&selectname&"%' and (shichangjia<"&jiage&" or huiyuanjia<"&jiage&" or vipjia<"&jiage&") "
case "3"
sql1=" bookcontent like '%"&selectname&"%' and (shichangjia<"&jiage&" or huiyuanjia<"&jiage&" or vipjia<"&jiage&") "
end select
end if
end if
call sss()
set rs=server.CreateObject("adodb.recordset")
rs.open "select * from shop_books where "&sql1&" order by adddate desc",conn,1,1	
  				if rs.eof And rs.bof then
       				Response.Write "<p align=center> 对不起，没有查讯到您需要的商品！</p><br>"
   				else
	  				totalPut=rs.recordcount

      				if currentpage<1 then
          				currentpage=1
      				end if

      				if (currentpage-1)*MaxPerPage>totalput then
	   					if (totalPut mod MaxPerPage)=0 then
	     					currentpage= totalPut \ MaxPerPage
	   					else
	      					currentpage= totalPut \ MaxPerPage + 1
	   					end if
      				end if

       				if currentPage=1 then
            			showContent
            			showpage totalput,MaxPerPage,"research.asp"
       				else
          				if (currentPage-1)*MaxPerPage<totalPut then
            				rs.move  (currentPage-1)*MaxPerPage
            				dim bookmark
            				bookmark=rs.bookmark
            				showContent
             				showpage totalput,MaxPerPage,"research.asp"
        				else
	        				currentPage=1
           					showContent
           					showpage totalput,MaxPerPage,"research.asp"
	      				end if
	   				end if
   				   				end if

   				sub showContent
       			dim i
	   			i=0
			%></td>
  </tr>
</table>
<table width="98%" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td height="5" colspan="2"></td>
  </tr>
  <tr>
    <td width="190" align="center" valign="top"> 
      <table width="190" border="0" cellspacing="0" cellpadding="0">
        <tr> 
          <td width="86" background="imagess/please_list_left_1.gif"><b><font color="ffffff"> 
            &nbsp;</font><FONT color=#ffffff>产品分类浏览</FONT></b></td>
          <td width="104" align="right" background="imagess/please_list_left_2.gif">
			<IMG SRC="imagess/please_list_left_3.gif" WIDTH=5 HEIGHT=29 ALT=""></td>
        </tr>
      </table>
      <table width="190" border="0" cellspacing="0" cellpadding="0">
        <tr> 
          <td width="1" bgcolor="0055AF"></td>
          <td width="188">           
          <td width="1" bgcolor="0055AF"></td>
        </tr>
        <tr>
          <td width="1" bgcolor="0055AF"></td>
          <td><table width="100%" border="0" cellspacing="0" cellpadding="0">
              <tr> 
                <td> <tr><td height=22 colspan=3>&nbsp;<span class="style1"><a href="class.asp?lx=big&anid=32" target="_blank"><u>手机/通讯设备/卡</u></a></span><br>
          &nbsp;<span class="style1"><a href="class.asp?lx=big&anid=33" target="_blank"><u>电影/电视/曲艺</u></a></span><br>
		  &nbsp;<span class="style1"><a href="class.asp?lx=big&anid=34" target="_blank"><u>电脑/软件/网络/办公</u></a></span><br>
          &nbsp;<span class="style1"><a href="class.asp?lx=big&anid=35" target="_blank"><u>化妆品/香水/护肤品</u></a></span> <br>
          &nbsp;<span class="style1"><a href="class.asp?lx=big&anid=36" target="_blank"><u>数码相机/摄像摄影</u></a></span><br>
          &nbsp;<span class="style1"><a href="class.asp?lx=big&anid=37" target="_blank"><u>家居日用/休闲食品/电器</u></a></span><br>
         &nbsp;<span class="style1"><a href="class.asp?lx=big&anid=38" target="_blank"><u>随身视听/音响/家电</u></a></span><br>
         &nbsp;<span class="style1"><a href="class.asp?lx=big&anid=43" target="_blank"><u>动漫/音乐</u></a></span><br>
         &nbsp;<span class="style1"><a href="class.asp?lx=big&anid=40" target="_blank"><u>男女服装/童装</u></a></span><br>
         &nbsp;<span class="style1"><a href="class.asp?lx=big&anid=41" target="_blank"><u>珠宝首饰/手表/眼镜</u></a></span><br>
         &nbsp;<span class="style1"><a href="class.asp?lx=big&anid=39" target="_blank"><u>礼品/鲜花/文具</u></a></span><br>
         &nbsp;<span class="style1"><a href="class.asp?lx=big&anid=42" target="_blank"><u>书籍/报纸/杂志</u></a></span><br>
         &nbsp;<span class="style1"><a href="class.asp?lx=big&anid=44" target="_blank"><u>汽车/摩托/自行车</u></a></span><br>
         &nbsp;<span class="style1"><a href="class.asp?lx=big&anid=45" target="_blank"><u>邮币/古董/字画/收藏</u></a></span><br>
          &nbsp;<span class="style1"><a href="class.asp?lx=big&anid=46" target="_blank"><u>运动休闲/防身用品</u></a></span><br>
         &nbsp;<span class="style1"><a href="class.asp?lx=big&anid=48" target="_blank"><u>鞋帽/箱包/服饰配件</u></a></span><br>
        &nbsp;<span class="style1"><a href="class.asp?lx=big&anid=49" target="_blank"><u>工艺品/乐器/明星</u></a></span><br>
          &nbsp;<span class="style1"><a href="class.asp?lx=big&anid=50" target="_blank"><u>宠物用品/宠物</u></a></span><br>
         &nbsp;<span class="style1"><a href="class.asp?lx=big&anid=51" target="_blank"><u>住宅/商铺/办公楼租售</u></a></span><br>
         &nbsp;<span class="style1"><a href="class.asp?lx=big&anid=52" target="_blank"><u>保健品/器械/成人用品</u></a></span><br>
         &nbsp;<span class="style1"><a href="class.asp?lx=big&anid=53" target="_blank"><u>五花八门/其它</u></a></span><br>
         &nbsp;<span class="style1"><a href="class.asp?lx=big&anid=54" target="_blank"><u>网游物品/装备</u></a></span><br></td></tr> </td>
              </tr>
            </table>
          <td width="1" bgcolor="0055AF"></td>
        </tr>
      </table>
      <table width="190" border="0" cellspacing="0" cellpadding="0">
        <tr> 
          <td width="3"><img src="imagess/please_list_left_4.gif" width="3" height="3"></td>
          <td width="184" height="3" background="imagess/please_list_left_5.gif">
			<img src="imagess/please_list_left_5.gif" width="2" height="3"></td>
          <td width="3"><img src="imagess/please_list_left_6.gif" width="3" height="3"></td>
        </tr>
      </table>
      <br> <table width="190" border="0" cellspacing="0" cellpadding="0">
        <tr> 
          <td width="89" background="imagess/please_list_left_7.gif"><b><font color="ffffff"> 
            &nbsp;&nbsp;购物车</font></b></td>
          <td width="101" align="right" background="imagess/please_list_left_8.gif">
			<IMG SRC="imagess/please_list_left_9.gif" WIDTH=5 HEIGHT=29 ALT=""></td>
        </tr>
      </table>
      <table width="190" border="0" cellspacing="0" cellpadding="0">
        <tr> 
          <td width="1" bgcolor="EB5A00"></td>
          <td width="188"> 
            <table width=100% border=0 cellspacing=0 cellpadding=2><tr><td height=100 align=center valign=middle><!--#include file="gouwucheinfo.asp"--></td>
            </tr></table>
          </td>
          <td width="1" bgcolor="EB5A00"></td>
        </tr>
      </table>
      <table width="190" border="0" cellspacing="0" cellpadding="0">
        <tr> 
          <td width="3"><img src="imagess/please_list_left_10.gif" width="3" height="3"></td>
          <td width="184"  height="3" background="imagess/please_list_left_11.gif">
			<img src="imagess/please_list_left_11.gif" width="2" height="3"></td>
          <td width="3"><img src="imagess/please_list_left_12.gif" width="3" height="3"></td>
        </tr>
      </table>

      <br></td>
    <td align="center" valign="top"> 
      <table width="98%" border="0" cellpadding="0" cellspacing="0">
        <tr> 
          <td width=3 height="30" nowrap>
			<IMG SRC="imagess/please_list_main_1.gif" WIDTH=3 HEIGHT=30 ALT=""></td>
          <form action="imagess/search.asp" name="search_s" method="get">
            <td nowrap bgcolor="0055AF">
              <table width="532" border="0" cellpadding="0" cellspacing="0">
                <tr>
                  <td width="404"><span class="style6"><strong>显示方式</strong>：<span class="style7">列表方式</span> </span></td>
                  <td width="128"><b></b></td>
                </tr>
              </table>
            </td>
            <td width=3 nowrap>
			<IMG SRC="imagess/please_list_main_2.gif" WIDTH=3 HEIGHT=30 ALT=""></td>
          </form>
        </tr>
      </table>
      <table width="98%"  border="0" cellpadding="0" cellspacing="0">
        <tr> 
          <td width="1" valign="top" bgcolor="0055AF"></td>
          <td valign="top"> 
            <table width=99% height=30 align=center cellpadding=0 cellspacing=0><tr>
              <td align=center valign=bottom><%do while not rs.eof%>
      <table width="100%" class="unnamed1" border="0" cellspacing="0" cellpadding="10" align="center">
<tr bgcolor=#f9f9f9 onMouseOver=this.style.backgroundColor='#EDF6FF' onMouseOut=this.style.backgroundColor='#f9f9f9'>
          <td width="20%" height="144" rowspan="3" class="table-you"><div align="center">
                <%if rs("bookpic")="" then 
response.write "<div align=center><a href=list.asp?id="&rs("bookid")&" ><img src=images/emptybook.gif width=75 height=75 border=0></a></div>"
else%>
            </div>
            <table width=77 height=77 border=0 align=center cellpadding=0 cellspacing=1 bgcolor="#e1e1e1">
                <tbody>
                  <tr> 
                    <td align=center> 
                    <a href=list.asp?id=<%=rs("bookid")%> ><img src="<%=trim(rs("bookpic"))%>"width=75 border=0 height="75"></a></td>
                    
                </tr>
                </tbody>
            </table> 
            <div align="center">
                <%end if%>
            </div></td>
          <td>
            <strong>
            <%response.write "<a href=list.asp?id="&trim(rs("bookid"))&" >"&trim(rs("bookname"))&"</a>"%>
            <font color="#666666">
            <br> 
            </font></strong><span class="style8">
            <%if len(trim(rs("bookcontent")))>150 then
	response.write left(trim(rs("bookcontent")),120)&"..."
	else
	response.write trim(rs("bookcontent"))
	end if%>
            </span><br>
            <span class="style5"><strong>市场价：<s><%=rs("shichangjia")&"元"%></s> 　会员价：<%="<font color=#FF6600>"&rs("huiyuanjia")&"元</font>"%>　VIP 价：<%="<font color=#FF3300>"&rs("vipjia")&"元</font>"%></strong></span><s><br>
            </s></td>
          </tr>

      </table>
	          <%i=i+1
		if i>=MaxPerPage then Exit Do
		rs.movenext
  loop
  rs.close
  set rs=nothing%>
      <%  
				End Sub   
  
				Function showpage(totalnumber,maxperpage,filename)  
  				Dim n
  				
				If totalnumber Mod maxperpage=0 Then  
					n= totalnumber \ maxperpage  
				Else
					n= totalnumber \ maxperpage+1  
				End If
				
				Response.Write "<form method=Post action="&filename&"?searchkey="&searchkey&"&action="&action&"&anclassid="&anclassid&"&jiage="&jiage&">"  
				Response.Write "<p align='center' class='contents'> "  
				If CurrentPage<2 Then  
					Response.Write "<font class='contents'>首页 上一页</font> "  
				Else  
					Response.Write "<a href="&filename&"?page=1&searchkey="&searchkey&"&action="&action&"&anclassid="&anclassid&"&jiage="&jiage&" class='contents'>首页</a> "  
					Response.Write "<a href="&filename&"?page="&CurrentPage-1&"&searchkey="&searchkey&"&action="&action&"&anclassid="&anclassid&"&jiage="&jiage&" class='contents'>上一页</a> "  
				End If
				
				If n-currentpage<1 Then  
					Response.Write "<font class='contents'>下一页 尾页</font>"  
				Else  
					Response.Write "<a href="&filename&"?page="&(CurrentPage+1)&"&searchkey="&searchkey&"&action="&action&"&anclassid="&anclassid&"&jiage="&jiage&" class='contents'>"  
					Response.Write "下一页</a> <a href="&filename&"?page="&n&"&searchkey="&searchkey&"&action="&action&"&anclassid="&anclassid&"&jiage="&jiage&" class='contents'>尾页</a>"  
				End If  
					Response.Write "<font class='contents'> 页次：</font><font class='contents'>"&CurrentPage&"</font><font class='contents'>/"&n&"页</font> "  
					Response.Write "<font class='contents'> 共查讯到"&totalnumber&"种商品 " 
					Response.Write "<font class='contents'>转到：</font><input CLASS='wenbenkuang' type='text' name='page' size=2 maxlength=8 class=smallInput value="&currentpage&">"  
					Response.Write "&nbsp;<input type='submit' CLASS='go-wenbenkuang' class='contents' value='GO' name='cndok'></form>"  
				End Function  
			%>
      <%
sub sss() '增加搜索关健字到数据库
if request.Cookies("bjx")("username")<>"" then 
set rs_s=server.CreateObject("adodb.recordset")
rs_s.open "select * from [user] where username='"&request.Cookies("bjx")("username")&"'",conn,1,1
t_userid=rs_s("userid")
rs_s.close

set rs_s=server.CreateObject("adodb.recordset")
rs_s.open "select * from shop_his where username='"&request.Cookies("bjx")("username")&"' and bookname='"&s_bookname&"' and lx=2",conn,1,3
if rs_s.recordcount>0 then 
	rs_s("ltime")=now()
	rs_s("userid")=t_userid
	rs_s("searchkey")=sql2
	rs_s.update
	rs_s.close
	set rs_s=nothing
else
		    	rs_s.close
		    	set rs_s=server.createobject("adodb.recordset")
		    	rs_s.open "select * from shop_his where username='"&request.Cookies("bjx")("username")&"' and lx=2",conn,1,3
		    	if rs_s.recordcount>=4 then
		    	    rs_s.delete
		    	    rs_s.update
		    	end if
		    	rs_s.addnew
		    	    rs_s("username")=request.Cookies("bjx")("username")
		    	    rs_s("searchkey")=sql2
		    	    rs_s("bookname")=s_bookname
			    rs_s("userid")=t_userid
		    	    rs_s("lx")=2
		    	    rs_s("ltime")=now()
		        rs_s.update
			rs_s.close
			set rs_s=nothing
		    end if
		end if
end sub%>
</td>
			</tr></table> </td>
          <td width="1" valign="top" bgcolor="0055AF"></td>
        </tr>
      </table>
      <table width="98%" border="0" cellspacing="0" cellpadding="0">
        <tr> 
          <td width="3"><img src="imagess/please_list_left_4.gif" width="3" height="3"></td>
          <td width="100%" height="3" background="imagess/please_list_left_5.gif">
			<img src="imagess/please_list_left_5.gif" width="2" height="3"></td>
          <td width="3"><img src="imagess/please_list_left_6.gif" width="3" height="3"></td>
        </tr>
      </table></td>
  </tr>
</table>
<!--#include file="copyright.asp"-->
</html>