<!--#include file="conn.asp"-->
<!--#include file="inc_product_list.asp"-->
<%
'if s_head="head4.asp" or s_productkind="4" then
'	response.write "<!DOCTYPE html PUBLIC ""-//W3C//DTD XHTML 1.0 Transitional//EN"" ""http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"">"
'else
	response.write "<!DOCTYPE HTML PUBLIC ""-//W3C//DTD HTML 4.01 Transitional//EN"">"
'end if
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title><%=application("sitename")%></title>
<link href="i.css" type=text/css rel=stylesheet>
<style type="text/css">
<!--

.style1 {font-size: 14px}
.style11 {
	font-size: 14px;
	color: #666666;
	font-weight: bold;
}
.style12 {color: #990000}
.STYLE13 {
	color: #999999;
	font-weight: bold;
}
.g1 { margin-top:9px; clear:both; height:26px; border-bottom:#CCCCCC dotted 1px; margin-bottom:4px;  font-size:11pt;FONT-FAMILY: "微软雅黑"; font-weight:bold; }
.g2 { clear:both; height:23px;  font-size:10pt;FONT-FAMILY: "微软雅黑";}
.g2 ul{ width:95px; height:23px; float:left; PADDING:0px; MARGIN: 0px; }

.g1 A{ TEXT-DECORATION: none;PADDING: 3px; COLOR: #333333;}
.g2 A{ TEXT-DECORATION: none;PADDING: 3px; COLOR: #333333;}
.g3 A{ TEXT-DECORATION: none;PADDING: 3px; COLOR: #333333; font-size:12px;FONT-FAMILY: "宋体";}

.g1 A:hover{ BACKGROUND-COLOR: #1063AD; COLOR: #ffffff; TEXT-DECORATION: none;  }
.g2 A:hover{ BACKGROUND-COLOR: #1063AD; COLOR: #ffffff; TEXT-DECORATION: none; }
.g3 A:hover{ BACKGROUND-COLOR: #1063AD; COLOR: #ffffff; TEXT-DECORATION: none; }
.changeall{ 
overflow:visible
}
.changeback{
height:145px;
overflow:hidden;}

-->
</style>


<script language="javascript">
<!--
function SetBgColor(Menu)
{
		Menu.style.background="#F3F3F5";
}
function RestoreBgColor(Menu)
{
		Menu.style.background="#ffffff";
}
-->
</script>
<SCRIPT LANGUAGE="JavaScript">
function Turn()
{
	if(proallkind.className=="changeback")
	{
		proallkind.className="changeall";
		turnimg.src="images/yaoclose.jpg";
	}
	else
	{
		proallkind.className="changeback";
		turnimg.src="images/yaoopen.jpg";
		window.scroll(0,0);
	}
}
</SCRIPT>

<%
dim kind,nowpage
dim pkid,model,productname,smallpicpath,price1,price2,pipai
dim sql_condition,cx,hot,qg,myword
dim i,q

kind=request("kind")
nowpage=request("page")
cx=request("cx")
hot=request("hot")
qg=request("qg")

searchkind=trim(request("searchkind"))
myword=trim(request("myword"))
display_mode="grid"

'-----------order b-----------------
dim order_mode
if request.querystring("order_mode")<>"" then 
	response.cookies("order_mode_cook")=request.querystring("order_mode")
	response.cookies("order_mode_cook").Expires="2027-12-31"
	order_mode=request.querystring("order_mode")
elseif request.cookies("order_mode_cook")<>"" then
	order_mode=request.cookies("order_mode_cook")
else
	order_mode="adddown"
end if

if order_mode="addup" then
	order_name=" pkid asc "
elseif order_mode="adddown" then
	order_name=" pkid desc "
elseif order_mode="priceup" then
	order_name=" cdbl(price"&session("customkind")&") asc "
elseif order_mode="pricedown" then
	order_name=" cdbl(price"&session("customkind")&") desc "
elseif order_mode="hitup" then
	order_name=" hit asc "
elseif order_mode="hitdown" then
	order_name=" hit desc "
elseif order_mode="saleup" then
	order_name=" saleshu asc "
elseif order_mode="saledown" then
	order_name=" saleshu desc "
else
	order_name=" pkid desc "
end if
'---------- order e-----------------

'-----------page b-----------------
dim page_mode
if request.querystring("page_mode")<>"" then 
	response.cookies("page_mode_cook")=request.querystring("page_mode")
	response.cookies("page_mode_cook").Expires="2027-12-31"
	page_mode=request.querystring("page_mode")
elseif request.cookies("page_mode_cook")<>"" then
	page_mode=request.cookies("page_mode_cook")
else
	page_mode=s_col*s_row
end if
'---------- page e-----------------

%>
</head>

<body>
<!-- #include file="head.asp" -->
<TABLE width="996" border=0 align="center" cellPadding=0 cellSpacing=0 bgcolor="#FFFFFF" style="margin:auto;">
  <tr>
    <td> 

<%
sql="select *,( select iif(IsNull(count(id)),0,count(id)) from e_product where e_product.kind=a.kindnum ) as sumpro from sh_kind a order by kindnum"
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,1
if rs.bof or rs.eof then
	response.write "<div align=center>当前没有记录。"
	call actionbutton(menuid,"3","b_kindadd.asp?menuid="&request("menuid"))
	response.write "</div>"
else
%>
	<table width="996" align="center" border=0 cellPadding=0 cellSpacing=0 style="border-left:1px #85160f solid ">
	<tr height=8>
	<td width="200"></td>
	<td width="1" bgcolor="#990000"></td>
	<td width="795"></td>
	</tr>
	<tr height="1">
	<td></td>
	<td bgcolor="#990000"></td>
	<td bgcolor="#990000"></td>
	</tr></table>
	<TABLE  width="996" align="center" border=0 cellPadding=0 cellSpacing=1 style="padding:2px 15px 10px 15px;  border-left:1px #85160f solid ; border-top:0px #85160f solid ; border-right:1px #85160f solid; border-bottom:1px #85160f solid; " >
		<TR>
			<TD>
			<div id="proallkind" class="changeback">
			<%
				line=1
				t=1
				if not rs.eof then
				do while not rs.eof
					id=rs("id")
					kindnum=rs("kindnum")
					kindname=rs("kindname")
					sumpro = rs("sumpro")
					indexshow = rs("indexshow")
					
					grade=len(kindnum)/4
		
					if grade=1 then
						if line>1 then
							response.write "<div><UL></UL></div></div>"&vbcrlf
							line=1
						else
							line=line + 1
						end if
						response.write "<div class='g1'><a href='productlist.asp?kind="&kindnum&"'>"&t&"F "&kindname&"</a></div>"&vbcrlf
						t=t+1
					elseif grade=2 then
						response.write "<div class='g2'><UL>&nbsp;&nbsp;<a href='productlist.asp?kind="&kindnum&"'>"&kindname&"</a></UL>"
					else
						response.write "<UL class='g3'><a href='productlist.asp?kind="&kindnum&"'>"&kindname&"</a></UL>"
					end if
					
				rs.movenext
				loop
				response.write "</div>"&vbcrlf
				end if
			%>
			</div>
			</TD>
		</TR>
		<tr><td align="center"><a  onclick="Turn()"><IMG src='images/yaoopen.jpg' border=0 id=turnimg style="CURSOR: pointer"></a></td></tr>
      </TABLE>
<%
end if
rs.close
set rs=nothing
%>



<TABLE width="996" align="center" border=0 cellPadding=0 cellSpacing=0 background="images/bg4.gif" style="margin-top:12px;">
	  <TBODY>
		<TR>
		<td>当前位置：<a href='index.asp'>首页</a>
		<%
		if kind<>"" then
			for kk=4 to len(kind) step 4
				sql4="select kindnum,kindname from sh_kind where kindnum='"&left(kind,kk)&"'"
				set rs4=conn.execute(sql4)
				if rs4.bof or rs4.eof then
				else
					p_kind=rs4("kindnum")
					p_name=rs4("kindname")
					response.write " -&gt; <a href='productlist.asp?kind="&p_kind&"'>"&p_name&"</a>"
				end if
				rs4.close
				set rs4=nothing
			next 
		else
			if cx="1" then
				response.write " -&gt; 促销商品"
			elseif hot="1" then
				response.write " -&gt; 热卖商品"
			elseif qg="1" then
				response.write " -&gt; 抢购商品"
			else
				response.write " -&gt; 全部商品"
			end if
		end if
		%>
		</td>
		</TR>
	</TBODY>
</TABLE>


<% if s_pinpai="是" then   '商品品牌begin%>
	 <TABLE width="996" align="center" border=0 cellPadding=0 cellSpacing=0 background="images/bg4.gif" style="margin-top:5px;">
	  <TBODY>
		<TR>
				  <TD width="128" height=30 background=images/hotnewpro.gif>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="style11">商品品牌</span></TD>
				  <TD width="436">&nbsp;</TD>
				  <TD width="73">&nbsp;</TD>
				  <TD width="96">&nbsp;</TD>
				  <TD width="21">&nbsp;</TD>
				  <TD width="22">&nbsp;</TD>
				  
				  
		</TR>
	  	</TBODY>
      </TABLE>
	<table width="996" border="0" align="center" cellpadding="1" cellspacing="0">
	<tr><td height=3></td></tr>
        <tr><td align="center">
		<%
		sql="select * from x_pinpai order by num"
		set rs=server.createobject("adodb.recordset")
		rs.open sql,conn,1,1
		if rs.bof or rs.eof then
			response.write "<td>暂时没有商品品牌。</td>"
		else
			do while not rs.eof
			picpath=rs("picpath")
			url=rs("url")
			memo=rs("memo")
				
			response.write "<div style='float:left;margin:5px;'>"
			response.write "<a href='productlist.asp?page=1&myword="&memo&"&none='><IMG src='"&managerfolder&"/"&picpath&"' width='"&s_pinpaiw&"' height='"&s_pinpaih&"' border=0 style='border:#eee 1px solid;'></a>"
			response.write "</div>"
			
			rs.movenext
			loop
		end if
		rs.close
		set rs=nothing
		%>
        </td></tr>
		<tr><td height=3></td></tr>
      </table>
<%end if    '商品品牌end%>



	<TABLE width="996" align="center" border=0 cellPadding=0 cellSpacing=0 background="images/bg4.gif" style="margin-top:6px;margin-bottom:3px;">
	  <TBODY>
		<TR>
			  <TD width=126 height=30 background=images/hotnewpro.gif>&nbsp;&nbsp;&nbsp;&nbsp;<span class="style11">
			  <%
				if cx="1" then
					response.write "促销商品"
				elseif hot="1" then
					response.write "热卖商品"
				elseif qg="1" then
					response.write "抢购商品"
				else
					response.write "全部商品"
				end if
				%></span></TD>
			  <TD  align="right" >
				<span class="STYLE13">排序方式：</span>
上架时间:<a href="javascript:void(0);display_mode('addup');" ><img src="images/orderup.jpg" border="0" alt=""></a>&nbsp;<a href="javascript:void(0);display_mode('adddown');" ><img src="images/orderdown.jpg" border="0" alt=""></a>&nbsp;&nbsp;
价格:<a href="javascript:void(0);display_mode('priceup');" ><img src="images/orderup.jpg" border="0" alt=""></a>&nbsp;<a href="javascript:void(0);display_mode('pricedown');" ><img src="images/orderdown.jpg" border="0" alt=""></a>&nbsp;&nbsp;
人气:<a href="javascript:void(0);display_mode('hitdown');" ><img src="images/orderdown.jpg" border="0" alt=""></a>&nbsp;<a href="javascript:void(0);display_mode('hitup');" ><img src="images/orderup.jpg" border="0" alt=""></a>&nbsp;&nbsp;
销量:<a href="javascript:void(0);display_mode('saledown');" ><img src="images/orderdown.jpg" border="0" alt=""></a>&nbsp;<a href="javascript:void(0);display_mode('saleup');" ><img src="images/orderup.jpg" border="0" alt=""></a>&nbsp;&nbsp;			  </TD>
		  </TR>
	  	</TBODY>
      </TABLE>
<%
sql_condition=" where updown='1' "
if kind<>"" then
	sql_condition = sql_condition & " and ( kind like '"&kind&"%' or kind2 like '"&kind&"%' or kind3 like '"&kind&"%' or kind4 like '"&kind&"%' or kind5 like '"&kind&"%' or kind6 like '"&kind&"%' or kind7 like '"&kind&"%' ) "
end if
if cx<>"" then
	sql_condition = sql_condition & " and good='1' "
end if
if hot<>"" then
	sql_condition = sql_condition & " and hot='1' "
end if

if searchkind<>"" then
	sql_condition = sql_condition & " and kind like '"&searchkind&"%' "
end if
if myword<>"" then
	sql_condition = sql_condition & " and (model like '%"&myword&"%' or productname like '%"&myword&"%' or pipai like '%"&myword&"%') "
end if

sql="select pkid,model,productname,smallpicpath,price1,price"&session("customkind")&",pipai,addtime from view_product "&sql_condition&" order by "&order_name

set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,1
if rs.bof or rs.eof then
	response.write "暂时没有符合条件商品记录！<br><br><br><br>"
else

i=1
q=1
%>
                          <TABLE align=center border=0 cellPadding=2 cellSpacing=0 width="100%">
                            <TBODY>
                              <TR> 
                                
<%
	rs.pagesize=page_mode
	rs.absolutepage=1
	if request("page")<>"" then rs.absolutepage=request("page")
	rowcount=rs.pagesize
	if not rs.eof then
		do while not rs.eof and rowcount>0
		pkid=rs("pkid")
		model=rs("model")
		productname=rs("productname")
		smallpicpath=rs("smallpicpath")
		price1=rs("price1")
		price2=rs("price"&session("customkind"))
		pipai=rs("pipai")
		'kindname=rs("kindname")
		addtime=rs("addtime")
		 

if display_mode="grid" then	
	
	call product_list(2)	

end if

			if display_mode="grid" then
				if i=s_col then
					response.write "</tr><tr><td height=8></td></tr><tr>"
					i=1
				else
					i=i+1
				end if
			else
				i=i+1
				if i mod 2 = 0 then
				response.write "</tr><tr><td height=1></td></tr><tr bgcolor='#f7f7f7' Onmouseover=""this.style.backgroundColor='#FFF0D0';"" Onmouseout=""this.style.backgroundColor='#f7f7f7';"">"
				else
				response.write "</tr><tr><td height=1></td></tr><tr Onmouseover=""this.style.backgroundColor='#FFF0D0';"" Onmouseout=""this.style.backgroundColor='#ffffff';"">"
				end if
				
			end if

			
	
		rs.movenext
		q=q+1
		rowcount=rowcount-1
		loop
	end if

%>
							   
                              </TR>
                            </TBODY>
                          </TABLE>
						   <table><TR> 
							<TD height="5"></TD>
						  </TR></table>

<%
if nowpage="" then nowpage=1
nowpath=request.servervariables("script_name")
'kind=server.URLEncode(kind)
'searchkind=trim(request("searchkind"))
'myword=trim(request("myword"))
myurl="kind="&kind&"&qg="&qg&"&cx="&cx&"&hot="&hot&"&searchkind="&searchkind&"&myword="&myword
response.write "<table width='650' align='center'>"
  response.write "<tr> "
   response.write " <td width='500' height='22' align=right style='font-size:9pt;'> "
		response.write "共"&rs.recordcount&"条记录&nbsp;每页"&page_mode&"条&nbsp;现在 "&nowpage&"/"&rs.pagecount &" 页&nbsp;"	
        response.write "<input type='button' name='Button3' value='' style='background-image:url(images/z1.jpg);width:37px;height:19px;border:0px;cursor:pointer' onclick=window.location.href='"&nowpath&"?"&myurl&"&none='>&nbsp;"
        if clng(nowpage)>1 then
        response.write "<input type='button' name='Button4' value='' style='background-image:url(images/z2.jpg);width:45px;height:19px;border:0px;cursor:pointer' onclick=window.location.href='"&nowpath&"?page="&nowpage-1&"&"&myurl&"&none='>&nbsp;"
        else
        response.write "<input type='button' name='Button4' value='' style='background-image:url(images/z2.jpg);width:45px;height:19px;border:0px'>&nbsp;"
        end if
		if clng(nowpage)<>clng(rs.pagecount) then
        response.write "<input type='button' name='Button5' value='' style='background-image:url(images/z3.jpg);width:45px;height:19px;border:0px;cursor:pointer' onclick=window.location.href='"&nowpath&"?page="&nowpage+1&"&"&myurl&"&none='>&nbsp;"
        else
        response.write "<input type='button' name='Button5' value='' style='background-image:url(images/z3.jpg);width:45px;height:19px;border:0px'>&nbsp;"
		end if
		response.write "<input type='button' name='Button6' value='' style='background-image:url(images/z4.jpg);width:37px;height:19px;border:0px;cursor:pointer' onclick=window.location.href='"&nowpath&"?page="&rs.pagecount&"&"&myurl&"&none='>"
    response.write "</td><form name='form29' method='post' action='"&nowpath&"?"&myurl&"&none='><td width='150'>&nbsp;转到<input type='text' name='page' size=3 style='width:40px; height:20px;font-size:11pt; font-family: Arial;'>页 <input type='submit' name='Submitpage' value='GO' style='width:33px; height:21px; color:#ffffff; background-color:#999999;font-size:9pt;font-weight:bold;font-family: Arial;cursor:pointer; '></td></form>"
  response.write "</tr>"
response.write "</table>"

end if
rs.close
set rs=nothing

%> 

<br>

    </td>
  </tr>

</table>
<%
myurl2=myurl&"&page="&nowpage   '显示方式是本页
myurl3=myurl&"&page=1"    '排序及每页条数
'display_mode()放在程序的下面,主要是为了得到本页的地址myurl2
%>
<script language="javascript">
<!--
function display_mode(Menu)
{
	if(Menu=="list")
	{
		window.location.href="<%=nowpath&"?display_mode=list&"&myurl2%>";
	}
	else if(Menu=="grid")
	{
		window.location.href="<%=nowpath&"?display_mode=grid&"&myurl2%>";
	}
	else if(Menu=="text")
	{
		window.location.href="<%=nowpath&"?display_mode=text&"&myurl2%>";
	}

	else if(Menu=="addup")
	{
		window.location.href="<%=nowpath&"?order_mode=addup&"&myurl3%>";
	}
	else if(Menu=="adddown")
	{
		window.location.href="<%=nowpath&"?order_mode=adddown&"&myurl3%>";
	}

	else if(Menu=="priceup")
	{
		window.location.href="<%=nowpath&"?order_mode=priceup&"&myurl3%>";
	}
	else if(Menu=="pricedown")
	{
		window.location.href="<%=nowpath&"?order_mode=pricedown&"&myurl3%>";
	}

	else if(Menu=="hitup")
	{
		window.location.href="<%=nowpath&"?order_mode=hitup&"&myurl3%>";
	}
	else if(Menu=="hitdown")
	{
		window.location.href="<%=nowpath&"?order_mode=hitdown&"&myurl3%>";
	}

	else if(Menu=="saleup")
	{
		window.location.href="<%=nowpath&"?order_mode=saleup&"&myurl3%>";
	}
	else if(Menu=="saledown")
	{
		window.location.href="<%=nowpath&"?order_mode=saledown&"&myurl3%>";
	}

	else if(Menu=="20")
	{
		window.location.href="<%=nowpath&"?page_mode=20&"&myurl3%>";
	}
	else if(Menu=="30")
	{
		window.location.href="<%=nowpath&"?page_mode=30&"&myurl3%>";
	}
	else if(Menu=="40")
	{
		window.location.href="<%=nowpath&"?page_mode=40&"&myurl3%>";
	}
}
-->
</script>


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

<%
conn.close
set conn=nothing
%>
</body>
</html>






