<!--#include file="inc/config.asp"-->
<!--#include file="inc/conn.asp"-->
<!--#include file="inc/function.asp"-->
<%
dim currentpage,totalpage,totalnum,recpage,urls,cid,pid,style,ckeywords,cdescription
recpage=20
dim id,Age2,Sex,Province,City,Key,carr,ctitle,ptitle,htitle,postions
if(request.QueryString("page")<>"") then
	currentpage=Clng(request.QueryString("page"))
else
	currentpage=1
end if
if(currentpage<=0) then
	currentpage=1
end if
if(request.QueryString("cid")<>"") then
	cid=Clng(request.QueryString("cid"))	
	set rs=server.CreateObject("adodb.recordset") 
	rs.open "select title from catalogs where id="&cid&"",conn,3,1
	if not rs.eof then
		ctitle=rs(0)
		ckeywords=rs(0)
		cdescription=rs(0)
	else
		ctitle=""
	end if
	rs.close
	set rs=nothing
else
	cid=0
end if
if(request.QueryString("pid")<>"") then
	pid=Clng(request.QueryString("pid"))
	ptitle=getIndustryTitle(pid)
else
	pid=0
end if
if(request.QueryString("province")<>"") then
	province=cint(request.querystring("province"))
else
	province=0
end if
if(request.QueryString("city")<>"") then
	city=cint(request.querystring("city"))
else
	city=0
end if
urls="pid="&pid&"&cid="&cid&"&province="&province&"&city="&city
htitle=ptitle
if(ctitle<>"") then
	htitle=ctitle&"-"&htitle
end if
postions=postions&"&gt;<a href=""?"&"pid="&pid&"&cid=0&province="&province&"&city="&city&""">"&ptitle&"</a>"
postions=postions&"&gt;<a href=""?"&urls&""">"&ctitle&"</a>"
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title><%=htitle%>-<%=SiteName%></title>
<link href="style/index.css" rel="stylesheet" type="text/css" />
<meta name="keywords" content="<%=ckeywords%>" />
<meta name="description" content="<%=cdescription%>" />
<script type="text/javascript" src="/js/common.js"></script>
<script type="text/javascript" src="/js/jquery-1.3.2.min.js"></script>
<script type="text/javascript">
function getCatalogs(pid,cid){
	$.ajax({
    url: '/member/getchilds.asp?classid='+pid,
    type: 'GET',
    dataType: 'xml',
    timeout: 3000,
    error: function(){
        alert('Error loading XML document');
    },
    success: function(xml){    
			var childs=$('#CatalogId')[0];
			childs.length=0;
			childs.options[0]=new Option("不限",0);
			var i=1;
			var classid,classtitle;
			$(xml).find("root > catalog").each(function(){ 
				var t=$(this);
				classid=t.find("id").text();
				classtitle=t.find("title").text();
				childs.options[i]=new Option(classtitle,classid);							
				if(cid==classid){
					childs.options[i].selected=true;
				}
				i++;
			});
		}
	});
}
</script>
</head>
<body>
<!--#include file="head.asp"-->
<table width="960" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td height="24">当前位置：<a href="/">首页</a><%=postions%></td>
  </tr>
</table>
<div class="br"></div>
<table width="960" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#FED2A3">
  <tr>
    <td height="25" bgcolor="#FED2A3" class="padleft_10"> 分类查看 <img src="images/arrow.gif" alt=" " width="11" height="14" align="absmiddle" /></td>
  </tr>
  <tr>
    <td bgcolor="#FFFFFF" class="pad_10">
    <div class="subnav">
    <a href="list.asp?pid=<%=pid%>&cid=0&city=<%=city%>" title="不限" <%if(cid=0) then response.write(" class=""on""") end if%>>不限</a>
    <%
			if(pid>0) then
			set rs=server.CreateObject("adodb.recordset") 
			rs.open "select id,title from catalogs where parentid="&pid&" order by SortId asc",conn,3,1
				while not rs.eof
			%>
	  <a href="list.asp?pid=<%=pid%>&cid=<%=rs(0)%>&province=<%=province%>&city=<%=city%>" title="<%=rs(1)%>" <%if(rs(0)=cid) then response.write(" class=""on""") end if%>><%=rs(1)%></a>
		  <%
				rs.movenext
			wend
			rs.close
			set rs=nothing
			end if
			%>
      <div class="clear"></div>
    </div></td>
  </tr>
</table>
<div class="br"></div>
<table width="960" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td valign="top" class="border"><table width="100%" border="0" cellspacing="1" cellpadding="0">
      <tr>
        <td width="60%" height="30" align="center" bgcolor="#EBF2FC">标题</td>
        <td width="17%" align="center" bgcolor="#EBF2FC">人气</td>
        <td width="23%" align="center" bgcolor="#EBF2FC">发布日期</td>
      </tr>
      <%
			if(pid>0) then
				set rs=server.CreateObject("adodb.recordset")
				rs.open "select top 10 id,InfoTypeId,Photo,UserId,Title,Price,Province,City,Area,PubDate,Hits,SavePath,Demons from t_info where ParentId="&pid&" and IsTop=1 order by id desc",conn,3,1
				while not rs.eof
				%>
				<tr>
					<td height="30" class="padleft_10">·<a href="show.asp?id=<%=rs(0)%>"><%=rs(4)%></a>&nbsp;<span style="color:#F00; font-weight:bold;">[置顶]</span> <a href="list.asp?province=<%=rs(6)%>&city=<%=rs(7)%>"><%=rs(8)%></a></td>
					<td align="center"><%=rs(10)%></td>
					<td align="center"><%=year(rs(9))&"-"&month(rs(9))&"-"&day(rs(9))%></td>
				</tr>
				<%
					rs.movenext
				wend
				rs.close
				set rs=nothing
				set rs=server.CreateObject("adodb.recordset")
				rs.open "select top 10 id,InfoTypeId,Photo,UserId,Title,Price,Province,City,Area,PubDate,Hits,SavePath,Demons from t_info where ParentId="&pid&" and Score>0 and dateDiff('d',ScoreEndDate,'"&now()&"')<0 order by Score desc",conn,3,1
				while not rs.eof
				%>
				<tr>
					<td height="30" class="padleft_10">·<a href="show.asp?id=<%=rs(0)%>"><%=rs(4)%></a>&nbsp;<span style="color:#F00; font-weight:bold;">[竞价]</span></td>
					<td align="center"><%=rs(10)%></td>
					<td align="center"><%=year(rs(9))&"-"&month(rs(9))&"-"&day(rs(9))%></td>
				</tr>
				<%
					rs.movenext
				wend
				rs.close
				set rs=nothing
			else
				set rs=server.CreateObject("adodb.recordset")
				rs.open "select top 10 id,InfoTypeId,Photo,UserId,Title,Price,Province,City,Area,PubDate,Hits,SavePath,Demons from t_info where CatalogId="&cid&" and IsTop=1 order by id desc",conn,3,1
				while not rs.eof
				%>
				<tr>
					<td height="30" class="padleft_10">·<a href="show.asp?id=<%=rs(0)%>"><%=rs(4)%></a>&nbsp;<span style="color:#F00; font-weight:bold;">[置顶]</span></td>
					<td align="center"><%=rs(10)%></td>
					<td align="center"><%=year(rs(9))&"-"&month(rs(9))&"-"&day(rs(9))%></td>
				</tr>
				<%
					rs.movenext
				wend
				rs.close
				set rs=nothing
				set rs=server.CreateObject("adodb.recordset")
				rs.open "select top 10 id,InfoTypeId,Photo,UserId,Title,Price,Province,City,Area,PubDate,Hits,SavePath,Demons from t_info where CatalogId="&cid&" and Score>0 and dateDiff('d',ScoreEndDate,'"&now()&"')<0 order by Score desc",conn,3,1
				while not rs.eof
				%>
				<tr>
					<td height="30" class="padleft_10">·<a href="show.asp?id=<%=rs(0)%>"><%=rs(4)%></a>&nbsp;<span style="color:#F00; font-weight:bold;">[竞价]</span></td>
					<td align="center"><%=rs(10)%></td>
					<td align="center"><%=year(rs(9))&"-"&month(rs(9))&"-"&day(rs(9))%></td>
				</tr>
				<%
					rs.movenext
				wend
				rs.close
				set rs=nothing
			end if			
			csql="select count(*) from t_info where IsCheck=1"
			if(pid>0) then
				csql=csql&" and ParentId="&pid
			end if
			if(cid>0) then
				csql=csql&" and CatalogId="&cid
			end if
			if(Province>0) then
				csql=csql&" and Province="&Province
			end if
			if(City>0) then
				csql=csql&" and City="&City
			end if
			sql="select top "&recpage&" id,InfoTypeId,Photo,UserId,Title,Price,Province,City,Area,PubDate,Hits,SavePath,Demons from t_info where id<=(select min(id) from (select top "&((currentpage-1)*recpage+1)&" id from t_info where IsCheck=1"
			if(pid>0) then
				sql=sql&" and ParentId="&pid
			end if
			if(cid>0) then
				sql=sql&" and CatalogId="&cid
			end if
			if(Province>0) then
				sql=sql&" and Province="&Province
			end if
			if(City>0) then
				sql=sql&" and City="&City
			end if
			sql=sql&" order by id desc) as t) and IsCheck=1"
			if(pid>0) then
				sql=sql&" and ParentId="&pid
			end if
			if(cid>0) then
				sql=sql&" and CatalogId="&cid
			end if
			if(Province>0) then
				sql=sql&" and Province="&Province
			end if
			if(City>0) then
				sql=sql&" and City="&City
			end if
			sql=sql&" order by id desc"
			'response.write(sql)
			totalnum=conn.execute(csql)(0)
			totalpage=int((totalnum-1+recpage)/recpage)
			set rs=server.CreateObject("adodb.recordset")
			rs.open sql,conn,3,1
			if not rs.eof then
				carr=rs.GetRows()
			end if
			rs.close
			set rs=nothing
			if isarray(carr) then
				dim bg_color,bg_color1,bg_color2,j,catalogs
				bg_color1="#F0F7FF"
				bg_color2="#FFFFFF"
				for i=0 to ubound(carr,2)
					if(i mod 2=0) then
						bg_color=bg_color1
					else
						bg_color=bg_color2
					end if
			%>
      <tr>
        <td height="30" class="padleft_10">·<a href="show.asp?id=<%=carr(0,i)%>"><%=carr(4,i)%></a></td>
        <td align="center"><%=carr(10,i)%></td>
        <td align="center"><%=year(carr(9,i))&"-"&month(carr(9,i))&"-"&day(carr(9,i))%></td>
      </tr>
      <%
        	next
      else
        response.write("<tr><td colspan=""4"" height=""30"" align=""center"">暂时没有记录!</td></tr>")
      end if
		set carr=nothing
		%>
    </table>
    <div class="pages">
      <%
			dim n,p,startpage,endpage
			n=currentpage+1
			p=currentpage-1
			startpage=currentpage-5
			if(startpage<=0) then
				startpage=1
			end if
			endpage=currentpage+5
			if(currentpage<5) then
				endpage=10
			end if
			if(endpage>totalpage) then
				endpage=totalpage
			end if
			response.write("<a href=""list.asp?"&urls&"&page=1"">首</a>")
			if(currentpage>1) then
				response.write("<a href=""list.asp?"&urls&"&page="&(currentpage-1)&""">上一页</a>")
			else
				response.Write("上一页")
			end if
			'''''''''''''''''
			for j=startpage to endpage
					if(j=currentpage) then
						response.write("<a href=""#"" class=""current"">"&j&"</a>")
					else
						response.write("<a href=""list.asp?"&urls&"&page="&j&""">"&j&"</a>")
					end if
					if(j>(startPage+10)) then
						exit for
					end if
			next
			'''''''''''''''''''''''''''''''''''''
			if(currentpage<totalpage) then
				response.write("<a href=""list.asp?"&urls&"&page="&(currentpage+1)&""">下一页</a>")
			else
				response.Write("下一页")
			end if
			response.write("<a href=""list.asp?"&urls&"&page="&totalpage&""">尾</a>")
			%>
    </div>
    </td>
    <td width="5" valign="top">&nbsp;</td>
    <td width="261" valign="top"><table width="100%" border="0" align="center" cellpadding="0" cellspacing="0" class="border">
      <tr>
        <td height="56" align="center" bgcolor="#FFF9E3"><a href="publish.asp" target="_blank"><img src="images/fbxx.gif" alt="发布信息" width="171" height="45" border="0" /></a></td>
      </tr>
    </table>
      <div class="br"></div>
      <table width="100%" border="0" cellpadding="0" cellspacing="0" class="table">
        <tr>
          <td class="table_th"><span class="table_title"><a href="#">热点推荐</a></span></td>
        </tr>
        <tr>
          <td valign="top" class="pad_5"><div class="txts_12">
            <ul>
              <%=getInfo(10,17,cid,0,0,0,"",0,1,0,0)%>
            </ul>
          </div></td>
        </tr>
      </table>
      <div class="br"></div>
      <table width="100%" border="0" cellpadding="0" cellspacing="0" class="table">
        <tr>
          <td class="table_th"><span class="table_title"><a href="#">点击排行</a></span></td>
        </tr>
        <tr>
          <td valign="top" class="pad_5"><div class="txts_12">
            <ul>
              <%
							set rs=server.CreateObject("adodb.recordset")
							rs.open "select top 10 id,Title from t_info where CatalogId="&cid&" order by Hits desc,id desc",conn,3,1
							while not rs.eof
							%>
              <li> &middot; <a href="show.asp?id=<%=rs(0)%>" title="<%=rs(1)%>" target="_blank"><%=left(rs(1),17)%></a></li>
              <%
								rs.movenext
							wend
							rs.close
							set rs=nothing
							%>
            </ul>
          </div></td>
        </tr>
      </table></td>
  </tr>
</table>
</td>
  </tr>
</table>
<!--#include file="root.asp"-->
</body>
</html>
<%
call connclose()
%>