<!--#include file="pysjzx_conn.asp"-->
<!--#include file="webconfig.asp"-->
<%leixing=lcase(trim(request("id")))  
					  select case leixing
					  case "big"
					  	anclassid=trim(request("anid"))
		if IsNumeric(request.QueryString("anid"))=False or request.QueryString("anid")="" then
		response.write"<SCRIPT language=JavaScript>alert('参数错误');"
		response.end	
		end if

					  	set rs=server.createobject("adodb.recordset")
					  	rs.open "select * from anclass where  anclassid="&anclassid,conn,1,1
						if rs.bof and rs.eof then
						response.write"参数错误！"
						response.end
						end if
						anclassname=rs("anclass")
						rs.close
					  %>
					   <%
					  case "small"
anclassid=trim(request("anid"))
		if IsNumeric(request.QueryString("anid"))=False or request.QueryString("anid")="" then
		response.write"<SCRIPT language=JavaScript>alert('参数错误');"
		response.end	
		end if
					  	nclassid=trim(request("nid"))
		if IsNumeric(request.QueryString("nid"))=False or request.QueryString("nid")="" then
		response.write"<SCRIPT language=JavaScript>alert('参数错误');"
		response.end	
		end if
					  	set rs=server.createobject("adodb.recordset")
					  	rs.open "select * from anclass where  anclassid="&anclassid,conn,1,1
						if rs.bof and rs.eof then
						response.write"参数错误！"
						response.end
						end if
						anclassname=rs("anclass")
						rs.close
					  	rs.open "select * from nclass where  nclassid="&nclassid,conn,1,1
						if rs.bof and rs.eof then
						response.write"参数错误！"
						response.end
						end if
						nclassname=rs("nclass")
						rs.close
						end select
					  %>  
<html>
<head>
<title><%=webname%>-二手车<%select case leixing
					  case "big"%>-<%=anclassname%>
					  <%case "small"%>-<%=anclassname%>-<%=nclassname%>
					  <%end select%></title>
<meta content="<%=keyword%>" name="keywords">
<meta content="<%=description%>" name="description">
<LINK href="css/style.css" rel=stylesheet type=text/css>
</head>
<!--#include file="webhead.asp"-->
<SCRIPT language=javaScript>
<!--
function mOvr(src,clrOver){ 
	if (!src.contains(event.fromElement)) { 
		src.bgColor = clrOver; 
	}
}
function mOut(src,clrIn)  { 
	if (!src.contains(event.toElement)) { 
		src.bgColor = clrIn; 
	}
} 
//-->
</SCRIPT>
<div align="center">
<table cellSpacing="0" cellPadding="0" width="780" border="0">
	<tr>
		<td height=25 bgcolor="#DEDEDE">您的位置: <a href="index.asp">首页</a> &gt;&gt; <a href="second_hand.asp">二手车</a> <%select case leixing
					  case "big"%>>> <a href=second_hand.asp?id=big&anid=<%=anclassid%>><%=anclassname%></a>
					  <%case "small"%>
					  >> <a href=second_hand.asp?id=big&anid=<%=anclassid%>><%=anclassname%></a>
					  >> <a href=second_hand.asp?id=small&anid=<%=anclassid%>&nid=<%=nclassid%>><%=nclassname%></a>
					  <%end select%></td>
	</tr>
</table>
</div>
<div align="center">
<table cellSpacing="0" cellPadding="0" width="780" border="0">
	<tr>
		<td vAlign="top" align="middle" >
		<table cellSpacing="0" cellPadding="0" width="570" border="0">
			<tr>
				<td height="5"></td>
			</tr>
		</table>
		<table class="ourfont" cellSpacing="1" cellPadding="0" width="590" bgColor="#ffffff" border="0">
			<tr>
				<td height=25 align="middle" width="72" bgColor="#ffffff"><b>车型导航：</b></td>
				<td align="middle" width="65" bgColor="#ffecd0">
				<a href="research.asp?pysjzx_type=second_hand&anclass=0&nclass=0&province=0&city=0&sell_price=1">2000以下</a></td>
				<td align="middle" width="79" bgColor="#ffccaa">
				<a href="research.asp?pysjzx_type=second_hand&anclass=0&nclass=0&province=0&city=0&sell_price=2">2000-5000</a></td>
				<td align="middle" width="90" bgColor="#ff9853">
				<a href="research.asp?pysjzx_type=second_hand&anclass=0&nclass=0&province=0&city=0&sell_price=3">5000-10000</td>
				<td align="middle" width="90" bgColor="#ff7b24">
				<a href="research.asp?pysjzx_type=second_hand&anclass=0&nclass=0&province=0&city=0&sell_price=4">10000-20000</td>
				<td align="middle" width="91" bgColor="#3366ff">
				<a href="research.asp?pysjzx_type=second_hand&anclass=0&nclass=0&province=0&city=0&sell_price=5">
				<font color="#FFFFFF">20000-50000</font></td>
				<td align="middle" width="86" bgColor="#3366ff">
				<a href="research.asp?pysjzx_type=second_hand&anclass=0&nclass=0&province=0&city=0&sell_price=6">
				<font color="#FFFFFF">50000-100000</font></td>
			</tr>
		</table>
		<table cellSpacing="0" cellPadding="0" width="600" border="0">
			<tr>
				<td height="5"></td>
			</tr>
		</table>
		<table cellSpacing="1" cellPadding="0" width="100%" bgColor="#e6e6e6" border="0">
			<tr>
				<td align="middle" bgColor="#eeeeee">
				<table cellSpacing="0" cellPadding="0" width="555" border="0">
					<tr>
						<td class="ourfont" width="452"><font color="#333333">二 手 车 
						推
						荐</font></td>
						<td class="ourfont" align="right" width="103">
						　</td>
					</tr>
				</table>
				</td>
			</tr>
			<tr>
				<td align="middle" bgColor="#ffffff" height="79">
				<%set rs=server.CreateObject("adodb.recordset")
		  rs.open "select *  from [second_hand]  where estate=1 and commend=1  order by adddate desc  ",conn,1,1
%>
				<table cellPadding="2" width="98%" border="0">
					<%
				j_1=int((rs.recordcount+1)/2)
			if j_1>6 then 
			j_1=6
			end if
			for j_count=1 to j_1%><tr>
						<td align="middle" width="51%">
					<%
			if  not rs.eof then%>
						<table class="ourfont1" cellSpacing="0" cellPadding="0" width="98%" border="0">
							<tr>
								<td align="middle" width="50%" rowSpan="4">
								<a   href="second_hand_list.asp?id=<%=rs("id")%>">
								<img height="81" src="<%=rs("pic")%>" width="124" border="1" style="border: 1px solid #000000"></a></td>
								<td>品牌：<%set rs2=server.createobject("adodb.recordset")
									rs2.open "select * from anclass where anclassid="&rs("anclass"),conn,1,1
									if rs2.recordcount>0 then
									response.write rs2("anclass")
									end if
									rs2.close
									%></td>
							</tr>
							<tr>
								<td height=15>型号：<a   href="second_hand_list.asp?id=<%=rs("id")%>"><font color="#FF0000"><%
				if len(trim(rs("model"))) >= 10 then
				response.write left(trim(rs("model")),8)&".."
				else
				response.write trim(rs("model"))
				end if
				%></font></a></td>
							</tr>
							<tr>
								<td height=15>价格：<%if rs("sell_price") =0 then
				response.write "面议"
				else
				response.write rs("sell_price")
				end if
				%></td>
							</tr>
							<tr>
								<td height=15>地点：<%set rs2=server.createobject("adodb.recordset")
									rs2.open "select * from province where shengNo="&rs("province"),conn,1,1
									if rs2.recordcount>0 then
									response.write rs2("shengname")
									shengid=rs2("id")
									else
									response.write "不限"
									end if
									rs2.close
									%></td>
							</tr>
							</table>
						<%
						rs.movenext
						end if%>
						</td>
						<td align="middle" width="49%">
						<%if  not rs.eof then%>
						<table class="ourfont1" cellSpacing="0" cellPadding="0" width="98%" border="0">
							<tr>
								<td align="middle" width="50%" rowSpan="4">
								<a   href="second_hand_list.asp?id=<%=rs("id")%>">
								<img height="81" src="<%=rs("pic")%>" width="124" border="1" style="border: 1px solid #000000"></a></td>
								<td>品牌：<%set rs2=server.createobject("adodb.recordset")
									rs2.open "select * from anclass where anclassid="&rs("anclass"),conn,1,1
									if rs2.recordcount>0 then
									response.write rs2("anclass")
									end if
									rs2.close
									%></td>
							</tr>
							<tr>
								<td height=15>型号：<a   href="second_hand_list.asp?id=<%=rs("id")%>"><font color="#FF0000"><%
				if len(trim(rs("model"))) >= 10 then
				response.write left(trim(rs("model")),8)&".."
				else
				response.write trim(rs("model"))
				end if
				%></font></a></td>
							</tr>
							<tr>
								<td height=15>价格：<%if rs("sell_price") =0 then
				response.write "面议"
				else
				response.write rs("sell_price")
				end if
				%></td>
							</tr>
							<tr>
								<td height=15>地点：<%set rs2=server.createobject("adodb.recordset")
									rs2.open "select * from province where shengNo="&rs("province"),conn,1,1
									if rs2.recordcount>0 then
									response.write rs2("shengname")
									shengid=rs2("id")
									else
									response.write "不限"
									end if
									rs2.close
									%></td>
							</tr>
							</table>
						<%
						rs.movenext
						end if
						next
						
						%>

						</td>
					</tr>
					</table>
				</td>
			</tr>
		</table>
		<table cellSpacing="0" cellPadding="0" width="570" border="0">
			<tr>
				<td height="5"></td>
			</tr>
		</table>
		<table cellSpacing="0" cellPadding="0" width="570" border="0">
			<tr>
				<td height="5"></td>
			</tr>
		</table>
				<table border="0" width="100%" cellspacing="0" >
					<tr>
						<td ><table border="0" width="100%" cellspacing="0">
							<tr>
								<td style="font-size: 12px; color: #000000; padding-top: 2px; padding-bottom: 2px" bgcolor="#DADADA" >　
								二<span lang="en-us"> </span>手<span lang="en-us">
								</span>车</td>
								<td style=" font-size: 12px; color: #000000; padding-top: 2px; padding-bottom: 2px" width="65" bgcolor="#DADADA" >
								　</td>
							</tr>
						</table>
						</td>
					</tr>
				</table>
				<%set rs=server.CreateObject("adodb.recordset")
	if leixing="big" then
		   rs.open "select  *  from [second_hand]  where estate=1 and anclass="&anclassid&"    order by adddate desc  ",conn,1,1
		elseif leixing="small" then
		   rs.open "select  *  from [second_hand]  where estate=1 and anclass="&anclassid&" and nclass="&nclassid&" order by adddate desc  ",conn,1,1
		else
		   rs.open "select  *  from [second_hand]  where estate=1   order by adddate desc  ",conn,1,1
		end if
		if rs.recordcount=0 then 
		else
	  		rs.PageSize =20 '每页记录条数
			iCount=rs.RecordCount '记录总数
			iPageSize=rs.PageSize
    		maxpage=rs.PageCount 
    		page=request("page")
    
    if Not IsNumeric(page) or page="" then
        page=1
    else
        page=cint(page)
    end if
    
    if page<1 then
        page=1
    elseif  page>maxpage then
        page=maxpage
    end if
    
    rs.AbsolutePage=Page

	if page=maxpage then
		x=iCount-(maxpage-1)*iPageSize
	else
		x=iPageSize
	end if
		%>

		<table cellSpacing="1" cellPadding="0" width="100%" border="0">
			<tr align="middle">
							<td  bgColor="#EFEFEF" height="19">地区</td>
				<td  bgColor="#EFEFEF" height="19">品 牌</td>

				<td width="196" bgColor="#EFEFEF">型 号</td>
				<td width="77" bgColor="#EFEFEF">价格(<span lang="zh-cn">元</span>)</td>
				<td width="78" bgColor="#EFEFEF">年份</td>
				<td width="66" bgColor="#EFEFEF">发布日期</td>
			</tr><%		   do while not rs.eof 
%>
			<tr bgColor="#efefef" onmouseout="mOut(this,'#efefef');" onmouseover="mOvr(this,'#FFD28E');">
						<td vAlign="center" align="middle" height="19" width="108"><%if rs("attop")=1 then%><font color="#FF0000">
				<%elseif rs("attop")=2 then%><font color="#008080">
				<%else%><%end if%><%set rs2=server.createobject("adodb.recordset")
									rs2.open "select * from province where shengNo="&rs("province"),conn,1,1
									if rs2.recordcount>0 then
									response.write rs2("shengname")
									shengid=rs2("id")
									else
									response.write "不限地区"
									end if
									rs2.close
									%>
									<%set rs2=server.createobject("adodb.recordset")
									rs2.open "select * from city where shengid="&shengid&" and shiNo="&rs("city")&"",conn,1,1
									if rs2.recordcount>0 then
									response.write "-"&rs2("shiname")
									end if
									rs2.close
									%>
				　</td>
				<td vAlign="center" align="middle"  height="19" width="65">
				<p align="center"><%if rs("attop")=1 then%><font color="#FF0000">
				<%elseif rs("attop")=2 then%><font color="#008080">
				<%else%><%end if%><%set rs2=server.createobject("adodb.recordset")
									rs2.open "select * from anclass where anclassid="&rs("anclass"),conn,1,1
									if rs2.recordcount>0 then
									response.write rs2("anclass")
									end if
									rs2.close
									%>
									</td>
	
				<td align="left"  height="19">
										<a   href="second_hand_list.asp?id=<%=rs("id")%>">
										<p align="center">
										<%if rs("attop")=1 then%><font color="#FF0000">
				<%elseif rs("attop")=2 then%><font color="#008080">
				<%else%>
	                        <%end if%>
				<%=rs("model")%></font></font></a><font color="#FF0000"> 
				</td>
				<td align="middle" width="77" >
				<%if rs("attop")=1 then%><font color="#FF0000">
				<%elseif rs("attop")=2 then%><font color="#008080">
				<%else%>
	<%end if%>
				<%
				if rs("sell_price") <> 0 then
				response.write rs("sell_price")
				else
				response.write "面议"
				end if
				%></a></td>
				<td align="middle" width="78" height="19"><%if rs("attop")=1 then%><font color="#FF0000">
				<%elseif rs("attop")=2 then%><font color="#008080">
				<%else%><%end if%>
				<%if rs("buy_time") =0 then
				response.write "不详"
				else
				response.write rs("buy_time")
				end if
				%>
			</td>
				<td align="middle" width="66"  height="19">
					<%if rs("attop")=1 then%><font color="#FF0000">
				<%=month(rs("topadddate"))%>-<%=day(rs("topadddate"))%>
				<%elseif rs("attop")=2 then%><font color="#008080">
				<%else%>
	<%=month(rs("adddate"))%>-<%=day(rs("adddate"))%>
	<%end if%>
</font></font>
</td>
			</tr>	<%
					 rs.movenext
      

  loop

rs.close

					%>
			</table>
		<table border="0" width="100%" cellspacing="0">
			<tr>
				<td>				<%	call PageControl(iCount,maxpage,page,"border=0 align=right","<p align=right>")
				end if

		rs.close
		set rs=nothing
Sub PageControl(iCount,pagecount,page,table_style,font_style)
'生成上一页下一页链接
    Dim query, a, x, temp
    action = "http://" & Request.ServerVariables("HTTP_HOST") & Request.ServerVariables("SCRIPT_NAME")

    query = Split(Request.ServerVariables("QUERY_STRING"), "&")
    For Each x In query
        a = Split(x, "=")
        If StrComp(a(0), "page", vbTextCompare) <> 0 Then
            temp = temp & a(0) & "=" & a(1) & "&"
        End If
    Next

    Response.Write("<table " & Table_style & ">" & vbCrLf )        
    Response.Write("<form method=get onsubmit=""document.location = '" & action & "?" & temp & "Page='+ this.page.value;return false;""><TR>" & vbCrLf )
    Response.Write("<TD align=right>" & vbCrLf )
    Response.Write(font_style & vbCrLf )    
        
    if page<=1 then     
        Response.Write ("上页 " & vbCrLf)
    else        
        Response.Write("<A HREF=" & action & "?" & temp & "Page=" & (Page-1) & ">上页</A> " & vbCrLf)
    end if

    if page>=pagecount then
        Response.Write ("下页 " & vbCrLf)    
    else
        Response.Write("<A HREF=" & action & "?" & temp & "Page=" & (Page+1) & ">下页</A> " & vbCrLf)  
    end if

    Response.Write(" 页次：" & page & "/" & pageCount & "页" &  vbCrLf)
    Response.Write(" 共有" & iCount & "条信息" &  vbCrLf)
    Response.Write("</TD>" & vbCrLf )                
    Response.Write("</TR></form>" & vbCrLf )        
    Response.Write("</table>" & vbCrLf )        
End Sub
%></td></tr>
		</table>
		</td><td vAlign="top" align="right" width="4">
</td>
		<td vAlign="top" align="right" width="182" style="border: 1px solid #C0C0C0" >

		<table cellSpacing="0" cellPadding="0" width="170" border="0">
			<tr>
				<td vAlign="top" align="middle" height="3"></td>
			</tr>
		</table>
<table cellSpacing="0" cellPadding="0" width="98%" border="0">
									<tr>
										<td class="sy-6" width="100%" bgColor="#C0C0C0" height="21">
										&nbsp;<%
      set rs2=server.createobject("adodb.recordset")
		rs2.Open "select * from newsclass where classorder=7",conn,1,1
       if rs2.eof then
       response.write "该类已删除"
       else
       classid=rs2("id")
       response.write "<a href=news.asp?class="&rs2("id")&">"&rs2("class")&"</a>"
       end if
  %></td>
									</tr>
									<%set rs=server.CreateObject("adodb.recordset")
rs.Open "select top 10  * from news where class="&classid&"  order by adddate desc ",conn,1,1
pysjzx_i=1
do while not rs.eof
%>
									
									<tr>
										<td  height="20">
										<a target="_blank" href="news_list.asp?id=<%=rs("newsid")%>"><%=left(rs("newsname"),14)%></a>
										</td>
									</tr>
									<%rs.movenext
									pysjzx_i=pysjzx_i+1
									if pysjzx_i >=11 then exit do
									loop%>
								</table>
		</td>
	</tr>
</table>
</div>
<!--#include file="webfoot.asp"-->