<%
set rs=server.createobject("ADODB.Recordset")
sql="select * from P_info where p_other = 0 "
classType = request("classType")
smallclass = request("smallclass")
key = request("key")
if classType <> "" then
	sql = sql & " and p_type = '"&classType&"'"
end if
if smallclass <> "" then
	sql = sql & " and p_small_type = '"&smallclass&"'"
end if
if key <> "" then
	sql = sql & " and (p_name like '%"&key&"%' or  p_spec like '%"&key&"%') "
end if

sql = sql & " order by p_id desc"
rs.open sql,conn,1,1

if not isempty(request("page")) then   
pagecount=cint(request("page"))   
else   
pagecount=1
end if

%>
                <table width="98%" border="0" align="center" cellpadding="0" cellspacing="0">
                           <tr>
                    <td align="center" valign="top">
                      <table width="98%" border="0" cellpadding="0" cellspacing="0" >
                        <%
						sql_type="select * from P_class_small where p_type = '" & classType & "' order by p_small_id desc"
						set rs_type=server.createobject("adodb.recordset")
						rs_type.open sql_type,conn,1,3
					%>
                        <tr>
                          <%
					if rs_type.eof and rs_type.bof then 
					 else
							for i=1 to rs_type.recordcount
							 if rs_type.EOF then exit for 
					%>
                          <td height="24" align="center" ><a href="Product.asp?classtype=<%=rs_type("p_type")%>&smallclass=<%=rs_type("p_small_type")%>"><%=rs_type("p_small_type")%></a></td>
                          <% if i mod 4 = 0 then %>
                        </tr>
                        <tr>
                          <%end if%>
                          <%
						 rs_type.movenext
						 next
						 end if 
						 rs_type.close
					 %>
                      </table>
                      <table width="100%" border="0" cellpadding="0" cellspacing="5" >
                        <%
					if rs.eof or rs.bof then
					  response.write("对不起没有你查询的记录")
					 else
						rs.pagesize=8
				%>
                        <tr>
                          <td height="5"></td>
                        </tr>
                        <tr>
                          <%
						rs.AbsolutePage=pagecount

						for i=1 to rs.recordcount
							if rs.EOF then exit for 
					%>
                          <td align="center" valign="top" ><table width="25%"  border="0" cellspacing="0" cellpadding="5">
                              <tr>
                                <td align="center" valign="middle" ><a href="showProDetail.asp?ProID=<%=rs("p_id")%>"  title=<%=rs("p_name")%>><img src="<%=rs("p_pic")%>" width="70" height=60" border="0"></a></td>
                              </tr>
                              <tr>

    <td style="padding-bottom:10px;" align=center><a alt=<%=rs("p_name")%>  href="showProDetail.asp?ProID=<%=rs("p_id")%>"><u><%=rs("p_name")%></u></a></td>
  </tr>

                              </tr>
                          </table></td>
                          <% if i mod 4 = 0 then %>
                        </tr>
                        <tr>
                          <%end if%>
                          <%
						 rs.movenext
						 if i>=rs.pagesize then exit for                                                           
						 next
						 end if 
					 %>
                      </table></td>
                  </tr>
                </table>
                <%
rs.close
set rs=nothing
%>

