<html>
<head>
<!--#include file="conn.asp"-->
<!--#include file="config.asp"-->
<title><%=webname%>--<%
					  leixing=lcase(trim(request("lx")))
					  leixing=replace(leixing,"'","")
					  select case leixing
					  case "big"
					  	response.write "大类商品"
					  case "small"
					  	response.write "小类商品"
					  case "tejia"
					  	response.write "特价商品"
					  case "news"
					  	response.write "新品上架"
					  case else
					  	response.write "推荐商品"					  
					  end select%></title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="description" content="网趣网上购物系统,网上购物系统,购物车系统,免费购物系统,在线购物系统,网趣购物系统,ASP免费购物系统,网趣购物,商城源码,网上商店,网上商店系统,域名注册,虚拟主机,恒伟网络">
<meta name="keywords" content="网趣网上购物系统,网趣网上购物系统时尚版,网趣购物系统,网上购物系统,购物系统,网趣购物,商城源码,网上商店,网上商店系统,域名注册,虚拟主机,恒伟网络">
<link href="images/css.css" rel="stylesheet" type="text/css">
</head>
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" >
<!--#include file="include/head.asp"-->
<table width="1000" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td width="39" valign="top"><table width="100%" height="184" border="0" cellpadding="0" cellspacing="0">
      <tr>
        <td height="30" align="right" valign="top"><img src="images/body/jiao.gif" width="15" height="17"></td>
      </tr>
      <tr>
        <td height="90"><div align="right"><img src="images/ttts.gif" width="26" height="110" /></div></td>
      </tr>
      <tr>
        <td height="30">&nbsp;</td>
      </tr>
    </table></td>
    <td width="190"style="BORDER-bottom:#FF67A0 1px solid;BORDER-left:#FF67A0 1px solid; BORDER-right:#FF67A0 1px solid;" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td><table width="190" height="190" border="0" cellpadding="0" cellspacing="0">
          <tr>
              <td align="center" valign="middle" background="images/index_2.gif"><!--#include file="logins.asp"--></td>
          </tr>
        </table></td>
      </tr>
      <tr>
        <td><img src="images/index_4.gif" width="190" height="12" alt="" /></td>
      </tr>
      <tr>
        <td><!--#include file="searc.asp"--><!--#include file="include/sort.asp"--></td>
      </tr>
      <tr>
        <td><!--#include file="include/selltop.asp" --></td>
      </tr>
			  <tr>
                <td height="5"></td>
              </tr>
              <tr>
                <td><div align="center"><a href="<%=ad6url%>" target="_blank"><img src="<%=ad6%>" border="0" width="180"  ></a></div></td>
              </tr>
			  <tr>
                <td height="5"></td>
              </tr>              <tr>
                <td><div align="center"><a href="<%=ad7url%>" target="_blank"><img src="<%=ad7%>" border="0" width="180"  ></a></div></td>
              </tr>
    </table></td>
    <td valign="top" ><table width="100%" align="center" border="0" cellspacing="0" cellpadding="0"  bordercolor="#CCCCCC">
      <tr>
        <td width="100%" valign="top" align="center" bordercolor="#FFFFFF" bgcolor="#FFFFFF"><table width="100%" align="center" border="0" cellspacing="0" cellpadding="0">
            <%leixing=lcase(trim(request("lx")))
if InStr(leixing,"'")>0 then
response.write"<script>alert(""非法访问!"");location.href=""../index.asp"";</script>"
response.end
end if
  'leixing=replace(leixing,"'","")
					select case leixing
					case "big"
					anclassid=trim(request("anid"))
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>"
else
					set rs=server.createobject("adodb.recordset")
					rs.open "select * FROM bsort where anclassid="&anclassid,conn,1,1
					anclassname=rs("anclass")
					%>
            <tr>
              <td colspan="2" valign="top"  ><table width="100%" border="0" cellspacing="0" cellpadding="0">
                  <tr>
                    <td valign="top" ><table width="100%" border="0" cellspacing="0" cellpadding="0">
                        <tr>
                          <td height="28" colspan="2" background="images/body/pdbg01.gif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <a href=index.asp><%=webname%></a> >> <%=anclassname%></td>
                          </tr>
                        <tr>
                          <td height="10" colspan="2" ></td>
                        </tr>
                        <tr>
                            <td><a href="<%=ad8url%>" target="_blank"><img src="<%=ad8%>" border="0" width="99%" height="160" ></a></td>
                        </tr>
                        
                    </table></td>
                  </tr>
                  <tr>
                    <td height="10" ></td>
                    </tr>
                  <tr>
                    <td></td>
                  </tr>
                  <tr>
                    <td><table  width="90%"  border="0" align="center" cellpadding="1" cellspacing="1"  bgcolor="#E1E1E1">
                        <tr>
                          <td width="110" align="center" bgcolor="#FFFFFF"><%=anclassname%></td>
                          <td bgcolor="#FFFFFF"><table border="0" cellpadding="0" cellspacing="0">
                              <%
set rs_s=server.CreateObject("adodb.recordset")
rs_s.open "select * from ssort where anclassid="&rs("anclassid")&" order by nclassidorder",conn,1,1
if rs_s.recordcount=0 then 
%>
                              <tr>
                                <td height="20" align="center" colspan="8">暂无小分类</td>
                              </tr>
                              <%
else
i=0
while not rs_s.eof
%>
                              <tr style="BORDER-bottom:#CC0033 1px solid;">
                                <td width="116"  height="24" align="left"><div align="left"><img src="images/body/diand.gif">&nbsp;&nbsp;<a href="class.asp?lx=small&anid=<%=rs("anclassid")%>&nid=<%=rs_s("nclassid")%>"><%=rs_s("nclass")%></a>
                                        <%rs_s.movenext
	if rs_s.eof then 
	response.write " "
	else
%>
                                </td>
                                <td width="116" align="left" ><img src="images/body/diand.gif">&nbsp;<a href="class.asp?lx=small&anid=<%=rs("anclassid")%>&nid=<%=rs_s("nclassid")%>"><%=rs_s("nclass")%></a>
                                        <%rs_s.movenext
	if rs_s.eof then 
	response.write " "
	else
%>
                                </td>
                                <td width="116" align="left" ><img src="images/body/diand.gif">&nbsp;&nbsp;<a href="class.asp?lx=small&anid=<%=rs("anclassid")%>&nid=<%=rs_s("nclassid")%>"><%=rs_s("nclass")%></a>
                                        <%rs_s.movenext
	if rs_s.eof then 
	response.write " "
	else
%>
                                </td>
                                <td width="116" align="left" ><img src="images/body/diand.gif">&nbsp;&nbsp;<a href="class.asp?lx=small&anid=<%=rs("anclassid")%>&nid=<%=rs_s("nclassid")%>"><%=rs_s("nclass")%></a>
                                        <%rs_s.movenext
	if rs_s.eof then 
	response.write " "
	else
%>
                                </td>
                                <td width="131" align="left" ><div align="left"><img src="images/body/diand.gif">&nbsp;&nbsp;<a href="class.asp?lx=small&anid=<%=rs("anclassid")%>&nid=<%=rs_s("nclassid")%>"><%=rs_s("nclass")%></a> </td>
                                <%
rs_s.movenext
end if
end if
end if
end if

wend
end if
end if
end if
%>
                              </tr>
                          </table></td>
                        </tr>
                    </table></td>
                  </tr>
              </table></td>
            </tr>
            <%
					  case "small"
					  	anclassid=request("anid")
						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>"
else
					  	nclassid=request("nid")
						if not isnumeric(nclassid) then 
response.write"<script>alert(""非法访问!"");location.href=""../index.asp"";</script>"
response.end
else
if not isinteger(nclassid) then
response.write"<script>alert(""非法访问!"");location.href=""../index.asp"";</script>"
else
					  	set rs=server.createobject("adodb.recordset")
					  	rs.open "select * FROM bsort where anclassid="&anclassid,conn,1,1
						anclassname=rs("anclass")
						rs.close
					  	rs.open "select * FROM ssort where nclassid="&nclassid,conn,1,1
						nclassname=rs("nclass")
						rs.close
					  %>
            <tr>
              <td height="28" colspan="2" background="images/body/pdbg01.gif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <a href=index.asp><%=webname%></a> >> <a href=class.asp?lx=big&anid=<%=anclassid%>><%=anclassname%></a> >> <%=nclassname%></td>
            </tr>
            <%
end if 
end if
end if
end if
case "tejia"%>
            <tr>
              <td height=28 colspan="2" valign="middle" background="images/body/pdbg01.gif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <a href=index.asp><%=webname%></a> >> 特价促销</td>
            </tr>
            <tr>
              <td height="8" colspan="2"  ></td>
            </tr>
            <tr>
              <td colspan="2" background="" height=25><table width="100%" border="0" cellspacing="0" cellpadding="0">
                  <tr>
                    <td width="5"></td>
                      <td><a href="<%=ad8url%>" target="_blank"><img src="<%=ad8%>" border="0" width="99%" height="160" ></a></td>
                  </tr>
              </table></td>
            </tr>
            <tr>
              <td colspan="2" height=10></td>
            </tr>
            <%case "hot"%>
            <tr>
              <td  height=28 colspan="2" background="images/body/pdbg01.gif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <a href=index.asp><%=webname%></a> >> 热销商品</td>
              </tr>
            <tr>
              <td height="8" colspan="2"  ></td>
            </tr>
            <tr>
              <td colspan="2" background="" height=25><table width="100%" border="0" cellspacing="0" cellpadding="0">
                  <tr>
                    <td width="5"></td>
                      <td><a href="<%=ad8url%>" target="_blank"><img src="<%=ad8%>" border="0" width="99%" height="160" ></a></td>
                  </tr>
              </table></td>
            </tr>
            <tr>
              <td colspan="2"  height=10></td>
            </tr>
            <%case "news"%>
            <tr>
              <td height=28 colspan="2" background="images/body/pdbg01.gif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <a href=index.asp><%=webname%></a> >> 最新上架</td>
              </tr>
            <tr>
              <td height="8" colspan="2"  ></td>
            </tr>
            <tr>
              <td colspan="2" background="" height=50><table width="100%" border="0" cellspacing="0" cellpadding="0">
                  <tr>
                    <td width="5"></td>
                      <td><a href="<%=ad8url%>" target="_blank"><img src="<%=ad8%>" border="0" width="99%" height="160" ></a></td>
                  </tr>
              </table></td>
            </tr>
            <tr>
              <td colspan="2"  height=10></td>
            </tr>
            <%case else%>
            <tr>
              <td height=28 colspan="2" background="images/body/pdbg01.gif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <a href=index.asp><%=webname%></a> >> 最新上架</td>
              </tr>
            <tr>
              <td height="8" colspan="2"  ></td>
            </tr>
            <tr>
              <td colspan="2" background="" height=50><table width="100%" border="0" cellspacing="0" cellpadding="0">
                  <tr>
                    <td width="5"></td>
                      <td><a href="<%=ad8url%>" target="_blank"><img src="<%=ad8%>" border="0" width="99%" height="160" ></a></td>
                  </tr>
              </table></td>
            </tr>
            <tr>
              <td colspan="2"  height=10></td>
            </tr>
            <%end select%>
          </table>
            <%set rs=server.createobject("adodb.recordset")
			xid=request("xid")
			order=request("order")
			
	if order="PriceUp" then
			 orderby="order by huiyuanjia asc"
			 
			  elseif order="PriceDown" then
			  orderby="order by huiyuanjia desc"
			  
			 elseif order="ViewsUp" then
			 		
			  orderby="order by liulancount asc"
			  elseif order="ViewsDown" then
			   orderby="order by liulancount desc"
			 elseif order="Addup" then
			 	 orderby="order by adddate desc"
		     elseif order="SaleUp" then
			     orderby="order by chengjiaocount asc"
				 elseif order="SaleDown" then
				 orderby="order by chengjiaocount desc"
			  else
			orderby="order by adddate desc"
			 end if 
			
		if leixing="big" then
			rs.open "select * from products where anclassid="&anclassid&"and zhuangtai=0  "&orderby&"",conn,1,1
		elseif leixing="small" then
		rs.open "select * from products where anclassid="&anclassid&" and nclassid="&nclassid&" and zhuangtai=0 "&orderby&"",conn,1,1
		elseif leixing="hot" then
			rs.open "select * from products where   zhuangtai=0 "&orderby&"",conn,1,1
		elseif leixing="tejia" then
			rs.open "select * from products where tejiabook=1 and zhuangtai=0 "&orderby&"",conn,1,1
		elseif leixing="news" then
			rs.open "select * from products where newsbook=1 and zhuangtai=0 "&orderby&"",conn,1,1
		else
			rs.open "select * from products where newsbook=1 and zhuangtai=0 "&orderby&"",conn,1,1
		
		end if
		if rs.recordcount=0 then 
		%>
            <table width="370" border="0" cellspacing="0" cellpadding="5" align="center">
              <tr>
                <td align=center>暂无商品</td>
              </tr>
            </table>
          <%
		else
	  		rs.PageSize =28 '每页记录条数
			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  class="sideleft"  width="100%"  border="0" cellspacing="0" cellpadding="0" align="center">
              <tr>
			  
			  
			  
			   
			 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp <a href=class.asp?<%=tempp%>order=PriceUp><img src="images/jk1.gif" border="0" width="51" height="21" alt="按价格从低到高"></a><a href=class.asp?<%=tempp%>order=PriceDown><img src="images/jk2.gif" border="0" width="23" height="21" alt="按价格从高到低"></a>　<a href=class.asp?<%=tempp%>order=SaleUp><img src="images/jk3.gif" border="0" width="51" height="21" alt="按销量从低到高"></a><a href=class.asp?<%=tempp%>order=SaleDown><img src="images/jk2.gif" border="0"width="23" height="21" alt="按销量从高到低"></a>　<a href=class.asp?<%=tempp%>order=ViewsUp><img src="images/jk4.gif" border="0" width="51" height="21" alt="按人气从低到高"></a><a href=class.asp?<%=tempp%>order=ViewsDown><img src="images/jk2.gif" border="0" width="23" height="21" alt="按人气从高到低"></a>　<a href=class.asp?<%=tempp%>order=Addup><img src="images/jk5.gif" width="71" border="0" height="21" alt="按上架先后排序"></a> 
			  
                <%
				ii=0
				For i=1 To x
		%>
                <td width="27%"><table width="175" border="0" cellspacing="0" cellpadding="0">
                    <tr>
                      <td height="10"  ></td>
                    </tr>
                    <tr>
                      <td><table width="175" border="0" cellspacing="0" cellpadding="0">
                          <tr>
                            <td height="1" background="images/lineDotGray.gif"></td>
                          </tr>
                          <tr>
                            <td height="10" ></td>
                          </tr>
                          <tr>
                            <td><div align="center">
                              <table width="98" height="100" border="0" align="center" cellpadding="2" cellspacing="1" bgcolor="#bbbbbb" onMouseOver="this.style.backgroundColor='#A10000'" onMouseOut="this.style.backgroundColor=''">
                                <tbody>
                                  <tr>
                                    <td width="92" height="100" bgcolor="#ffffff" align="center"><%if rs("bookpic")="" then 
	response.write "<div align=center><a href=list.asp?id="&rs("bookid")&" > <img src=images/emptybook.gif width=90 height=90 border=0></a></div>"
	else%>
                                        <a href="Products.asp?id=<%=rs("bookid")%>" target="_blank"> <img src="<%=trim(rs("bookpic"))%>" width="115" height="115" border="0" align="absmiddle" /></a>
                                        <%end if%>
                                    </td>
                                  </tr>
                                </tbody>
                              </table>
                            </div></td>
                          </tr>
                          <tr>
                            <td><table width="100%" border="0" cellpadding="0" cellspacing="0">
                                <tr>
                                  <td align=center><%response.write "<a class=a4 href=products.asp?id="&rs("bookid")&" ><font color=#FF0000>"
			if len(trim(rs("bookname")))>7 then
			response.write left(trim(rs("bookname")),7)&".."
			else
			response.write trim(rs("bookname"))
			end if
			response.write "</font></a>"
			%>
                                 </td>
                                </tr>
                                <tr>
                                  <td height="35" align=center>市场价：<s><%=trim(rs("shichangjia"))%> 元</s><br>
                                    会员价：<font color=#ff0000><%=trim(rs("huiyuanjia"))%> </font>元</td>
                                </tr>
                            </table></td>
                          </tr>
                      </table></td>
                    </tr>
                </table></td>
                <%rs.movenext
		     ii=ii+1%>
                <%if ii mod 4 =0 then%>
              </tr>
              <tr>
                <%end if%>
                <% next%>
                <td colspan="2" ></td>
              </tr>
            </table>
          <%
		call PageControl(iCount,maxpage,page,"border=0 align=center","<p align=center>")
		end if
		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></td>
    <td width="68"  style="BORDER-left:#FF67A0 1px solid;" >&nbsp;</td>
  </tr>
</table>
<!--#include file="include/foot.asp"-->
</body>
</html>
