<!--#include file="conn.asp"-->
<%
page_title=Eval("product_title"&Language)
page_keywords=Eval("product_keywords"&Language)
page_description=Eval("product_description"&Language)
if page_title="" then
page_title=city_title
page_keywords=city_keywords
page_description=city_description
end if
%>
<!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>
<meta http-equiv="Content-Language" content="zh-CN">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title><%=page_title%></title>
<meta name="keywords" content="<%=page_keywords%>" />
<meta name="description" content="<%=page_description%>" />
<!--#include file="top.asp"-->
<!--#include file="header.asp"-->
<link href="<%=filepath%>inc/prod_list.css" rel="stylesheet" type="text/css">
<style>
/*---商品评价星星---*/
.ratings { margin:7px 0; line-height:1em;  }
.rating-box { float:left; position:relative; width:69px; height:13px; margin-right:5px; margin-top:11px; background:url(/images/product_rating_blank_star.gif) repeat-x; }
.rating-box .rating { position:absolute; top:0; left:0; height:13px; background:url(images/product_rating_full_star.gif) repeat-x; }
.ratings-list { margin:4px 0; }
.ratings-list td { padding:3px 0; }
.ratings-list td.label { padding-right:8px; font-size:.95em; font-weight:bold; line-height:1em; }
#lblTitle{background:url(Images/cus.gif); height:30px; line-height:30px; color:#fff; font-weight:bold; padding-left:10px;}

</style>
  <div id="content" class="w980">
    <div class="newsidebar">
			<div class="side-cat" id="leftMenu">
				<h3>所有商品分类</h3>
<ul class="tree"><% 
Set rs=server.CreateObject("adodb.recordset") 
rs.open "select * from Com_class where type=0 and cid=0  order by pid asc,id asc",conn,1,1 
while not rs.eof 
%>

		<li class="rttree tree-open"><i class="treeicon"></i><a href="products.asp?typeid=<%=rs("ID")%>" class="treetitle"><b><%=rs("classname"&Language)%></b></a>
		<%Set rsn=server.CreateObject("adodb.recordset") 
		rsn.open "select * from Com_class where type=0 and cid="&rs("id")&"  order by pid asc,id asc",conn,1,1 
		if not rsn.eof or not rsn.bof then
		i=1
		response.Write("<ul class='subtree'>")
		while not rsn.eof 
		%>
		
		<li><a href="products.asp?typeid=<%=rs("ID")%>&cid=<%=rsn("ID")%>" class="treeitem"><%=rsn("classname"&Language)%></a></li>
		<%
		i=i+1
		rsn.movenext 
		Wend 
		response.Write("</ul>")
		end if
		rsn.close 
		set rsn=nothing %>
		</li>
<% 
rs.movenext 
Wend 
rs.close 
set rs=nothing 
%></ul>
			</div>
		</div>
<%
typeid=request("typeid") 
keyword=request("keyword") 
cid=request("cid")
nid=request("nid")
show=request("show")
showby=request("showby")


if keyword<>"" then
obykw="&keyword="&keyword&""
end if
if cid<>"" then
oby="?typeid="&typeid&"&cid="&cid&"&"
elseif typeid<>"" then
oby="?typeid="&typeid&"&"
else
oby="?"
end if

if showby=1 then
showbyTj="books_date desc,"
elseif showby=2 then
showbyTj="books_date asc,"
elseif showby=3 then
showbyTj="shopxphyjia desc,"
elseif showby=4 then
showbyTj="shopxphyjia asc,"
elseif showby=5 then
showbyTj="ck desc,id desc,"
elseif showby=6 then
showbyTj="chengjiaocount desc,"
elseif showby=7 then
showbyTj="chengjiaocount asc,"
elseif showby=8 then
showbyTj="bestbook desc,id desc,"
else
showbyTj="books_date desc,id desc,"
end if 
%>
    <div class="rightCon">
      <div class="mouse"><img src="images/iconG02.gif"><a href="../index.asp">首页</a> &gt;&gt; <%call title()%>  <%call title1()%></div>
      <div style=" width:738px; overflow:hidden;"> </div>
      <div style="display:none;"> </div>
      <div class="list">
        <div class="topList">
          <div class="leftPX">排序：
		  <a class="<%if request("showby")=1 then%>bgW<%elseif request("showby")=2 then%>bgWD<%end if%>" href="<%=oby%>showby=<%if request("showby")=1 then%>2<%else%>1<%end if%><%=obykw%>">时间<span></span></a>
		  <a class="<%if request("showby")=3 then%>bgW<%elseif request("showby")=4 then%>bgWD<%end if%>" href="<%=oby%>showby=<%if request("showby")=3 then%>4<%else%>3<%end if%><%=obykw%>">价格<span></span></a>
		  <a class="<%if request("showby")=6 then%>bgW<%elseif request("showby")=7 then%>bgWD<%end if%>" href="<%=oby%>showby=<%if request("showby")=6 then%>7<%else%>6<%end if%><%=obykw%>">销量<span></span></a></div>
          <div class="rightNest"> </div>
        </div>
        <ul class="spList">
<%
Set rs = Server.CreateObject("ADODB.Recordset")
if keyword<>"" then
sql = "select * from com_books where type=0 and (titlecn like '%"&keyword&"%' or  titleen like '%"&keyword&"%')  and lookcn=1 order by "&showbyTj&" Pid asc"
elseif cid<>"" then
sql = "SELECT * FROM com_books where nid="&cid&" and lookcn=1  and type=0  order by "&showbyTj&" Pid asc" 
elseif typeid<>"" then
sql = "SELECT * FROM com_books where cid="&typeid&" and lookcn=1  and type=0  order by "&showbyTj&" Pid asc" 
else
sql = "SELECT * FROM com_books where  lookcn=1 and type=0  order by "&showbyTj&" Pid asc" 
end if
rs.open sql,conn,1,1

dim MaPerPage
MaPerPage=20

dim text,checkpage
text="0123456789"
Rs.PageSize=MaPerPage
for i=1 to len(request("page"))
checkpage=instr(1,text,mid(request("page"),i,1))
if checkpage=0 then
exit for
end if
next

If checkpage<>0 then
If NOT IsEmpty(request("page")) Then
CurrentPage=Cint(request("page"))
If CurrentPage < 1 Then CurrentPage = 1 
If CurrentPage > Rs.PageCount Then CurrentPage = Rs.PageCount
Else
CurrentPage= 1
End If
If not Rs.eof Then Rs.AbsolutePage = CurrentPage end if
Else
CurrentPage=1
End if

i=0
if rs.eof then
else
do while not rs.eof
%>
<li> <a href="products_show.asp?typeid=<%=rs("cid")%>&cid=<%=rs("cid")%>&id=<%=rs("id")%>"> <img src="../<%=rs("bookpicm")%>" width="180" height="180" alt="<%=rs("titlecn")%>" title="<%=rs("titlecn")%>"> <span title="<%=rs("titlecn")%>" style="cursor:pointer"><%=rs("titlecn")%></span><br><strong>¥<%=Formatnumber(rs("shopxphyjia"),2,-1,-1,0)%></strong><font>￥<%=Formatnumber(rs("shichangjia"),2,-1,-1,0)%></font> </a> </li>
<%
i=i+1 
if i >= MaPerpage then exit do 
rs.movenext 
loop 
end if
%>
        </ul>
        <div class="page">
          <div class="zp-pagination">
            <div class="zp-pagination-wrapper"> 
<%
if showby<>"" then
fytjsb="&showby="&showby&""
end if
if keyword<>"" then
fytjkw="&keyword="&keyword&""
end if
if cid<>"" then
fytj="&typeid="&typeid&"&cid="&cid&""
elseif typeid<>"" then
fytj="&typeid="&typeid&""
else
fytj=""
end if
Response.write ""
Response.write "<span class='zp-pagination-info'>共:<span style='color:Red;'>" & Cstr(Rs.RecordCount) & "</span>个商品&nbsp;"
Response.write "" & Cstr(CurrentPage) &  "/" & Cstr(rs.pagecount) & "页</span>&nbsp;"
If currentpage > 1 Then
response.write "<a class='zp-pagination-prev' href='products.asp?page="+cstr(1)+""&fytj&""&fytjsb&""&fytjkw&"'>&nbsp;[首页]&nbsp;</a>"
Response.write "<a class='zp-pagination-prev' href='products.asp?page="+Cstr(currentpage-1)+" "&fytj&""&fytjsb&""&fytjkw&"'>&nbsp;[上一页]&nbsp;</a>"
Else
Response.write ""
End if

for i = 1 to Rs.PageCount
       if i = currentpage then 
          response.write"<a  href='#' class='zp-pagination-page'>"&i&"</a>"
       else
          response.write"<a class='zp-pagination-page' href='products.asp?page="&i&""&fytj&""&fytjsb&""&fytjkw&"'>"&i&"</a>"
       end if
    next
	
	
If currentpage < Rs.PageCount Then
Response.write "<a class='zp-pagination-next' href='products.asp?page="+Cstr(currentPage+1)+""&fytj&""&fytjsb&""&fytjkw&"'>&nbsp;[下一页]&nbsp;</a>"
Response.write "<a class='zp-pagination-next' href='products.asp?page="+Cstr(Rs.PageCount)+""&fytj&""&fytjsb&""&fytjkw&"'>&nbsp;[尾页]&nbsp;</a>"
Else
Response.write ""
End if
Response.write "跳转到:"
response.write"<select class='txtPage' name='sel_page' onChange='javascript:location=this.options[this.selectedIndex].value;'>"
    for i = 1 to Rs.PageCount
       if i = currentpage then 
          response.write"<option value='products.asp?page="&i&""&fytj&""&fytjsb&""&fytjkw&"' selected>"&i&"</option>"
       else
          response.write"<option value='products.asp?page="&i&""&fytj&""&fytjsb&""&fytjkw&"'>"&i&"</option>"
       end if
    next
response.write"</select>"
rs.close
%>

            </div>
          </div>

        </div>
      </div>
    </div>
  </div>
  
<!--#include file="foot.asp"--> 

<%
sub title()
typeid=request("typeid")
if typeid="" then
response.write "商品信息"
elseif typeid=0 then
response.write "商品信息"
end if
if typeid<>"" then
set rstype=server.CreateObject("adodb.recordset")	
rstype.open "select * from com_class where id="&typeid&" order by pid asc,id desc",conn,1,1
response.write " "&rstype("ClassName"&language)&""
rstype.close
set rstype=nothing
end if
end sub


sub title1()
styleid=request("cid")
if styleid="" then
response.write ""
elseif styleid=0 then
response.write ""
end if
if styleid<>"" then
set rstype=server.CreateObject("adodb.recordset")	
rstype.open "select * from com_class where id="&styleid&" order by pid asc,id desc",conn,1,1
response.write " >> "&rstype("ClassName"&language)&" "
rstype.close
set rstype=nothing
end if
end sub

%>