<!--#include file="conn.asp"-->
<!--#include file="buy2buysys.asp"-->

<%
dim catid,i,strcat
catid=SafeRequest("catid",1)
CatList =catid
PID = catid
		 if catid="" or catid = 0 then
		 	conn.close
			set conn = Nothing
		 	response.Redirect "procat.asp"
			response.end
		 end if
	
		 set rs=server.CreateObject("adodb.recordset")
		do while not PID = 0
		 	rs.open "Select categoryid,category,ParentID From category Where categoryid="&PID,conn,1,1
		 
		 	if rs.eof and rs.bof then
				response.Write "<script LANGUAGE='javascript'>alert('您输入的参数非法，请正确操作！');history.go(-1);</script>"
				rs.close
				set rs = Nothing
				conn.Close
				set conn=nothing
				response.end
			end if

		 	lstcat = "－&gt;<a href=b2b_cplist.asp?catid="&rs("categoryid")&">"&rs("category")&"</a>"&lstcat
		 	catstr = ""&rs("category")&"－&gt;"&catstr
		 	CaID = PID
		 	CatN = rs("category")
		 	PID = rs("ParentID")
		 	rs.close 
		 loop
		 
		 rs.open "Select category,meta From category Where categoryid="&catid,conn,1,1
		 strcat = rs("category")
		 strmeta = rs("meta")
		 strintro = rs("intro")
		 rs.close 
		set rs = Nothing	
		
sorts(CatID)

sub sorts(selec)
	sql="select categoryid from category where ParentID = "&selec&" order by categoryorder"
	set tmpRs= server.CreateObject("adodb.recordset")
	tmpRs.open sql,conn,1,1
	do while not tmpRs.eof
		IntCat =  tmpRs("categoryid")
	 	If Len(CatList) = 0 Then
      		CatList =catid
   		ElseIf InStr( CatList, IntCat ) <= 0 Then
      		CatList = CatList&", "&IntCat &""
   		End If
		sorts tmpRs("categoryid")
		tmpRs.movenext
	loop
	tmpRs.close
	Set tmpRs = Nothing
end sub	
		 %>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!-- saved from url=(0046)http://www.truebest.net/product_list.asp?id=87 -->
<HTML>
<style type="text/css">
<!--
.STYLE2 {color: #FF6600}
.bg {
	border: 1px solid #999999;
}
.bg {
	border: 1px solid #CCCCCC;
}
-->
</style>
<script type="text/JavaScript">
<!--
function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}
//-->
</script>
<HEAD><TITLE><%=webname%></TITLE>
<META http-equiv=Content-Type content="text/html; charset=gb2312">


<!--#include file="b2b_includefile/b2b_top.asp" -->



</HEAD>
<BODY text=black vLink=purple aLink=red link=blue bgColor=white leftMargin=0 
topMargin=0 marginwidth="0" marginheight="0">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
    <tr>
      <td align="center" background="images/bg.jpg"><object 
      codebase=http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0 
      height=451 width=960 classid=clsid:D27CDB6E-AE6D-11cf-96B8-444553540000>
          <param name="movie" value="flash/main_2.swf">
          <param name="quality" value="high">
          <param name="wmode" value="transparent">
          <embed src="flash/main_2.swf" quality="high" 
      pluginspage="http://www.macromedia.com/go/getflashplayer" 
      type="application/x-shockwave-flash" width="960" 
      height="451"></embed>
      </object></td></tr>
  </table>
<TABLE cellSpacing=0 cellPadding=0 width=996 align=center border=0>
  <TBODY>
  <TR>
    <TD width=30 
    vAlign=top 
    style="BACKGROUND: url(images/subpg/bg3.gif) repeat-x; PADDING-TOP: 29px">&nbsp;</TD>
    <TD width=182 
    vAlign=top 
    style="BACKGROUND: url(images/subpg/bg3.gif) repeat-x; PADDING-TOP: 0px"><TABLE cellSpacing=0 cellPadding=0 width=182 
      background=list.files/left_best02.gif border=0>
        <TBODY>
        <TR>
          <TD width="96%" bgcolor="#FFFFFF"><table border="0" cellpadding="0" cellspacing="0" width="182">
            
            <tr>
              <td><TABLE cellSpacing=0 cellPadding=0 width=180 
      background=images/left_best02.gif border=0>
                <TBODY>
                  <TR>
                    <TD bgcolor="#FFFFFF">&nbsp;</TD>
                  </TR>
                  <TR>
                    <TD><IMG src="images/hydl.gif" width="181" height="57" border=0></TD>
                  </TR>
                  <TR>
                    <TD align=middle><!-- #include file="login.asp"--></TD>
                  </TR>
                  <TR>
                    <TD><IMG src="images/left_ranking02.gif" width="181" height="16" 
      border=0></TD>
                  </TR>
                </TBODY>
              </TABLE></td>
            </tr>
          </table></TD>
        </TR>
        <TR>
          <TD height="10" bgcolor="#FFFFFF"></TD>
        </TR>
        <TR>
          <TD bgColor=#ffffff height=8><TABLE cellSpacing=0 cellPadding=0 width=180 
      background=images/left_best02.gif border=0>
            <TBODY>
              <TR>
                <TD><IMG src="images/left_best01.gif" width="181" height="67" border=0></TD>
              </TR>
              <TR>
                <TD align=middle><!--#include file="b2b_includefile/b2b_leftmenu.asp" --></TD>
              </TR>
              <TR>
                <TD><IMG src="images/left_ranking02.gif" width="181" height="16" 
      border=0></TD>
              </TR>
            </TBODY>
          </TABLE></TD>
        </TR>
        <TR>
          <TD bgColor=#ffffff height=10></TD>
        </TR></TBODY></TABLE>

      <TABLE cellSpacing=0 cellPadding=0 width=180 
      background=images/left_best02.gif border=0>
        <TBODY>
        <TR>
          <TD><IMG src="images/left_ranking01.gif" width="181" height="65" border=0></TD>
        </TR>
        <TR>
          <TD align=middle><!-- #include file="b2b_includefile/cick_hot.asp"--></TD>
        </TR>
        <TR>
          <TD><IMG src="images/left_ranking02.gif" width="181" height="16" 
      border=0></TD>
        </TR></TBODY></TABLE>
      <TABLE height=5 cellSpacing=0 cellPadding=0 width="75%" border=0>
        <TBODY>
        <TR>
          <TD height="10"></TD>
        </TR></TBODY></TABLE>
      <TABLE cellSpacing=0 cellPadding=0 width=180 border=0>
        <TBODY>
        <TR>
          <TD>
      <P><IMG src="images/cstm1.gif" 
          border=0></P></TD></TR></TBODY></TABLE></TD>
    <TD width=14 height="0" 
    vAlign=top 
    style="BACKGROUND: url(images/subpg/bg3.gif) repeat-x; PADDING-TOP: 29px">&nbsp;</TD>
    <TD style="BACKGROUND: url(images/subpg/bg3.gif) repeat-x; PADDING-TOP: 8px" 
    vAlign=top align=middle width=781>
      <TABLE cellSpacing=0 cellPadding=0 width=100% border=0>
        <FORM name=frmSort action=product_list.asp><INPUT type=hidden value=07 
        name=code1> <INPUT type=hidden name=code2> 
        <TBODY>
        <TR>
          <TD width="100%" align=left vAlign=middle class=cmfont><table width="100%" border="0" cellspacing="0" cellpadding="0">
            
            <tr>
              <td width="84%" height="20" align="left"><span class="STYLE2"><strong><img src="images/list.jpg" width="40" height="40" align="absmiddle">您现在的位置：</strong></span>
                    <%
response.write "<a href='index.asp'>商城首页</a>"&lstcat  '再要显示的地方调用这段就可以了
%>
              </span></td>
              <td width="16%" align="left"><a href="newarrivals.asp"><img src="images/list2.gif" width="100" height="20" border="0" align="absmiddle"></a></td>
            </tr>
          </table>
            </TD>
        </TR></TBODY></FORM></TABLE>
      <table cellspacing=0 cellpadding=0 width=72% border=0>
        <tbody>
          <tr>
            <td height=5></td>
          </tr>
          <tr>
            <td bgcolor=#d3d3d3></td>
          </tr>
          <tr>
            <td bgcolor=#f1f1f1 height=1></td>
          </tr>
          <tr>
            <td align="right"><table width="780" border="0" align="left" cellpadding="0" cellspacing="0">
                
                <tr>
                  <td width="665" align="center"><table width="100%"  border="0" align="right" cellpadding="0" cellspacing="0">
                    <tr>
                      <td><%
				Const MaxPerPage=30
   				dim totalPut   
   				dim CurrentPage
   				dim TotalPages
   				dim j
   				dim sql
    				if Not isempty(SafeRequest("page",1)) then
      				currentPage=Cint(SafeRequest("page",1))
   				else
      				currentPage=1
   				end if 
				
		 	set rs=server.CreateObject("adodb.recordset")
		  	rs.open "select prename,company,mark,intro,name,id,introduce,price1,price2,discount,pic,stock,spic from product where categoryid in ("& CatList&") and stock >= 0 and recommend<>3 order by adddate desc",conn,1,1 
                    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,"b2b_cplist.asp"
       				else
          				if (currentPage-1)*MaxPerPage<totalPut then
            				rs.move  (currentPage-1)*MaxPerPage
            				dim bookmark
            				bookmark=rs.bookmark
            				showContent
							showpage totalput,MaxPerPage,"b2b_cplist.asp"
        				else
	        				currentPage=1
           					showContent
	      				end if
	   				end if

   				sub showContent
       			dim i,t
	   			i=0
				t=1

			%>
                          <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
                            <%
			do while not rs.eof
			%>
                            <tr>
                              <%
				  for t=1 to 5
				  	if not rs.eof then
				  %>
                              <td align="center"><table width="4%" border="0" cellspacing="3" cellpadding="8">
                                <tr>
                                  <td align="center"><TABLE WIDTH="130" HEIGHT="160" BORDER="0">
                                    <TR>
                                      <TD width="140" height="130" colspan="2" align="center" background="image/cplistbg.jpg" class="bg"><a href=b2b_cpinfo.asp?id=<% = rs("id") %> target="_blank">
                                        <% if trim(rs("spic"))<>"" then %>
                                        <img src=image\<% = trim(rs("spic"))%>  border=0 width="<% = webimg9 %>" height="<% = webimg10 %>"></a>
                                          <%  else %>
                                          <img src=images/emptybook.jpg  border=0 width="<% = webimg9 %>" height="<% = webimg10 %>">
                                          <% end if %></TD>
                                    </TR>
                                    <tr>
                                      <td align="center"><%=trim(rs("name"))%></td>
                                    </tr>
                                    <tr>
                                      <td align="center"><% if rs("stock") > 0 then %>
                                          <table width="100%"  border="0" cellspacing="1" cellpadding="1">
                                            <tr>
                                              <td width="93%" align="left" class="STYLE2"><img src="images/won.gif" />&nbsp;市场价:<%=trim(rs("price1"))%>元<br>
                                                  <img src="images/won.gif" />&nbsp;会员价:<%=trim(rs("price2"))%>元 </td>
                                              <td width="7%" align="center"><a href="b2b_cpinfo.asp?id=<%=rs("id")%>" target="_blank"><img src="image/but_bbogi.gif" width="14" height="16" border="0" align="absmiddle"></a><br>
                                                <a href="####" onClick="MM_openBrWindow('check.asp?ProdId=<%=rs("id")%>','','scrollbars=yes,width=760,height=500')"><img src="image/but_bbogi2.gif" alt="购物车" width="14" height="14" border="0"></a></td>
                                            </tr>
                                        </table></td>
                                      <%else%>
                                      暂时缺货
                                      <% end if%>
                                    </tr>
                                  </TABLE></td>
                                </tr>
                              </table>
                              </td>
                              <%
						else

						end if
						if t<>5 then
							rs.movenext
						end if
					next
					%>
                            </tr>
                            <%
			i=i+5
			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 %>
                            <form method=Post action=<% = filename %>?catid=<% = catid %>>
                              <%
				If CurrentPage<2 Then  %>
                              <div align="center">
                              
                              首页 上页
                              <% Else  %>
                              <div align="center">
                              
                              <a href=<% = filename %>?page=1&catid=<% = catid %>>首页</a> <a href=<% = filename %>?page=<% = CurrentPage-1 %>&catid=<% = catid %>>上页</a>
                              <%
				End If
				If n-currentpage<1 Then  %>
                              下页 尾页
                              <%	Else  %>
                              <a href=<% = filename %>?page=<% = (CurrentPage+1) %>&catid=<% = catid %>>下页</a> <a href=<% = filename %>?page=<% = n %>&catid=<% = catid %>>尾页</a>
                              <%	End If  %>
                              第 <b>
                                <% = CurrentPage %>
                                </b>页 共 <b>
                                  <% = n %>
                                  </b>页 共 <b>
                                    <% = totalnumber %>
                                    </b>件商品 每页 <b>
                                      <% = maxperpage %>
                                      </b> 件商品 转到第：
                              <input class='input_sr' type='text' name='page' size=2 maxlength=10 value=<% = currentpage %>>
                              页
                              <input type='submit' class='input_bot' value='跳转' name='cndok'>
                            </form>
                            <%
				End Function  
			%>
                        </table></td>
                    </tr>
                    <tr>
                      <td><%showpage totalput,MaxPerPage,"b2b_cplist.asp"%></td>
                    </tr>
                      <tr>
                        <td width="100%">&nbsp;</td>
                      </tr>
                      <tr>
                        <td>&nbsp;</td>
                      </tr>
                  </table></td>
                </tr>
            </table></td>
          </tr>
        </tbody>
      </table></TD>
</TR></TBODY></TABLE>
<!-- PAGING -->
<TABLE width=940 border=0 align="center" cellPadding=0 cellSpacing=0>
  <TBODY>
  <TR>
    <TD><!--#include file="b2b_includefile/b2b_ver.asp" --></TD></TR></TBODY></TABLE></BODY></HTML>
