<!--#include file="../inc/config.asp"-->
<!--#include file="../inc/conn.asp"-->
<!--#include file="../inc/function.asp"-->
<%
dim currentpage,totalpage,totalnum,recpage,urls,cid,pid,style
recpage=10
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"))	
	ctitle=getIndustryTitle(cid)
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("style")<>"") then
	style=Clng(request.QueryString("style"))
else
	style=0
end if
if(request.QueryString("Province")<>"") then
	Province=replace(request.querystring("Province"),"'","")
else
	Province=""
end if
if(request.QueryString("City")<>"") then
	City=replace(request.querystring("City"),"'","")
else
	City=""
end if
if(request.QueryString("Key")<>"") then
	Key=replace(request.querystring("Key"),"'","")
else
	Key=""
end if
urls="/company/list_"&pid&"_"&cid&"_"&server.URLEncode(city)&"_"
htitle="济南"&ptitle&" "&ctitle
postions=postions&"&gt;<a href=""list_"&pid&"_0___"&style&".html"">"&ptitle&"</a>"
postions=postions&"&gt;<a href=""list_"&pid&"_"&cid&"___"&style&".html"">"&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%>-济南公司|济南商户-济南分类信息</title>
<link href="../style/global.css" rel="stylesheet" type="text/css" />
<link href="style/list.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="/js/common.js"></script>
</head>

<body>
<!--#include file="../head.asp"-->
<script type="text/javascript">htab( 5 ,2,5);</script>
<div class="br"></div>
<table width="960"  border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td><div class="right"><a href="/reg.asp" style="color:red; line-height:24px; font-weight:bold;">商家点击加入-&gt;</a></div>
    <div class="position">当前位置：<a href="/">首页</a>&gt;<a href="/company/">济南商户</a><%=postions%></div></td>
  </tr>
</table>
<table width="960"  border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td>
    <ul class="ul_info_catalogs">
      <li<%if(cid=0) then response.write(" class=""on""") end if%>><a href="list_<%=pid%>_0_<%=server.URLEncode(city)%>__<%=style%>.html" title="不限">不限</a></li>
			<%
					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
					%>
      <li<%if(rs(0)=cid) then response.write(" class=""on""") end if%>><a href="list_<%=pid%>_<%=rs(0)%>_<%=server.URLEncode(city)%>__<%=style%>.html" title="<%=rs(1)%>"><%=rs(1)%></a></li>
      <%
						rs.movenext
					wend
					rs.close
					set rs=nothing
					end if
					%>
    </ul></td>
  </tr>
</table>
<table width="960"  border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td width="916">
    <ul class="ul_info_catalogs">
    	<li<%if(city="") then response.write(" class=""on""") end if%>><a href="list_<%=pid%>_<%=cid%>___<%=style%>.html" title="不限">不限</a></li>
      <%
					set rs=server.CreateObject("adodb.recordset") 
					rs.open "select ZID,ZName from t_city order by ZPostCode asc",conn,3,1
					while not rs.eof
					%>
      <li<%if(rs(0)=city) then response.write(" class=""on""") end if%>><a href="list_<%=pid%>_<%=cid%>_<%=server.URLEncode(rs(0))%>__<%=style%>.html" title="<%=rs(1)%>"><%=rs(1)%></a></li>
      <%
						rs.movenext
					wend
					rs.close
					set rs=nothing
					%>
    </ul></td>
  </tr>
</table>
<table width="960" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td height="30" bgcolor="#F9F9F9" style="text-align:center;">
    <form id="form1" name="form1" method="get" action="/company/search.asp">
      信息搜索：      		
		<input type="hidden" name="hid" value="0" />
    <select name="City">
			<option value="">地区</option>
			<option value="历下" >历下</option>
      <option value="市中" >市中</option>
      <option value="历城" >历城</option>
      <option value="天桥" >天桥</option>
      <option value="槐荫" >槐荫</option>
      <option value="高新" >高新</option>
      <option value="长清区" >长清区</option>
      <option value="章丘市" >章丘市</option>
      <option value="济南周边" >济南周边</option>
    </select>    
    关键字：
    <input type="text" name="Key" id="Key" />
    <input type="submit" name="button" id="button" value="开始搜索" />
    </form>
    </td>
  </tr>
</table>
<table width="960" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#2fc300">
  <tr>
    <td height="4"></td>
  </tr>
</table>
<div class="list_main">
	<div id="list_contain">
  	<div id="left">
    	<div class="topa"><a href="/reg.asp" class="btn">商家加入</a><a href="list_<%=pid%>_<%=cid%>___1.html" class="btn">图文显示</a><a href="list_<%=pid%>_<%=cid%>___0.html" class="btn">文本显示</a></div>
			<%  
			if(City<>"") then
				set rs=server.CreateObject("adodb.recordset") 
				rs.open "select ZName from t_city where ZID='"&City&"'",conn,3,1
				if not rs.eof then
					City=rs(0)
				end if
				rs.close
				set rs=nothing
			end if
			csql="select count(*) from t_member where IsCheck=1 and MemberType=1"
				if(pid>0) then
					csql=csql&" and IndustryId="&pid
				end if
				if(cid>0) then
					csql=csql&" and CatalogId="&cid
				end if
				if(Province<>"") then
					csql=csql&" and Province='"&Province&"'"
				end if
				if(City<>"") then
					csql=csql&" and City='"&City&"'"
				end if
				if(Key<>"") then
					csql=csql&" and UserName like '%"&Key&"%'"
				end if				
				sql="select top "&recpage&" id,Photo,UserName,HomePage,RegDate,Province,City,SalesFor,Hits,Tel,Address from t_member where id<=(select min(id) from (select top "&((currentpage-1)*recpage+1)&" id from t_member where IsCheck=1 and MemberType=1"
				if(pid>0) then
					sql=sql&" and IndustryId="&pid
				end if
				if(cid>0) then
					sql=sql&" and CatalogId="&cid
				end if
				if(Province<>"") then
					sql=sql&" and Province='"&Province&"'"
				end if
				if(City<>"") then
					sql=sql&" and City='"&City&"'"
				end if
				if(Key<>"") then
					sql=sql&" and UserName like '%"&Key&"%'"
				end if
				sql=sql&" order by id desc) as t) and IsCheck=1 and MemberType=1"
				if(pid>0) then
					sql=sql&" and IndustryId="&pid
				end if
				if(cid>0) then
					sql=sql&" and CatalogId="&cid
				end if
				if(Province<>"") then
					sql=sql&" and Province='"&Province&"'"
				end if
				if(City<>"") then
					sql=sql&" and City='"&City&"'"
				end if
				if(Key<>"") then
					sql=sql&" and UserName like '%"&Key&"%'"
				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="#F4FFF4"
					bg_color2="#FFFFFF"
					if(style=1) then					
						
						for i=0 to ubound(carr,2)
							if(i mod 2=0) then
								bg_color=bg_color1
							else
								bg_color=bg_color2
							end if
					%>
				<table width="100%" border="0" cellpadding="0" cellspacing="0">
					<tr>
					  <td width="24%" bgcolor="<%=bg_color%>" class="padd5"><a href="/company/detail_<%=carr(0,i)%>.html" target="_blank"><img src="<%=carr(1,i)%>" width="156" height="129" border="0" alt="<%=carr(2,i)%>" /></a></td>
						<td width="76%" height="24" valign="top" bgcolor="<%=bg_color%>" class="padd5">
            <h2 class="com_h2"><a href="/company/detail_<%=carr(0,i)%>.html" title="<%=carr(2,i)%>" target="_blank"><%=carr(2,i)%></a></h2>
            <p><%=carr(7,i)%></p>地址：<%=carr(10,i)%> &nbsp; 电话：<%=carr(9,i)%><br />
						<a href="<%=carr(3,i)%>" target="_blank"><%=carr(3,i)%></a> 人气：<%=carr(8,i)%>
            </td>
					</tr>      
				</table>
				<%
						next
					else
				%>
      <table width="100%" border="0" cellpadding="0" cellspacing="0" class="table">
          <tr>
            <td width="50%" height="24" class="padd5"><strong>名称</strong></td>
            <td width="21%"><div align="center"><strong>注册日期</strong></div></td>
            <td width="16%"><div align="center"><strong>地区</strong></div></td>
            <td width="13%"><div align="center"><strong>点击</strong></div></td>
        </tr>
      </table>
      <!--start-->
      	<%
						for i=0 to ubound(carr,2)
							if(i mod 2=0) then
								bg_color=bg_color1
							else
								bg_color=bg_color2
							end if
					%>
			<table width="100%" border="0" cellpadding="0" cellspacing="0" class="table">
					<tr>
						<td width="50%" height="44" bgcolor="<%=bg_color%>" class="padd5"><h2 class="com_h2"><a href="/company/detail_<%=carr(0,i)%>.html" title="<%=carr(2,i)%>" target="_blank">·<%=carr(2,i)%></a></h2></td>
						<td width="21%" bgcolor="<%=bg_color%>"><div align="center"><%=carr(4,i)%></div></td>
						<td width="16%" bgcolor="<%=bg_color%>"><div align="center"><%=carr(5,i)%>~<%=carr(6,i)%></div></td>
						<td width="13%" bgcolor="<%=bg_color%>"><div align="center"><%=carr(8,i)%></div></td>
				</tr>      
			</table>
				<%
					next
				end if
			else
				response.write("<p align=""center"">暂时没有记录!</p>")
			end if
      set carr=nothing
      %>
    <!--end-->
    <!--pages-->
    <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="""&urls&"1"&"_"&style&".html"">首</a>")
			response.write("<a href="""&urls&(currentpage-1)&"_"&style&".html"">&lt;</a>")
			'''''''''''''''''
			for j=startpage to endpage
					if(j=currentpage) then
						response.write("<a href=""#"" class=""current"">"&j&"</a>")
					else
						response.write("<a href="""&urls&j&"_"&style&".html"">"&j&"</a>")
					end if
					if(j>(startPage+10)) then
						exit for
					end if
			next
			'''''''''''''''''''''''''''''''''''''
			response.write("<a href="""&urls&(currentpage+1)&"_"&style&".html"">&gt;</a>")
			response.write("<a href="""&urls&totalpage&"_"&style&".html"">尾</a>")
			%>
    </div>
    </div>
    <div id="right">
    	<div class="cont">
        <h2>本类热点</h2>
    	  <div class="txts_10">
          <ul>
            <%
							set rs=server.CreateObject("adodb.recordset") 
							rs.open "select top 10 id,UserName,HomePage,Photo from t_member where IsTop=1 order by SortId asc",conn,3,1
							while not rs.eof
							%>
							<li>·<a href="/company/detail_<%=rs(0)%>.html" title="<%=rs(1)%>" target="_blank"><%=rs(1)%></a></li>
							<%
								rs.movenext
							wend
							rs.close
							set rs=nothing
							%>    
          </ul>
  	    </div>
    	  <div class="clear"></div>
  	  </div>
      <div class="br"></div>
      <div class="cont">
        <h2>点击排行</h2>
    	  <div class="txts_10">
          <ul>
            <%
							set rs=server.CreateObject("adodb.recordset") 
							rs.open "select top 10 id,UserName,HomePage,Photo,Hits from t_member where CatalogId="&cid&" order by Hits desc",conn,3,1
							while not rs.eof
							%>
							<li><span class="right"><%=rs(4)%>&nbsp;</span>·<a href="/company/detail_<%=rs(0)%>.html" title="<%=rs(1)%>" target="_blank"><%=rs(1)%></a></li>
							<%
								rs.movenext
							wend
							rs.close
							set rs=nothing
							%>    
          </ul>
  	    </div>
    	  <div class="clear"></div>
  	  </div>
      <div class="br"></div>
      <div class="cont">
        <h2>最新评论</h2>
    	  <div class="txts_10">
          <ul>
            <%
							set rs=server.CreateObject("adodb.recordset") 
							rs.open "select top 10 shop_id,f_content from t_shop_commen order by id desc",conn,3,1
							while not rs.eof
							%>
							<li>·<a href="/company/detail_<%=rs(0)%>.html" target="_blank"><%=left(rs(1),17)%></a></li>
							<%
								rs.movenext
							wend
							rs.close
							set rs=nothing
							%>    
          </ul>
  	    </div>
    	  <div class="clear"></div>
  	  </div>
    </div>
  </div>
</div>   
<!--#include file="../root.asp"-->
</body>
</html>
<%
call connclose()
%>
