<!--#include file="conn.asp" -->
<%
strCurrMenu=FirstMenu()
ThisPage=request.ServerVariables("URL")
%>
<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="admin/common/JS_CheckForm.js"></script>
<script language="JavaScript">
function checkform(theform){
	if(!CheckEmpty(theform.key, "关键字")) 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 leftmargin="0" topmargin="0" BodyBegin>
<!--#include file="top.asp"-->
<table width="760" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr> 
    <td><table width="100%"  border="0" cellspacing="0" cellpadding="0">
        <tr> 
          <td width="190" valign="top" background="images/left.gif"> <table width="180" border="0" cellspacing="0" cellpadding="0">
              <tr> 
                <td height="26" align="center" background="images/index_01.gif">::会员登陆::</td>
              </tr>
              <tr> 
                  <td align="center"> 
				  <!--#include file="login.asp"-->
				  </td>
              </tr>
            </table>
            <table width="180" border="0" cellspacing="0" cellpadding="0">
              <tr> 
                <td height="26" align="center" background="images/index_01.gif">::产品搜索::</td>
              </tr>
              <tr> 
                <td align="center"><table width="156" border="0" align="center" cellpadding="0" cellspacing="0">
                    <form name="form1" method="post" action="search.asp">
                      <tr> 
                        <td width="58" height="8" align="right"></td>
                        <td width="98" height="8"></td>
                      </tr>
                      <tr> 
                        <td width="58" height="26" align="right">分　类：</td>
                        <td width="98" height="26"> <select name="class" id="select2" style="width:80px">
                            <%
								'开始输出分类
								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>
                      </tr>
                      <tr> 
                        <td height="26" align="right">关键字：</td>
                        <td height="26"> <input name="key" type="text" id="key4" size="14" maxlength="50" style="width:80px"> 
                        </td>
                      </tr>
                      <% if showPrice<>"none" then %>
                      <tr> 
                        <td height="26" align="right">价　格：</td>
                        <td height="26"> <input name="price1" type="text" id="price1" size="2" maxlength="5" style="width:30px">
                          到 
                          <input name="price2" type="text" id="price2" size="2" style="width:30px"> 
                        </td>
                      </tr>
                      <%end if%>
                      <tr align="left"> 
                        <td height="30" colspan="2"> <table width="156" height="40" border="0" cellpadding="0" cellspacing="0">
                            <tr> 
                              <td width="117" height="40" align="right"> <input type="submit" name="Submit" value="开始搜索"></td>
                              <td width="39" height="40" valign="bottom">&nbsp;&nbsp;</td>
                            </tr>
                          </table></td>
                      </tr>
                    </form>
                  </table></td>
              </tr>
            </table>
            <table width="180" height="239" border="0" cellpadding="0" cellspacing="0">
              <tr> 
                <td height="26" align="center" background="images/index_01.gif">::热销产品::</td>
              </tr>
              <tr> 
                <td height="180" align="center"> <p><img src="images/cp.gif" width="110" height="83" border="1"></p>
                  <p><img src="images/cp.gif" width="110" height="83" border="1"></p></td>
              </tr>
            </table></td>
          <td align="center" valign="top"> <table width="100%" border="0" cellspacing="0" cellpadding="0">
              <tr> 
                <td align="center"><img src=IMAGES/banner.gif ></td>
              </tr>
            </table>
             <table width="97%"  border="0">
              <tr> 
                <td width="100%" height="5" colspan="2"></td>
              </tr>
              <tr align="right"> 
                <td height="381" colspan="2"><table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
                    <tr> 
                      <td valign="top"> <table width="97%" border="0" align="center" cellpadding="5" cellspacing="0">
                          <tr> 
                            <td> 
                              <%
				'输出小类
				strClassID=request.QueryString("class")
				strClassName=request.QueryString("classname")
				if strClassID="" then
					'如果没有参数，则列举最新产品
					strSQL="Select Top 90 * From v_web_product Where mn_id=" & strCurrMenu & " Order by p_code,ID Desc"
					strClassName="最新发布的产品"
				End if
				%>
                              <img src="images/go.gif" width="22" height="19" hspace="10" align="absmiddle"><strong><%=strClassName%>：</strong> 
                              <%
				if strClassID<>"" then
					strIDs=strClassID
					'开始二级输出分类
					strSQL="Select * From web_product_class Where c_parent=" & strClassID & " And mn_id=" & strCurrMenu & " Order by c_index"
					Set rsClass1=Server.CreateObject("ADODB.RecordSet")
					rsClass1.open strSQL,conn,1,1
					for j=1 to rsClass1.recordcount
				%>
                              &nbsp;<a href="<%=HomePage%>?class1=<%=rsClass1("id")%>&class=<%=strClassID%>&classname=<%=strClassName%>&mnid=<%=strCurrMenu%>"><%=trim(rsClass1("c_name"))%></a> 
                              | 
                              <%
						strIDs=strIDs & "," & Trim(rsClass1("id"))
						rsClass1.movenext
					next
					rsClass1.close
					
					strQuery=" And p_class In (" & strIDs & ") "
					strSQL="Select * From v_web_product Where mn_id=" & strCurrMenu & strQuery & " Order by p_code,ID Desc"
			  end if
			  %>
                            </td>
                          </tr>
                        </table>
                        <%
					if request.QueryString("class1")<>"" then
						'按小类检索
						strQuery=" And p_class =" & Clng(request.QueryString("class1"))
						strSQL="Select * From v_web_product Where mn_id=" & strCurrMenu & strQuery & " Order by p_code,ID Desc"
					End if
					
					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
					%>
                        <%
			'循环输出
			for i=1 to (intPageSize + 2) \ 3
				if rs.eof then exit for
			%>
                        <table width="545" border="0" align="center" cellpadding="4" cellspacing="0">
                          <tr align="center"> 
                            <%
						for j=1 to 3
							if rs.eof then exit For
						%>
                            <td><table width="120" height="187" border="0" cellpadding="0" cellspacing="0">
                                <tr> 
                                  <td width="120" align="center"> <table width="120" height="10" border="1" cellpadding="0" cellspacing="4" bordercolor="#CCCCCC">
                                      <tr> 
                                        <td width="120" height="10" align="center"><a href="productshow.asp?id=<%=trim(rs("id"))%>&mnid=<%=strCurrMenu%>&classname=<%=trim(rs("c_name"))%>&uppage=<%=ThisPage%>" target="_blank"><img src="UpFile/<%=trim(rs("p_smallpic"))%>" width="120" vspace="5" border="0"></a></td>
                                      </tr>
                                    </table></td>
                                </tr>
                                <tr> 
                                  <td height="27" align="center"><a href="productshow.asp?id=<%=trim(rs("id"))%>&mnid=<%=strCurrMenu%>&classname=<%=trim(rs("c_name"))%>&uppage=<%=ThisPage%>" target="_blank"><strong><font color="#006699"><%=trim(rs("p_name"))%></font></strong></a></td>
                                </tr>
                                <tr> 
                                  <td height="16" align="center"><font color="#666666">￥<%=trim(rs("p_price"))%></font>　<a href="javascript:;" onClick="PutWare('<%=trim(rs("id"))%>')"><img src="images/Buy.gif" width="16" height="13" hspace="5" border="0"><font color="#666666">订购</font></a></td>
                                </tr>
                              </table></td>
                            <%
							rs.movenext
						next
						%>
                          </tr>
                          <tr align="center"> 
                            <td colspan="3" height="10"></td>
                          </tr>
                        </table>
                        <%
				Next
			%>
                        <table width="100%" border="0" cellspacing="0" cellpadding="0">
                          <tr> 
                            <td height="30" 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 & "'>" & 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 & "'>[" & 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 & "'>" & NextSectionText & "</a> ")
			end if 
		  %>
                              　</td>
                          </tr>
                        </table></td>
                    </tr>
                  </table></td>
              </tr>
              <tr align="right"> 
                <td colspan="2">&nbsp;</td>
              </tr>
            </table></td>
        </tr>
      </table></td>
  </tr>
</table>
<table width="760" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td height="3" bgcolor="#0D9DE3"></td>
  </tr>
</table>
<table width="760" border="0" align="center" cellpadding="8" cellspacing="0">
  <tr> 
    <td align="center" bgcolor="F3F3F3">公司地址：未知<br>电话： E-Mail:zfadshu@cn9sky.com<br>Copyright&copy;2005-2006 dddddd All Rights Reserved.<br><br>
      您是本站第 
      <script language="JavaScript" src="admin/count/counter.asp"></script>
      位访问者&nbsp;</td>
  </tr>
</table>
<script language="JavaScript" src="common/init.js"></script><br><script language=Javascript src="common/tranbig5.Js"></script>
<script language="JavaScript" src="admin/board/popwindow.asp"></script>
</body>
</html>



