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

<%
dim sortsid,i,strsql,strcat,strsorts,catid
bid = SafeRequest("bid",1)
sid=SafeRequest("sid",1)
plid=SafeRequest("plid",1)
bd=Trim(FormatSQL(SafeRequest("bd",0)))
tp=SafeRequest("tp",1)
mp=SafeRequest("mp",1)


if bid<>"" then
set rs = server.CreateObject("adodb.recordset")
rs.open "select category from category where categoryid="&bid&" ",conn,1,1
strcat = rs("category")
rs.close
end if
if sid<>"" then
rs.open "select sorts from sorts where sortsid="&sid&" ",conn,1,1
strsorts = rs("sorts")
rs.close
end if
set rs=nothing

if bid<>"" then
protitle=strcat
end if
if sid<>"" then
protitle=strcat&strsorts
end if

if bid<> ""  then
protitle=protitle&bd

end if
if  protitle="" then
protitle="商品列表"

end if

strsid="|"&sid&"|"
strbid="|"&bid&"|"  
protitle=protitle&bd


webtitle=protitle
webkeywords=protitle
webdescription=protitle&"|"&webname
%>
<!--#include file="include/header.asp"--> 
<table width="980" BORDER="0" CELLSPACING="0" CELLPADDING="0" align="center" class=table-youxia bgcolor=#ffffff>
<TR><TD HEIGHT="30" bgcolor="#f1f1f1" width="100" class=table-xia>&nbsp;<font color="#999999"><b>您的位置：</b></FONT></TD>
<td bgcolor="#FFFFFF">&nbsp;<a href="index.asp"><b><%=webname%></b></a>

</td></tr>
 </table>
  
<table width="980" BORDER="0" CELLSPACING="0" CELLPADDING="0" align="center" class=table-zuoyou bgcolor=#ffffff>
<tr><td  valign="top" width="160">
<TABLE WIDTH="100%" BORDER="0" CELLSPACING="0" CELLPADDING="0">
        <tr>
          <td class=table-xia>
            <!--#include file="include/pronav1.asp"-->
          </td>
        </tr>
        
       
        
        <tr>
          <td class=table-xia>
           <!--#include file="include/brandall.asp"-->
          </td>
        </tr>
         <tr>
          <td class=table-xia>
           
          </td>
        </tr>
        <% if zuo2<>"" then %>
        <tr> 
          <td align="center" class=table-xia><A HREF=<%=zuo2url%> TARGET="_blank"><IMG SRC=<%=zuo2%> BORDER="0" WIDTH="160"></A></td>
        </tr>
        <% end if %>
        <% if zuo1<>"" then %>
        <tr> 
          <td align="center" class=table-xia><A HREF=<%=zuo1url%> TARGET="_blank"><IMG SRC=<%=zuo1%> BORDER="0" WIDTH="160"></A></td>
        </tr>
        <% end if %>
        <% if zuo3<>"" then %>
        <tr> 
          <td align="center" class=table-xia><A HREF=<%=zuo3url%> TARGET="_blank"><IMG SRC=<%=zuo3%> BORDER="0" WIDTH="160"></A></td>
        </tr>
        <% end if %>
        <tr>
          <td class=table-xia>
       
          </td>
        </tr>
		<% if zuo4<>"" then %>
        <tr> 
          <td align="center" class=table-xia><A HREF=<%=zuo4url%> TARGET="_blank"><IMG SRC=<%=zuo4%> BORDER="0" WIDTH="160"></A></td>
        </tr>
        <% end if %>
        <tr>
          <td class=table-xia>
          
          </td>
        </tr>
      </table>
    </td> <td WIDTH="10" ></td>
    <td align="center" valign="top" >
     
		  
                  <%           if mp="" or mp=0 then
				 MaxPerPage=20
                              elseif  mp=1 then
                                MaxPerPage=12
                               elseif  mp=2 then
                               MaxPerPage=16
                               elseif  mp=3 then
                                MaxPerPage=20
                                elseif  mp=4 then
                                MaxPerPage=24
                              elseif  mp=5 then
                                MaxPerPage=28

                              elseif  mp=6 then
                                MaxPerPage=32
                             elseif  mp=7 then
                                MaxPerPage=36
                            elseif  mp=8 then
                                MaxPerPage=40
                            elseif  mp=9 then
                                MaxPerPage=44
                            elseif  mp=10 then
                                MaxPerPage=48
                          
                              else
                                 MaxPerPage=16
                              end if

   				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")
                             if sid<>"" then
		  select case plid
                   case ""
		 rs.open "select * from product where  proup = 0    and   Instr(sortsid,'"&strsid&"')<>0   order by ordernum desc",conn,1,1 
                   case "0"
		 rs.open "select * from product where  proup = 0  and  Instr(sortsid,'"&strsid&"')<>0  and recommend=0  order by ordernum desc",conn,1,1 

		  case "1"
		 rs.open "select * from product where  proup = 0  and  Instr(sortsid,'"&strsid&"')<>0 and recommend=1  order by ordernum desc",conn,1,1 
		  case "2"
		  rs.open "select * from product where  proup = 0  and  Instr(sortsid,'"&strsid&"')<>0  and recommend=2  order by ordernum desc",conn,1,1 
		  case "3"
		   rs.open "select * from product where  proup = 0  and   Instr(sortsid,'"&strsid&"')<>0  and recommend=3 order by ordernum desc",conn,1,1 
		  case "4"
		  rs.open "select * from product where  proup = 0   and   Instr(sortsid,'"&strsid&"')<>0  and recommend=4  order by ordernum desc",conn,1,1 
                 case "5"
		  rs.open "select * from product where  proup = 0   and  Instr(sortsid,'"&strsid&"')<>0  and proup=0  order by ordernum desc",conn,1,1 
                   case "6"
		  rs.open "select * from product where  proup = 0   and  Instr(sortsid,'"&strsid&"')<>0  and proup=1  order by ordernum desc",conn,1,1 
                   case "7"
		   rs.open "select * from product where  proup = 0  and   Instr(sortsid,'"&strsid&"')<>0   order by solded desc",conn,1,1 
 
		  end select


                 elseif bid<>"" then
                   select case plid
                  case ""
		 rs.open "select * from product where  proup = 0 and    InStr(categoryid,'"&strbid&"')<>0   order by ordernum desc",conn,1,1 
                   case "0"
		 rs.open "select * from product where  proup = 0 and  InStr(categoryid,'"&strbid&"')<>0 and recommend=0   order by ordernum desc",conn,1,1 
		  case "1"
		 rs.open "select * from product where  proup = 0 and  InStr(categoryid,'"&strbid&"')<>0 and recommend=1   order by ordernum desc",conn,1,1 
		  case "2"
		  rs.open "select * from product where  proup = 0 and  InStr(categoryid,'"&strbid&"')<>0  and recommend=2  order by ordernum desc",conn,1,1 
		  case "3"
		   rs.open "select * from product where  proup = 0  and  InStr(categoryid,'"&strbid&"')<>0 and recommend=3  order by ordernum desc",conn,1,1 
		  case "4"
		  rs.open "select * from product where  proup = 0 and   InStr(categoryid,'"&strbid&"')<>0  and recommend=4  order by ordernum desc",conn,1,1 
                 case "5"
		  rs.open "select * from product where  proup = 0   and  InStr(categoryid,'"&strbid&"')<>0  and proup=0  order by ordernum desc",conn,1,1 
                   case "6"
		  rs.open "select * from product where  proup = 0  and  InStr(categoryid,'"&strbid&"')<>0  and proup=1  order by ordernum desc",conn,1,1 
                   case "7"
		   rs.open "select * from product where  proup = 0  and  InStr(categoryid,'"&strbid&"')<>0  order by solded desc",conn,1,1 
 
		  end select

                              
                  elseif bd<>"" then
                               
                 select case plid
                  case ""
		 rs.open "select * from product where  proup = 0 and brand like '%"&bd&"%'  order by ordernum desc",conn,1,1 
                  case "0"
		 rs.open "select * from product where  proup = 0 and brand like '%"&bd&"%' and recommend=0 order by ordernum desc",conn,1,1 
		  case "1"
		 rs.open "select * from product where  proup = 0 and brand like '%"&bd&"%' and recommend=1 order by ordernum desc",conn,1,1 
		  case "2"
		  rs.open "select * from product where  proup = 0  and brand like '%"&bd&"%' and recommend=2 order by ordernum desc",conn,1,1 
		  case "3"
		   rs.open "select * from product where  proup = 0 and brand like '%"&bd&"%' and recommend=3 order by ordernum desc",conn,1,1 
		  case "4"
		  rs.open "select * from product where  proup = 0 and brand like '%"&bd&"%' and recommend=4 order by ordernum desc",conn,1,1 
                 case "5"
		  rs.open "select * from product where  proup = 0 and brand like '%"&bd&"%' and proup=0 order by ordernum desc",conn,1,1 
                   case "6"
		  rs.open "select * from product where  proup = 0 and brand like '%"&bd&"%'and proup=1 order by ordernum desc",conn,1,1 
                   case "7"
		   rs.open "select * from product where  proup = 0 and brand like '%"&bd&"%'  order by solded desc",conn,1,1 
 
		  end select

                     else

                 select case plid
                  case ""
		 rs.open "select * from product where  proup = 0   order by ordernum desc",conn,1,1 
                  case "0"
		 rs.open "select * from product where  proup = 0  and recommend=0 order by ordernum desc",conn,1,1 
		  case "1"
		 rs.open "select * from product where  proup = 0  and recommend=1 order by ordernum desc",conn,1,1 
		  case "2"
		  rs.open "select * from product where  proup = 0   and recommend=2 order by ordernum desc",conn,1,1 
		  case "3"
		   rs.open "select * from product where  proup = 0  and recommend=3 order by ordernum desc",conn,1,1 
		  case "4"
		  rs.open "select * from product where  proup = 0  and recommend=4 order by ordernum desc",conn,1,1 
                 case "5"
		  rs.open "select * from product where  proup = 0  and proup=0 order by ordernum desc",conn,1,1 
                   case "6"
		  rs.open "select * from product where  proup = 0  and proup=1 order by ordernum desc",conn,1,1 
                   case "7"
		   rs.open "select * from product where  proup = 0   order by solded desc",conn,1,1 
 
		  end select     

                             end if
				
  				if rs.eof And rs.bof then
if tp<>"" then

 if sid<>"" then
     if plid<>"" then
  filename1="proclass.asp?bid="&bid&"&sid="&sid&"&tp="&tp&"&plid="&plid&"&"
  filename2="proclass.asp?bid="&bid&"&sid="&sid&"&plid="&plid&"&"
  filename3="proclass.asp?bid="&bid&"&sid="&sid&"&tp="&tp&"&"
     else
  filename1="proclass.asp?bid="&bid&"&sid="&sid&"&tp="&tp&"&"
  filename2="proclass.asp?bid="&bid&"&sid="&sid&"&"
  filename3="proclass.asp?bid="&bid&"&sid="&sid&"&tp="&tp&"&"
     end if

 elseif bid<>"" then
    if plid<>"" then
  filename1="proclass.asp?bid="&bid&"&tp="&tp&"&plid="&plid&"&"
  filename2="proclass.asp?bid="&bid&"&plid="&plid&"&"
  filename3="proclass.asp?bid="&bid&"&tp="&tp&"&"
     else
   filename1="proclass.asp?bid="&bid&"&tp="&tp&"&"
  filename2="proclass.asp?bid="&bid&"&"
  filename3="proclass.asp?bid="&bid&"&tp="&tp&"&"
  
     end if

  
 else
    if bd<>"" then 
       if plid<>"" then
  filename1="proclass.asp?bd="&bd&"&tp="&tp&"&plid="&plid&"&"
  filename2="proclass.asp?bd="&bd&"&plid="&plid&"&"
  filename3="proclass.asp?bd="&bd&"&tp="&tp&"&"
       else
    filename1="proclass.asp?bd="&bd&"&tp="&tp&"&"
  filename2="proclass.asp?bd="&bd&"&"
  filename3="proclass.asp?bd="&bd&"&tp="&tp&"&"
       end if

    else
      if plid<>"" then
     
  filename1="proclass.asp?plid="&plid&"&tp="&tp&"&"
  filename2="proclass.asp?plid="&plid&"&"
  filename3="proclass.asp?tp="&tp&"&"
          else
    filename1="proclass.asp?tp="&tp&"&"
  filename2="proclass.asp?"
  filename3="proclass.asp?tp="&tp&"&"
         end if

    end if
  end if

else
  if sid<>"" then
      if plid<>"" then
  filename1="proclass.asp?bid="&bid&"&sid="&sid&"&plid="&plid&"&"
  filename2="proclass.asp?bid="&bid&"&sid="&sid&"&plid="&plid&"&"
  filename3="proclass.asp?bid="&bid&"&sid="&sid&"&"
     else
   filename1="proclass.asp?bid="&bid&"&sid="&sid&"&"
  filename2="proclass.asp?bid="&bid&"&sid="&sid&"&"
  filename3="proclass.asp?bid="&bid&"&sid="&sid&"&"
     end if
   
 elseif bid<>"" then
         if plid<>"" then
  filename1="proclass.asp?bid="&bid&"&plid="&plid&"&"
  filename2="proclass.asp?bid="&bid&"&plid="&plid&"&"
  filename3="proclass.asp?bid="&bid&"&"
        else
   filename1="proclass.asp?bid="&bid&"&"
  filename2="proclass.asp?bid="&bid&"&"
  filename3="proclass.asp?bid="&bid&"&"
        end if
  
 else
    if bd<>"" then
        if plid<>"" then
  filename1="proclass.asp?bd="&bd&"&plid="&plid&"&"
  filename2="proclass.asp?bd="&bd&"&plid="&plid&"&"
  filename3="proclass.asp?bd="&bd&"&"
        else
   filename1="proclass.asp?bd="&bd&"&"
  filename2="proclass.asp?bd="&bd&"&"
  filename3="proclass.asp?bd="&bd&"&"
         end if
    else
       if plid<>"" then
  filename1="proclass.asp?plid="&plid&"&"
  filename2="proclass.asp?plid="&plid&"&"
  filename3="proclass.asp?"
       else
    filename1="proclass.asp?"
  filename2="proclass.asp?"
  filename3="proclass.asp?"
       end if
    end if
  end if

end if
%>
 <TABLE width=100% cellSpacing=0 cellPadding=0  align=center border=0  class=prolist_top>
        <TBODY>    	
           <TR>  
             <td class="classYetd1" nowrap="nowrap"><div class="classYetd1title">显示方式：</div>
        <div class="classYetd1a1" title="按图片显示"><a href="<% = filename2 %>tp=0" id="top_link_listdisplay1"></a></div>
        <div class="classYetd1a2" title="按列表显示"><a href="<% = filename2 %>tp=1" id="top_link_listdisplay2"></a></div>
        <div class="classYetd1a3" title="按文字显示"><a href="<% = filename2 %>tp=2" id="top_link_listdisplay3"></a></div></td>
           <td width=200  align="left" style='PADDING-left: 12px'><strong><%=protitle%></strong><td/>
           <td width=100  align="right">

<select NAME="select" ONCHANGE="var jmpURL=this.options[this.selectedIndex].value ; if(jmpURL!='') {window.location=jmpURL;} else {this.selectedIndex=0 ;}" >
<OPTION selected>显示类别</OPTION>
  <option value="proclass.asp?" >网站全部</option>
<%if  filename3 <>"proclass.asp" then %>
  <option value="<% = filename3 %>plid=0"  <% if plid=0 Then Response.write("Selected") %>><%=protitle%>类所有</option>
<%end if%>
  <option value="<% = filename3 %>plid=1" <% if plid=1 Then Response.write("Selected") %>><%=protitle%>新品</option>
  <option value="<% = filename3 %>plid=2" <% if plid=2 Then Response.write("Selected") %>><%=protitle%>推荐</option>
  <option value="<% = filename3 %>plid=3" <% if plid=3 Then Response.write("Selected") %>><%=protitle%>特价</option>
  <option value="<% = filename3 %>plid=4" <% if plid=4 Then Response.write("Selected") %>><%=protitle%>赠品</option>
                      
   
</select> </td>
              <td width=200  align="right" style='PADDING-right: 12px'>每页显示数量
             <select name="mpe" onChange="var jmpURL=this.options[this.selectedIndex].value ; if(jmpURL!='') {window.location=jmpURL;} else {this.selectedIndex=0 ;}" > 
              <% For pp = 1 To 10 %>
                   <option value="<% = filename1 %>mp=<%=pp%>" <% if pp=int(mp) Then Response.write("Selected") %> >&nbsp;<%=8+pp*4%>&nbsp;</option> 
            
               <% next %>      
     </select>
             </td>
        </tr>
      </table><br/>
<%
       				Response.Write "<p align='center' class='contents'> 对不起，此分类暂时还没有商品！</p>"
   				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,"proclass.asp"
       				else
          				if (currentPage-1)*MaxPerPage<totalPut then
            				rs.move  (currentPage-1)*MaxPerPage
            				dim bookbrand
            				bookbrand=rs.bookbrand
            				showContent
             				showpage totalput,MaxPerPage,"proclass.asp"
        				else
	        				currentPage=1
           					showContent
           					showpage totalput,MaxPerPage,"proclass.asp"
	      				end if
	   				end if
   				end if

   				sub showContent
       			dim i
	   			i=0
if tp<>"" then

 if sid<>"" then
     if plid<>"" then
  filename1="proclass.asp?bid="&bid&"&sid="&sid&"&tp="&tp&"&plid="&plid&"&"
  filename2="proclass.asp?bid="&bid&"&sid="&sid&"&plid="&plid&"&"
  filename3="proclass.asp?bid="&bid&"&sid="&sid&"&tp="&tp&"&"
     else
  filename1="proclass.asp?bid="&bid&"&sid="&sid&"&tp="&tp&"&"
  filename2="proclass.asp?bid="&bid&"&sid="&sid&"&"
  filename3="proclass.asp?bid="&bid&"&sid="&sid&"&tp="&tp&"&"
     end if

 elseif bid<>"" then
    if plid<>"" then
  filename1="proclass.asp?bid="&bid&"&tp="&tp&"&plid="&plid&"&"
  filename2="proclass.asp?bid="&bid&"&plid="&plid&"&"
  filename3="proclass.asp?bid="&bid&"&tp="&tp&"&"
     else
   filename1="proclass.asp?bid="&bid&"&tp="&tp&"&"
  filename2="proclass.asp?bid="&bid&"&"
  filename3="proclass.asp?bid="&bid&"&tp="&tp&"&"
  
     end if

  
 else
    if bd<>"" then 
       if plid<>"" then
  filename1="proclass.asp?bd="&bd&"&tp="&tp&"&plid="&plid&"&"
  filename2="proclass.asp?bd="&bd&"&plid="&plid&"&"
  filename3="proclass.asp?bd="&bd&"&tp="&tp&"&"
       else
    filename1="proclass.asp?bd="&bd&"&tp="&tp&"&"
  filename2="proclass.asp?bd="&bd&"&"
  filename3="proclass.asp?bd="&bd&"&tp="&tp&"&"
       end if

    else
      if plid<>"" then
     
  filename1="proclass.asp?plid="&plid&"&tp="&tp&"&"
  filename2="proclass.asp?plid="&plid&"&"
  filename3="proclass.asp?tp="&tp&"&"
          else
    filename1="proclass.asp?tp="&tp&"&"
  filename2="proclass.asp?"
  filename3="proclass.asp?tp="&tp&"&"
         end if

    end if
  end if

else
  if sid<>"" then
      if plid<>"" then
  filename1="proclass.asp?bid="&bid&"&sid="&sid&"&plid="&plid&"&"
  filename2="proclass.asp?bid="&bid&"&sid="&sid&"&plid="&plid&"&"
  filename3="proclass.asp?bid="&bid&"&sid="&sid&"&"
     else
   filename1="proclass.asp?bid="&bid&"&sid="&sid&"&"
  filename2="proclass.asp?bid="&bid&"&sid="&sid&"&"
  filename3="proclass.asp?bid="&bid&"&sid="&sid&"&"
     end if
   
 elseif bid<>"" then
         if plid<>"" then
  filename1="proclass.asp?bid="&bid&"&plid="&plid&"&"
  filename2="proclass.asp?bid="&bid&"&plid="&plid&"&"
  filename3="proclass.asp?bid="&bid&"&"
        else
   filename1="proclass.asp?bid="&bid&"&"
  filename2="proclass.asp?bid="&bid&"&"
  filename3="proclass.asp?bid="&bid&"&"
        end if
  
 else
    if bd<>"" then
        if plid<>"" then
  filename1="proclass.asp?bd="&bd&"&plid="&plid&"&"
  filename2="proclass.asp?bd="&bd&"&plid="&plid&"&"
  filename3="proclass.asp?bd="&bd&"&"
        else
   filename1="proclass.asp?bd="&bd&"&"
  filename2="proclass.asp?bd="&bd&"&"
  filename3="proclass.asp?bd="&bd&"&"
         end if
    else
       if plid<>"" then
  filename1="proclass.asp?plid="&plid&"&"
  filename2="proclass.asp?plid="&plid&"&"
  filename3="proclass.asp?"
       else
    filename1="proclass.asp?"
  filename2="proclass.asp?"
  filename3="proclass.asp?"
       end if
    end if
  end if

end if

			%>

 <TABLE width=100% cellSpacing=0 cellPadding=0  align=center border=0  class=prolist_top>
        <TBODY>    	
           <TR>  
             <td class="classYetd1" nowrap="nowrap"><div class="classYetd1title">显示方式：</div>
        <div class="classYetd1a1" title="按图片显示"><a href="<% = filename2 %>tp=0" id="top_link_listdisplay1"></a></div>
        <div class="classYetd1a2" title="按列表显示"><a href="<% = filename2 %>tp=1" id="top_link_listdisplay2"></a></div>
        <div class="classYetd1a3" title="按文字显示"><a href="<% = filename2 %>tp=2" id="top_link_listdisplay3"></a></div></td>
           <td width=200  align="left" style='PADDING-left: 12px'><strong><%=protitle%></strong><td/>
           <td width=100  align="right">

<select NAME="select" ONCHANGE="var jmpURL=this.options[this.selectedIndex].value ; if(jmpURL!='') {window.location=jmpURL;} else {this.selectedIndex=0 ;}" >
<OPTION selected>显示类别</OPTION>
  <option value="proclass.asp" >网站全部</option>
 <%if  filename3 <>"proclass.asp?" then %>
  <option value="<% = filename3 %>plid=0"  <% if plid=0 Then Response.write("Selected") %>><%=protitle%>类所有</option>
<%end if%>
  <option value="<% = filename3 %>plid=1" <% if plid=1 Then Response.write("Selected") %>><%=protitle%>新品</option>
  <option value="<% = filename3 %>plid=2" <% if plid=2 Then Response.write("Selected") %>><%=protitle%>推荐</option>
  <option value="<% = filename3 %>plid=3" <% if plid=3 Then Response.write("Selected") %>><%=protitle%>特价</option>
  <option value="<% = filename3 %>plid=4" <% if plid=4 Then Response.write("Selected") %>><%=protitle%>赠品</option>
                      
   
</select> </td>
              <td width=200  align="right" style='PADDING-right: 12px'>每页显示数量
             <select name="mpe" onChange="var jmpURL=this.options[this.selectedIndex].value ; if(jmpURL!='') {window.location=jmpURL;} else {this.selectedIndex=0 ;}" > 
              <% For pp = 1 To 10 %>
                   <option value="<% = filename1 %>mp=<%=pp%>" <% if pp=int(mp) Then Response.write("Selected") %> >&nbsp;<%=8+pp*4%>&nbsp;</option> 
            
               <% next %>      
     </select>
             </td>
        </tr>
      </table><br/>
             
            <%
			do while not rs.eof%>

           <% if tp="" or tp=0  then %>
         
	  <TABLE width=98% cellSpacing=0 cellPadding=0  align=center border=0>
              <TBODY>    	

              <TR>  
                
               <% 
if rs.eof then 
Response.Write "没有相关记录"
else
For i = 1 To MaxPerPage


                        %>  

                 <TD width=25% border="0" align=center >
              
                 <!--#include file="include/price1.asp"-->
               </TD>



  <%
j=j+1

m=4 

If j>m-1 Then 

Response.Write "</tr><tr>"
j=0
End If


Rs.MoveNext

if rs.eof then exit for
next


End If

%> </table>   

             <%elseif tp=1 then%>
           <TABLE width=95% cellSpacing=0 cellPadding=0  align=center border=0>
              <TBODY>        
              <tr> 
                <td width="20%" valign="middle" HEIGHT="160" align="center" class=table-xia  > 
				 <a href=product.asp?id=<% = rs("id") %> target="_blank"> 
                        <% if trim(rs("pic"))<>"" then %>
                        <img src=<% = trim(rs("pic"))%>  border=0 width="<% = webimg9 %>" height="<% = webimg10 %>" onload="DrawImage(this,<% = webimg10 %>, <% = webimg9 %>)"></a> 
                        <%  else %>
                        <img src=images/emptybook.jpg  border=0 width="<% = webimg9 %>" height="<% = webimg10 %>" onload="DrawImage(this,<% = webimg10 %>, <% = webimg9 %>)"></a> 
                        <% end if %>
                     </td>
                <td width="80%" class=table-xia>
				<table width="100%" border="0" align="center" cellpadding="2" cellspacing="1">
                    <tr> 
                      <td colspan="2"> 
                        名称：<a href=product.asp?id=<%=rs("id")%>><font color="#B15688"><%=trim(rs("name"))%></font></a></td>
                    </tr>
                    <tr> 
                      <td colspan="2"> <%=trim(rs("company"))%><a href=proclass.asp?bd=<% = rs("brand") %>><font color="#B15688"><% = rs("brand") %></font></a></td>
                    </tr>
                    <tr> 
                      <td colspan="2"><%=trim(rs("intro"))%><%=trim(rs("introduce"))%></td>
                    </tr>
                    <tr> 
                      <td width="40%">市场价：<S><%=rs("price1")%>元</S></td>
                      <td >网店价：
                     
                  <% if LngUserID=0 or Lnggrpid = 4 then%>
		<FONT COLOR="#B15688"></FONT><font color=red><%=rs("price2")%>元</font>
             <% Else %>
		<FONT COLOR=red><%=Round(trim(rs("price2")*LngDiscount),2)%></FONT>
                  元 
                    <%End If %></TD>
                     </tr>
                     <% if rs("stock") > 0 then %> <TR>
                      <TD align="center" colspan="2">  <a href="shopcart.asp?ProdId=<% = rs("id") %>" target="_blank"><img src=skin/skin1/cart/mnu<% = webbg16 %>_bg.png align=absmiddle border=0></a></TD>
                    </TR>
					<% else %>
					<tr><td colspan="2" align="center"><font color="#B15688">暂时缺货</font></td></tr>
					<% end if %>
                  </table></td>
              </tr>
           </table>
             <%else%>
               <TABLE width=95% cellSpacing=0 cellPadding=0  align=center border=0>
              <TBODY>    
                    <tr> 
                      <td width="50%" height=30>· 
                        <a href=product.asp?id=<%=rs("id")%>><font color="#333333"><%=trim(rs("name"))%></font></a></td>
 
                       <td width="15%">市场价：<S><%=rs("price1")%>元</S></td>

                       <TD width="15%">网店价：
               <% if LngUserID=0 or Lnggrpid = 4 then%>
		<FONT COLOR="#B15688"></FONT><font color=red><%=rs("price1")%>元</font>
             <% Else %>
		<FONT COLOR=red><%=Round(trim(rs("price2")*LngDiscount),2)%></FONT>
                  元 
                    <%End If %>
                   </TD>
                   
                     <% if rs("stock") > 0 then %> 
                      <TD align="center" >  <a href="shopcart.asp?ProdId=<% = rs("id") %>" target="_blank">加入购物车</a></TD>
             
					<% else %>
					<td  align="center"><font color="#B15688">暂时缺货</font></td>
					<% end if %>
                 
              </tr>
          </table>
          <%end if%> 
        
     
            <%
			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

if tp<>"" then

if sid<>"" then
    if plid<>"" then
  filename="proclass.asp?bid="&bid&"&sid="&sid&"&tp="&tp&"&plid="&plid&"&"
    else
 filename="proclass.asp?bid="&bid&"&sid="&sid&"&tp="&tp&"&"
    end if

 elseif bid<>"" then
   if plid<>"" then
  filename="proclass.asp?bid="&bid&"&tp="&tp&"&plid="&plid&"&"
   else
    filename="proclass.asp?bid="&bid&"&tp="&tp&"&"
   end if

 else
    if bd<>"" then
      if plid<>"" then
  filename="proclass.asp?plid="&plid&"&bd="&bd&"&tp="&tp&"&plid="&plid&"&"
      else
   filename="proclass.asp?plid="&plid&"&bd="&bd&"&tp="&tp&"&"
      end if

    else
     if plid<>"" then
  filename="proclass.asp?plid="&plid&"&tp="&tp&"&"
    else
  filename="proclass.asp?tp="&tp&"&"
    end if

    end if
  end if
else
  if sid<>"" then
     if plid<>"" then
   filename="proclass.asp?bid="&bid&"&sid="&sid&"&plid="&plid&"&"
     else
   filename="proclass.asp?bid="&bid&"&sid="&sid&"&"
     end if

 elseif bid<>"" then
    if plid<>"" then
  filename="proclass.asp?bid="&bid&"&plid="&plid&"&"
    else
  filename="proclass.asp?bid="&bid&"&"
    end if
 
 else
    if bd<>"" then
      if plid<>"" then
  filename="proclass.asp?plid="&plid&"&bd="&bd&"&"
     else
  filename="proclass.asp?bd="&bd&"&"
     end if
   
    else

    if plid<>"" then
  filename="proclass.asp?plid="&plid&"&"
     else
  filename="proclass.asp?"
    end if
 
    end if
 end if

end if



 %>
                 
                    <p align='center'> 
                      <%
				If CurrentPage<2 Then  %>
                      <span class=page>首页</span>  <span class=page>上页</span> 
                      <%
				Else   %>
                      <a href=<% = filename %>page=1><span class=page>首页</span></a> 
                      <a href=<% = filename %>page=<% = CurrentPage-1 %>><span class=page>上页</span></a> 
                      <%
				End If	
				If n-currentpage<1 Then  %>
                     <span class=page> 下页</span> <span class=page>末页</span> 
                      <%
				Else   %>
                      <a href=<% = filename %>page=<% = (CurrentPage+1) %>><span class=page>下页</span></a> 
                      <a href=<% = filename %>page=<% = n %>><span class=page>末页</span></a> 
                      <%
				End If  %>
                      第 <b> 
                      <% = CurrentPage %>
                      </b> 页 共 <b> 
                      <% = n %>
                      </b> 页 共&nbsp;<b> 
                      <% = totalnumber %>
                      </b>&nbsp;件商品　每页 <b> 
                      <% = maxperpage %>
                      </b> 件商品 转到第： 
      <select name="state" onChange="var jmpURL=this.options[this.selectedIndex].value ; if(jmpURL!='') {window.location=jmpURL;} else {this.selectedIndex=0 ;}" > 
              <% For p = 1 To n %>
                   <option value="<% = filename %>page=<%=p%>" <% if p=CurrentPage Then Response.write("Selected") %> ><%=p%></option> 
            
               <% next %>      
     </select>
       <%End Function  %>
                  
             </p><br/>
		 </td>
        </tr>
      </table></td></tr></table>
<!--#include file="include/footer.asp"--> 