<!--#include file="conn.asp"-->
<!--#include file="webconfig.asp"-->
<html>
<head>
<title><%=webname%>--商品排行</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="images/css.css" rel="stylesheet" type="text/css">
</head>
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" onMouseOver="window.status='【<%=webname%>】<%=weburl%> 如果您喜欢本站,别忘了把本站介绍给您的好友哦！：）';return true">
<!--#include file="webtop.asp" -->
<table width="770" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td bgcolor="#FDC758"> <div align="right"><%set rs=server.CreateObject("adodb.recordset")
	rs.open "select * from shop_anclass order by anclassidorder",conn,1,1
	if rs.eof and rs.bof then
	response.write "目前还没有分类"
	else%>
	<select name="anclassid" onchange="var jmpURL=this.options[this.selectedIndex].value ; if(jmpURL!='') {window.location=jmpURL;} else {this.selectedIndex=0 ;}" > 
          <option selected>--请选择商品分类--</option>
		  <option value=bookorder.asp?id=0>查讯总体排行</option>
		  <%do while not rs.eof%>
          <option value="bookorder.asp?id=<%=rs("anclassid")%>"><%=trim(rs("anclass"))%></option>
          <%rs.movenext
		loop
		end if
		rs.close
		set rs=nothing
		%>
        </select>
      </div></td>
  </tr>
</table>
<table width="770" border="0" align="center" cellpadding="1" cellspacing="1" bgcolor="#5F95D3">
  <tr> 
    <td width="101" vAlign=bottom><img src="images/paihang/pic_sortorder.gif" width="49" height="25" hspace="3" align="middle"></td>
    <td width="18">&nbsp;</td>
    <td width="323">&nbsp; </td>
    <td width="12">&nbsp;</td>
    <td width="306">&nbsp;</td>
  </tr>
  <tr valign="top"> 
    <td height="225" colspan="5" bgcolor="#FFFFFF">
	<%dim anclassid,rs2,xx
	anclassid=request.QueryString("id")
	set rs=server.CreateObject("adodb.recordset")
	set rs2=server.CreateObject("adodb.recordset")
	if anclassid=0 or anclassid="" then
	rs.open "select top 20 bookid,bookzz,bookchuban,bookname,pingji,pingjizong from shop_books order by liulancount desc",conn,1,1
	rs2.open "select top 20 bookid,bookzz,bookchuban,bookname,pingji,pingjizong from shop_books order by chengjiaocount desc",conn,1,1
	else
	rs.open "select top 20 bookid,bookzz,bookchuban,bookname,pingji,pingjizong from shop_books where anclassid="&anclassid&" order by liulancount desc",conn,1,1
	rs2.open "select top 20 bookid,bookzz,bookchuban,bookname,pingji,pingjizong from shop_books where anclassid="&anclassid&" order by chengjiaocount desc",conn,1,1
	end if
	if rs.eof and rs.bof then
	response.write "目前还没有任何图书"
	response.End()
	end if
	dim i
	i=0
	%><table width="100%" border="0" cellpadding="1" cellspacing="2" bgcolor="#f7fbff">
        <tr bgcolor="#f7fbff"> 
          <td width="16%" height="105" valign="top">
		 <%do while not rs.eof
		 i=i+1%> <table width="80%" height="68" border="0" cellpadding="3" cellspacing="3">
              <tr>
                <td height="58"><img src="images/paihang/top<%=i%>.gif"></td>
              </tr>
            </table><%
			  if i>=3 then exit do
			  rs.movenext
			  loop%></td>
          <td width="44%" valign="top" bgcolor="#f7fbff">
		  <%i=0
		  rs.movefirst
		  do while not rs.eof
		  i=i+1%><table width="100%" border="0" cellspacing="2" cellpadding="2">
              <tr>
                <td valign="top">
				<table width="288" border="0" cellpadding="0" cellspacing="0">
                    <tr> 
                      <td height="21" background="images/paihang/dh.gif" style="padding-left:20px"><table width="100%" border="0" cellspacing="0" cellpadding="0">
                          <tr> 
                            <td width="57%"><img src="images/paihang/pl.gif" width="30" height="15" align="absbottom"> 
                              &nbsp;&nbsp;&nbsp; <a href=book.asp?id=<%=rs("bookid")%> target=_blank><img src="images/paihang/xx.gif" width="30" height="15" align="absbottom" border=0></a></td>
                            <td width="43%" style="padding-left:20px"><%if rs("pingjizong")>0 and rs("pingji")>0 then
xx=rs("pingjizong")\rs("pingji")
else
xx=0
end if
response.write "<img src=images/pingji/"&xx&".gif alt=评论星级 align=top>"
%></td>
                          </tr>
                        </table></td>
                    </tr>
                    <tr> 
                      <td background="images/paihang/b.gif" style="padding-left:6px"><%response.write "<a href=book.asp?id="&rs("bookid")&" target=_blank>"
					  if len(trim(rs("bookname")))>24 then
					  response.write left(trim(rs("bookname")),24)&"..."
					  else
					  response.write trim(rs("bookname"))
					  end if
					  response.write "</a>"					  
					  %>
                        <br>
                        名称：<%=trim(rs("bookzz"))%>&nbsp; &nbsp;&nbsp;简介：<%=trim(rs("bookchuban"))%></td>
                    </tr>
                    <tr> 
                      <td height="2" background="images/paihang/dd.gif"></td>
                    </tr>
                  </table></td>
              </tr>
            </table><%
			if i=3 then exit do
			rs.movenext
			loop%></td>
          <td width="40%" valign="top">
		  <%i=0
		  rs2.movefirst
		  do while not rs2.eof
		  i=i+1%><table width="100%" border="0" cellspacing="2" cellpadding="2">
              <tr>
                <td valign="top"><table width="288" border="0" cellpadding="0" cellspacing="0">
                    <tr> 
                      <td height="21" background="images/paihang/dh.gif" style="padding-left:20px"><table width="100%" border="0" cellspacing="0" cellpadding="0">
                          <tr> 
                            <td width="57%"><img src="images/paihang/pl.gif" width="30" height="15" align="absbottom"> 
                              &nbsp;&nbsp;&nbsp; <a href=book.asp?id=<%=rs2("bookid")%> target=_blank><img src="images/paihang/xx.gif" width="30" height="15" align="absbottom" border=0></a></td>
                            <td width="43%" style="padding-left:20px">
                              <%if rs2("pingjizong")>0 and rs2("pingji")>0 then
xx=rs2("pingjizong")\rs2("pingji")
else
xx=0
end if
response.write "<img src=images/pingji/"&xx&".gif alt=评论星级 align=absbottom>"
%>
                            </td>
                          </tr>
                        </table></td>
                    </tr>
                    <tr> 
                      <td background="images/paihang/b.gif" style="padding-left:6px">
                        <%response.write "<a href=book.asp?id="&rs2("bookid")&" target=_blank>"
					  if len(trim(rs2("bookname")))>24 then
					  response.write left(trim(rs2("bookname")),24)&"..."
					  else
					  response.write trim(rs2("bookname"))
					  end if
					  response.write "</a>"					  
					  %>
                        <br>
                        名称：<%=trim(rs2("bookzz"))%>&nbsp; &nbsp;&nbsp;简介：<%=trim(rs2("bookchuban"))%> 
                      </td>
                    </tr>
                    <tr> 
                      <td height="2" background="images/paihang/dd.gif"></td>
                    </tr>
                  </table></td>
              </tr>
            </table>
			<%if i>=3 then exit do
			rs2.movenext
			loop%></td>
        </tr>
      </table>
      <table width="100%" border="0" cellpadding="1" cellspacing="2" bgcolor="#f7fbff">
        <tr bgcolor="#f7fbff"> 
          <td width="16%" height="58" valign="top"> 
            <%if rs.recordcount>=4 then
			rs.absoluteposition=4
			i=3
			do while not rs.eof
		 
		 i=i+1%>
            <table width="80%" height="51" border="0" cellpadding="3" cellspacing="2">
              <tr> 
                <td height="46"><img src="images/paihang/top<%=i%>.gif"></td>
              </tr>
            </table>
            <%
			  if i>=20 then exit do
			  rs.movenext
			  loop
			  end if%>
          </td>
          <td width="44%" valign="top" bgcolor="#f7fbff"> 
            <%i=4
			if rs.recordcount>=4 then
			rs.absoluteposition=4
		    do while not rs.eof
		  i=i+1%>
            <table width="100%" border="0" cellspacing="2" cellpadding="2">
              <tr>
                <td><TABLE WIDTH=288 BORDER=0 CELLPADDING=0 CELLSPACING=0>
                    <TR> 
                      <TD height="21" background="images/paihang_01.gif" style="padding-left:20px"><table width="100%" border="0" cellspacing="0" cellpadding="0">
                          <tr> 
                            <td width="59%" height="18"><img src="images/paihang/pl.gif" width="30" height="15" align="absbottom"> 
                              &nbsp;&nbsp;&nbsp; <a href=book.asp?id=<%=rs("bookid")%> target=_blank><img src="images/paihang/xx.gif" width="30" height="15" align="absbottom" border=0></a></td>
                            <td width="43%" style="padding-left:20px">
                              <%if rs("pingjizong")>0 and rs("pingji")>0 then
xx=rs("pingjizong")\rs("pingji")
else
xx=0
end if
response.write "<img src=images/pingji/"&xx&".gif alt=评论星级 align=top>"
%>
                            </td>
                          </tr>
                        </table></TD>
                    </TR>
                    <TR> 
                      <TD background="images/paihang_02.gif" style="padding-left:6px">
                        <%response.write "<a href=book.asp?id="&rs("bookid")&" target=_blank>"
					  if len(trim(rs("bookname")))>24 then
					  response.write left(trim(rs("bookname")),24)&"..."
					  else
					  response.write trim(rs("bookname"))
					  end if
					  response.write "</a>"					  
					  %>
                      </TD>
                    </TR>
                    <TR> 
                      <TD> <IMG SRC="images/paihang_04.gif" WIDTH=288 HEIGHT=3 ALT=""></TD>
                    </TR>
                  </TABLE></td>
              </tr>
            </table> 
            <%
			if i>20 then exit do
			rs.movenext
			loop
			end if%>
          </td>
          <td width="40%" valign="top"> 
            <%i=4
			if rs.recordcount>=4 then
		  rs2.absoluteposition=4
		  do while not rs2.eof
		  i=i+1%>
            <table width="100%" border="0" cellspacing="2" cellpadding="2">
              <tr> 
                <td><TABLE WIDTH=288 BORDER=0 CELLPADDING=0 CELLSPACING=0>
                    <TR> 
                      <TD height="21" background="images/paihang_01.gif" style="padding-left:20px"><table width="100%" border="0" cellspacing="0" cellpadding="0">
                          <tr> 
                            <td width="59%" height="18"><img src="images/paihang/pl.gif" width="30" height="15" align="absbottom"> 
                              &nbsp;&nbsp;&nbsp; <a href=book.asp?id=<%=rs2("bookid")%> target=_blank><img src="images/paihang/xx.gif" width="30" height="15" align="absbottom" border=0></a></td>
                            <td width="43%" style="padding-left:20px"> 
                              <%if rs2("pingjizong")>0 and rs2("pingji")>0 then
xx=rs2("pingjizong")\rs2("pingji")
else
xx=0
end if
response.write "<img src=images/pingji/"&xx&".gif alt=评论星级 align=top>"
%>
                            </td>
                          </tr>
                        </table></TD>
                    </TR>
                    <TR> 
                      <TD background="images/paihang_02.gif" style="padding-left:6px"> 
                        <%response.write "<a href=book.asp?id="&rs2("bookid")&" target=_blank>"
					  if len(trim(rs2("bookname")))>24 then
					  response.write left(trim(rs2("bookname")),24)&"..."
					  else
					  response.write trim(rs2("bookname"))
					  end if
					  response.write "</a>"					  
					  %>
                      </TD>
                    </TR>
                    <TR> 
                      <TD> <IMG SRC="images/paihang_04.gif" WIDTH=288 HEIGHT=3 ALT=""></TD>
                    </TR>
                  </TABLE></td>
              </tr>
            </table>
            <%if i>20 then exit do
			rs2.movenext
			loop
			end if
			rs.close
			rs2.close
			set rs=nothing
			set rs2=nothing
			%>
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
</table><!--#include file="service.asp"-->
<!--#include file="copyright.asp"-->
</body>
</html>
