<!--#include file="conn.asp"-->
<%
strCurrMenu="4"
%>
<%
strClassName=GetVariable("classname")
if strClassName="" then
	strClassName="所有产品"
end if

strQuery=""

strClass=GetVariable("class")
if strClass<>"" then
	strQuery=strQuery & " And p_class=" & strClass 
end if

strKey=GetVariable("key")
if strKey<>""  then
	strQuery=strQuery & " And (p_name Like '%" & strKey & "%' Or p_detail Like '%" & strKey & "%') "
	strClassName="搜索：" & strKey
end if

strPrice1=GetVariable("price1")
if strPrice1<>"" then
	strQuery=strQuery & " And p_price>=" & strPrice1 
	strClassName=strClassName & "　　最低价格 " & strPrice1
end if

strPrice2=GetVariable("price2")
if strPrice2<>"" then
	strQuery=strQuery & " And p_price<=" & strPrice2
	strClassName=strClassName & "　　最高价格 " & strPrice1
end if

%>

<%
'读取产品展示的属性，以确定显示那个字段
showClass=GetKey("showClass",WebUserID,"product_" & strCurrMenu )
showPrice=GetKey("showPrice",WebUserID,"product_" & strCurrMenu )
showSize=GetKey("showSize",WebUserID,"product_" & strCurrMenu )
showSymbol=GetKey("showSymbol",WebUserID,"product_" & strCurrMenu )
showFace=GetKey("showFace",WebUserID,"product_" & strCurrMenu )
showShop=GetKey("showShop",WebUserID,"product_" & strCurrMenu )
showDetail=GetKey("showDetail",WebUserID,"product_" & strCurrMenu )
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>企业智能建站-最简单的建站平台</title>
<link href="common/style.css" rel="stylesheet" type="text/css">
<script language="JavaScript" src="common/JS_CheckForm.js"></script>
<script language="JavaScript">
function checkform(theform){
	if(!CheckEmpty(theform.key, "关键字")) return false;
	if(!CheckInteger(theform.price1, "最低价格")) return false;
	if(!CheckInteger(theform.price2, "最高价格")) return false;
}
</script>
<script language="JavaScript">
	function PutWare(strID){
		Shopwin=window.open("shopping.asp?action=add&spid=" + strID+ "&PtCount=1&mnid=<%=strCurrMenu%>",'WareList','width=580,height=250,scrollbars=yes,resizable=yes');
		Shopwin.focus();
	}

</script>

</head>

<body background="images/mb_01.gif" topmargin="0" BodyBegin>
<table width="720" height="256" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
  <tr>
    <td valign="top">
	<!--#include file="top.asp"--> 
      <table width="100%" height="390" border="0" cellpadding="0" cellspacing="0">
        <tr> 
          <td height="390" valign="top">
		<table width="90%" border="0" align="center" cellpadding="0" cellspacing="0">
              <tr> 
                <td>&nbsp;</td>
              </tr>
              <tr> 
                <td height="23">您的位置 : <a href="." style="color:black">首页</a> 
                  &gt;&gt; <a href="product.asp">公司产品</a> &gt;&gt;<font face="Arial Black"><strong><%=strClassName%></strong></font></td>
              </tr>
              <tr> 
                <td><table width="100%" border="0" cellpadding="0" cellspacing="0">
                    <tr>
                      <td  background="images/mb_02.jpg" height="5"></td>
                    </tr>
                  </table></td>
              </tr>
              <tr>
                <td><table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
                    <tr>
                      <td valign="top"> 
                        <table width="100%" border="0" cellspacing="0" cellpadding="0">
                          <tr> 
                            <td>
							
								<%
								  '开始输出分类
								  strSQL="Select * From web_product_class Where mn_id=" & strCurrMenu & " Order by c_index"
								  Set rsClass=Server.CreateObject("ADODB.RecordSet")
								  rsClass.open strSQL,conn,1,1
								  ClassCount=rsClass.recordcount
								  if ClassCount>1 then 
								%>  
							<table width="90%" border="0" align="center" cellpadding="0" cellspacing="0">
                                <tr> 
                                  <td height="40" align="center">
								  <font color="#990000"> |</font>
                                <%
								  for i=1 to ClassCount
								  %>
								  <a href="?class=<%=rsClass("id")%>&classname=<%=trim(rsClass("c_name"))%>&mnid=<%=strCurrMenu%>" class="aBlack"><%=trim(rsClass("c_name"))%></a>
								  <font color="#990000"> |</font>
                                <%
									rsClass.movenext
								next
								%>
									</td>
                                </tr>
                              </table>
								  <%end if%>
            <!--Product Begin-->
            <%
					strSQL="Select * From v_web_product Where mn_id=" & strCurrMenu & strQuery & " Order by p_code,ID Desc"
					Set rs=Server.CreateObject("ADODB.RecordSet")
					rs.open strSQL,conn,1,1
					'分页显示初始化
					page=GetVariable("page")
					if page="" then
						page=1
					else
						page=Cint(page)
					end if
					
					Section=GetVariable("section")
					if Section="" then
						Section=1
					else
						Section=Cint(Section)
					end if
					'变量赋值
					intPageSize=6		'每页显示记录数
					intSectionSize=5		'多少页为一段，像GOOGLE一样
					PrevSectionText="<FONT face=webdings>7</FONT>"		'上一段的链接文字
					NextSectionText="<FONT face=webdings>8</FONT>"		'下一段的链接文字
					PrevPageText="<FONT face=webdings>3</FONT>"			'上页的链接文字	
					NextPageText="<FONT face=webdings>4</FONT>"			'下页的链接文字
					
					strPageUrl="?class=" & GetVariable("class") & "&key=" & GetVariable("key") & "&price1=" & GetVariable("price1") & "&price2=" & GetVariable("price2")
					
					rs.pagesize=intPageSize
					intCount=rs.RecordCount 
					intPageCount=rs.pagecount
					intSectionCount=(intPageCount - 1) \ intSectionSize + 1
					if intCount>0 then
						rs.AbsolutePage=page  
					end if
					%>
            <br> 
            <%
					 '循环输出
					 for i=1 to (intPageSize + 2) \ 3
						if rs.eof then exit for
					%>
							  <table width="648" height="255" border="0" cellpadding="0" cellspacing="0">
                                <tr align="center"> 
                                  <%
						for j=1 to 3
							if rs.eof then exit For
						%>
                                  <td width="216" height="237"> <table width="157" border="0" cellspacing="0" cellpadding="0">
                                      <tr> 
                                        <td width="155" height="125" align="center" background="images/cpbg.gif"><a href="UpFile/<%=trim(rs("p_pic"))%>" target="_blank"><img src="UpFile/<%=trim(rs("p_smallpic"))%>" width="146" height="113" border="0"></a></td>
                                      </tr>
                                      <tr> 
                                        <td height="22" align="center"><strong> 
                                          <%if showDetail<>"none" then %>
                                          <a href="productshow.asp?id=<%=trim(rs("id"))%>&mnid=<%=strCurrMenu%>" target="_blank"><strong><font color="#339900"><%=trim(rs("p_name"))%></font></strong></a> 
                                          <%else%>
                                          <strong><font color="#006699"><%=trim(rs("p_name"))%></font></strong> 
                                          <%end if%>
                                          </strong></td>
                                      </tr>
									<%if showClass<>"none" then %>
									<tr> 
									  <td> 　类别： <%=trim(rs("c_name"))%></td>
									</tr>
									<%end if%>
									<%if showSymbol<>"none" then %>
									<tr> 
									  <td><font color="#FF0000">　</font>型号：<%=trim(rs("p_symbol"))%></td>
									</tr>
									<%end if%>
									<%if showFace<>"none" And showFace<>"Null" then %>
									<tr> 
									  <td><font color="#FF0000">　</font>外观：<%=trim(rs("p_face"))%></td>
									</tr>
									<%end if%>
									<%if showSize<>"none" then %>
									<tr> 
									  <td><font color="#FF0000">　</font>尺寸：<%=trim(rs("p_size"))%></td>
									</tr>
									<%end if%>
									<%if showPrice<>"none" then %>
									<tr> 
									  <td><font color="#FF0000">　现价：<%=trim(rs("p_price"))%>元</font></td>
									</tr>
									<%end if%>
									<%if showShop<>"none" then %>
									<tr> 
									    <td><a href="javascript:;" onClick="PutWare('<%=trim(rs("id"))%>')"><img src="images/ljgm.gif" hspace="10" border="0"></a></td>
									</tr>
									<%end if%>
                                    </table></td>
                <%
							rs.movenext
						next
						%>
                                </tr>
                                <tr align="center"> 
                                  <td height="18" colspan="3">&nbsp;</td>
                                </tr>
                              </table>
            <%
								
						next
						%>
                              <br> <table width="92%" border="0" align="center">
                                <tr> 
                                  <td background="images/linebg.gif"></td>
                                </tr>
                                <tr> 
                                  <td align="right" ><table width="100%" border="0" cellspacing="0" cellpadding="0">
                                      <tr> 
                                        <td align="right"> 共有<%=intCount%>记录，分<%=intPageCount%>页，当前页<%=Page%>，每页显示<%=intPageSize%>条记录 
                                          <%
			'计算每一段的开始页
			intStarPage=(Section-2) * intSectionSize + 1
			'前一段
			if Section<=1 then
				response.Write(PrevSectionText & " ")
			else
				response.Write("<a href='" & strPageUrl & "&page=" & intStarPage & "&section=" & Section-1 & "' class='aBlack'>" & PrevSectionText & "</a> ")
			end if 
			
			'显示页码列表
			response.Write("第")
			intStarPage=(Section-1) * intSectionSize + 1
		    for p=intStarPage to intStarPage + intSectionSize - 1
				if p > intPageCount then exit for
				if p=page then
		    		response.Write("<strong>[" & p & "]</strong> ")
				else
		    		response.Write("<a href='" & strPageUrl & "&page=" & p & "&section=" & Section & "' class='aBlack'>[" & p & "]</a> ")
				end if	
		    next
			response.Write("页")
			'后一段
			intStarPage=(Section) * intSectionSize + 1
			if Section>=intSectionCount then
				response.Write(" " & NextSectionText)
			else
				response.Write(" <a href='" & strPageUrl & "&page=" & intStarPage & "&section=" & Section+1 & "' class='aBlack'>" & NextSectionText & "</a> ")
			end if 
		  %>
                                          　 </td>
                                      </tr>
                                    </table></td>
                                </tr>
                                <tr> 
                                  <td align="center" ><br> <font color="#CCCCCC">-----------------------------------</font><font color="#FF6600"> 
                                    <font color="#FF3300">产 品 搜 索</font> <font color="#CCCCCC">------------------------------------</font></font> 
                                    <table width="88%" border="0" cellspacing="0" cellpadding="0">
									<form name="form1" method="post" action="?" onSubmit="return checkform(this)">                                      <tr> 
                                        <td align=right width=37>分类：</td>
                                        <td width=92>
										<select name=class class="box3" id=class style="WIDTH: 80px">
										<option value="">全部产品</option>
										  <%
													'开始输出分类
													strSQL="Select * From web_product_class Where mn_id=" & strCurrMenu & " Order by c_index"
													Set rs=Server.CreateObject("ADODB.RecordSet")
													rs.open strSQL,conn,1,1
													for i=1 to rs.recordcount
													%>
										  <option value="<%=rs("id")%>"><%=trim(rs("c_name"))%></option>
										  <%
														rs.movenext
													next
													%>
                                          </select> </td>
                                        <td align=right width="56">关键字：</td>
                                        <td width="109"> <input id=key style="WIDTH: 100px" 
                                maxlength=50 size=20 name=key class="box3"> </td>
                                        <td align=right width="45">价格：</td>
                                        <td width="98"> <input 
                                name=price1 class="box3" id=price1 
                                style="WIDTH: 30px" size=2 maxlength=5>
                                          到 
                                          <input name=price2 class="box3" id=price2 
                                style="WIDTH: 30px" size=2> </td>
                                        <td width="58" colspan=2 align="left"> 
                                          <div align="center">
                                              <input name="imageField" type="image" src="images/search1.gif" width="82" height="24" border="0" style="border:0">
                                            </div></td>
                                      </tr>
									</form>
                                    </table>
                                    <font color="#CCCCCC">------------------------------------------------------------------------------------</font></td>
                                </tr>
                              </table></td>
                          </tr>
                          <tr> 
                            <td width="73%"> <br> </td>
                          </tr>
                        </table>
                        
                      </td>
                    </tr>
                  </table></td>
              </tr>
            </table> 
          </td>
        </tr>
      </table>
      <table width="100%" height="56" border="0" cellpadding="0" cellspacing="0">
        <tr> 
          <td> <table width="100%" border="0" cellspacing="0" cellpadding="0">
              <tr> 
                <td bgcolor="#FFCCCC" height="2"></td>
              </tr>
              <tr> 
                <td bgcolor="#FFEFEF" height="6"></td>
              </tr>
              <tr> 
                <td bgcolor="#FFEFEF"><div align="center"><font color="#333333">公司地址：郑州市经三路与农业路枣庄20#<br>电话：14837153091 E-Mail:hn22@163.com<br>Copyright&copy;2006-2007 河南数据 All Rights Reserved.<br><br>
                    您是本站第<script language="JavaScript" src="admin/count/counter.asp"></script>位访问者</font></div></td>
              </tr>
              <tr> 
                <td bgcolor="#FF9999" height="9"></td>
              </tr>
            </table></td>
        </tr>
      </table></td>
  </tr>
</table>
<script language="JavaScript" src="common/init.js"></script><br><script language=Javascript src="common/tranbig5.Js"></script>
</body>
</html>





