<!--#include file="pysjzx_conn.asp"-->
<!--#include file="webconfig.asp"-->
<%
pysjzx=trim(replace(request("pysjzx_type"),"'",""))
%>
<html>
<head>
<title><%=webname%>-<%if pysjzx ="price" then%>报价<%end if%>
<%if pysjzx= "second_hand" then%>二手车<%end if%>
 <%if pysjzx="lease" then %>租赁车<%end if%>查询结果</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" >
<meta content="<%=keyword%>" name="keywords">
<meta content="<%=description%>" name="description">
<LINK href="css/style.css" rel=stylesheet type=text/css>
<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>
</head>
<!--#include file="webhead.asp"-->
<%

'品牌
anclass=request("anclass")
if IsNumeric(request("anclass"))=False or request("anclass")="" then
		response.write"<SCRIPT language=JavaScript>alert('参数错误！');"
		response.write pysjzx
		response.end	
		end if
		if anclass <> 0 then
tj1="and anclass  = "&anclass
else
tj1=""
end if


'系列
nclass=request("nclass")
if IsNumeric(request("nclass"))=False or request("nclass")="" then
		response.write"<SCRIPT language=JavaScript>alert('参数错误！');"
		response.end	
		end if
		if nclass <>0 then
tj2="and nclass  = "&nclass
else
tj2=""
end if


'市
province=request("province")
if IsNumeric(request("province"))=False or request("province")="" then
		response.write"<SCRIPT language=JavaScript>alert('参数错误！');"
		response.end	
		end if
		if province<>0 then
tj3="and  province ="& province
else
tj3=""
end if

'城
city=request("city")
if IsNumeric(request("city"))=False or request("city")="" then
		response.write"<SCRIPT language=JavaScript>alert('参数错误！');"
		response.end	
		end if
		if city<>0 then
tj4="and  city ="& city
else
tj4=""
end if



'报价-价格
price=request("price_price")
if pysjzx="price" then
if IsNumeric(request("price_price"))=False or request("price_price")="" then
		response.write"<SCRIPT language=JavaScript>alert('参数错误！');"
		response.end	
		end if
		if price <>0 then
		if price =1 then
tj5="and  price <= 10000 "
end if

	if price =2 then
tj5="and  price >= 10000 and price <= 50000"
end if

	if price =3 then
tj5="and  price >= 50000 and price <=100000"
end if

	if price =4 then
tj5="and  price >= 100000 and price <=200000"
end if

	if price =5 then
tj5="and  price >= 200000 and price <= 500000"
end if

	if price =6 then
tj5="and  price >= 500000 and price  <= 1000000"
end if

if price =7 then
tj5="and  price >= 1000000"
end if

else
tj5=""
end if
end if

'二手车-价格
sell_price=request("sell_price")
if pysjzx="second_hand" then
if IsNumeric(request("sell_price"))=False or request("sell_price")="" then
		response.write"<SCRIPT language=JavaScript>alert('参数错误！');"
		response.end	
		end if
		if sell_price <>0 then
		if sell_price =1 then
tj5="and  sell_price <= 2000 "
end if

	if sell_price =2 then
tj5="and  sell_price >= 2000 and sell_price <= 5000"
end if

	if sell_price =3 then
tj5="and  sell_price >= 5000 and sell_price <=10000"
end if

	if sell_price =4 then
tj5="and  sell_price >= 10000 and sell_price <=20000"
end if

	if sell_price =5 then
tj5="and  sell_price >= 20000 and sell_price <= 50000"
end if

	if sell_price =6 then
tj5="and  sell_price >= 50000 and sell_price  <= 100000"
end if

	if sell_price =7 then
tj5="and  sell_price >= 100000 and sell_price  <= 200000"
end if

if sell_price =8 then
tj5="and  sell_price >= 200000"
end if

else
tj5=""
end if
end if


'租赁车-日租价
day_lease_price=request("day_lease_price")
if pysjzx="lease" then
if IsNumeric(request("day_lease_price"))=False or request("day_lease_price")="" then
		response.write"<SCRIPT language=JavaScript>alert('参数错误！');"
		response.end	
		end if
		if day_lease_price <>0 then
		if day_lease_price =1 then
tj5="and  day_lease_price <= 100 "
end if

	if day_lease_price =2 then
tj5="and  day_lease_price >= 100 and day_lease_price <= 200"
end if

	if day_lease_price =3 then
tj5="and  day_lease_price >= 200 and day_lease_price <=500"
end if

	if day_lease_price =4 then
tj5="and  day_lease_price >= 500 and day_lease_price <=1000"
end if

	if day_lease_price =5 then
tj5="and  day_lease_price >= 1000 and day_lease_price <= 2000"
end if

if day_lease_price =6 then
tj5="and  day_lease_price >= 2000"
end if

else
tj5=""
end if
end if

'租赁车-月租价
month_lease_price=request("month_lease_price")
if pysjzx="lease" then
if IsNumeric(request("month_lease_price"))=False or request("month_lease_price")="" then
		response.write"<SCRIPT language=JavaScript>alert('参数错误！');"
		response.end	
		end if
		if month_lease_price <>0 then
		if month_lease_price =1 then
tj6="and  month_lease_price <= 1000 "
end if

	if month_lease_price =2 then
tj6="and  month_lease_price >= 1000 and month_lease_price <= 2000"
end if

	if month_lease_price =3 then
tj6="and  month_lease_price >= 2000 and month_lease_price <=5000"
end if

	if month_lease_price =4 then
tj6="and  month_lease_price >= 5000 and month_lease_price <=10000"
end if

	if month_lease_price =5 then
tj6="and  month_lease_price >= 10000 and month_lease_price <= 20000"
end if

	if month_lease_price =6 then
tj6="and  month_lease_price >= 20000 and month_lease_price <= 50000"
end if

if month_lease_price =7 then
tj6="and  month_lease_price >= 50000"
end if

else
tj6=""
end if
end if



%>
<div align="center">
	<table border="0" width="780" cellpadding="0">
		<tr>
			<td width=613 valign="top">
				<table border="0" width="99%" cellspacing="0" cellpadding="0">
												<tr>
													<td bgcolor="#F7F7F7" height=20>
													&nbsp;&nbsp;
													<%if pysjzx ="price" then%>报价<%end if%>
													<%if pysjzx= "second_hand" then%>二手车<%end if%>
                                                    <%if pysjzx="lease" then %>租赁车<%end if%>查询结果 </td>
															
													<td bgcolor="#E9E9E9"  width=2></td>
												</tr>
												<tr>
												
													<td bgcolor="#E9E9E9" height=2></td>
													<td bgcolor="#E9E9E9" height=2 colspan="1"></td>

												</tr>
											</table>
<table id="AutoNumber4" style="BORDER-TOP-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-COLLAPSE: collapse; BORDER-RIGHT-WIDTH: 0px" borderColor="#111111" cellSpacing="2" cellPadding="2" width="96%" align="center" border="0">
					<%	if pysjzx= "price" then
					%>
					<tr bgcolor=#F7F7F7>
          <td height="25" align="center"   width=10% bgcolor="#EFEFEF">品牌</td>
          <td align="center" width=25% bgcolor="#EFEFEF">型号</td>
          <td  align="center"  width=15% bgcolor="#EFEFEF">价格(元)</td>
          <td align="center"  width=15% bgcolor="#EFEFEF">经销商</td>
            <td align="center"  width=15% bgcolor="#EFEFEF" colspan="2">日期</td>
        </tr><%
end if%>
	<%	if pysjzx= "second_hand" then
					%>
					<tr bgcolor=#F7F7F7>
          <td height="25" align="center"   width=10% bgcolor="#EFEFEF">品牌</td>
          <td align="center" width=25% bgcolor="#EFEFEF">型号</td>
          <td  align="center"  width=15% bgcolor="#EFEFEF">价格(元)</td>
          <td align="center"  width=15% bgcolor="#EFEFEF" colspan="2">年份</td>
            <td align="center"  width=15% bgcolor="#EFEFEF">日期</td>
        </tr><%
end if%>
<%	if pysjzx= "lease" then
					%>
					<tr bgcolor=#F7F7F7>
          <td height="25" align="center"   width=10% bgcolor="#EFEFEF">品牌</td>
          <td align="center" width=25% bgcolor="#EFEFEF">型号</td>
          <td  align="center"  width=20% bgcolor="#EFEFEF">日租价</td>
          <td  align="center"  width="23%" bgcolor="#EFEFEF" colspan="2">月租价</td>
          <td  align="center"  width="22%" bgcolor="#EFEFEF">日期</td>
        </tr><%
end if%>
						<%
									
set rs=server.createobject("adodb.recordset")
	if pysjzx= "price" then
        rs.open "select * from [price] where estate=1 "&tj1&" "&tj2&" "&tj3&" "&tj4&" "&tj5&"  and  1=1 order by adddate desc",conn,1,1
     end if
	if pysjzx= "second_hand" then
        rs.open "select * from [second_hand] where estate=1 "&tj1&" "&tj2&" "&tj3&" "&tj4&" "&tj5&" and  1=1 order by adddate desc",conn,1,1
end if
	if pysjzx= "lease" then
        rs.open "select * from [lease] where estate=1  "&tj1&" "&tj2&" "&tj3&" "&tj4&" "&tj5&" "&tj6&"   and  1=1 order by adddate desc",conn,1,1
end if
        rs.open sql,conn,1,1
	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
	
			For i=1 To x
		%><%
'-----------------报价-----------------	
if pysjzx="price" then%><tr  bgColor="#f7f7f7" onmouseout="mOut(this,'#F7F7F7');" onmouseover="mOvr(this,'#FFD28E');">
          <td height="20" 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="center"><a href="price_list.asp?id=<%=rs("id")%>">
    <%
	if rs("attop")=1 then
	response.write "<font color='#FF0000'>"
	end if	
	if rs("attop")=2 then
	response.write "<font color='#008080'>"
	end if	
 response.write rs("model")
  %></a></td>
                   <td  align="center"  >	<%if rs("attop")=1 then%><font color="#FF0000">
				<%elseif rs("attop")=2 then%><font color="#008080">
				<%else%>
	<%end if%>
				<%=rs("price")%>　</td>
          <td align="center"  ><%
  color=""
  if rs("username") <>"" then
				set rs4=server.createobject("adodb.recordset")
sql4="select company,username,userid,sort,reglx from pysjzx_user  where username='"&rs("username")&"'"
rs4.open sql4,conn,1,1
if not rs4.eof then
if rs4("reglx")=2 then
color="<font color='#008080'>"
end if
if rs4("sort")=2 then
response.write "<a href=dealer_list.asp?id="&rs4("userid")&" target=_blank>"&color&rs4("company")&"</a>"
end if
rs4.close
else
response.write "该经销商已删除"
end if
else
response.write "<font color='#ff0000'>本站发布</font>"
end if
%></td>
                 <td align="center" colspan="2"   ><%if rs("attop")=1 then%><font color="#FF0000">
				<%=right("0"&month(rs("topadddate")),2)%>-<%=right("0"&day(rs("topadddate")),2)%>
				<%elseif rs("attop")=2 then%><font color="#008080">
				<%else%>
	<%=right("0"&month(rs("adddate")),2)%>-<%=right("0"&day(rs("adddate")),2)%>
	<%end if%></td>
        </tr><%end if%>
        
        <%
'-----------------二手车-----------------	        
        if pysjzx="second_hand" then%><tr  bgColor="#f7f7f7" onmouseout="mOut(this,'#F7F7F7');" onmouseover="mOvr(this,'#FFD28E');">
          <td height="20" 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="center"><a href="second_hand_list.asp?id=<%=rs("id")%>">
    <%
	if rs("attop")=1 then
	response.write "<font color='#FF0000'>"
	end if	
	if rs("attop")=2 then
	response.write "<font color='#008080'>"
	end if	
 response.write rs("model")
  %></a></td>
          <td  align="center"  ><%
          	if rs("attop")=1 then
	response.write "<font color='#FF0000'>"
	end if	
	if rs("attop")=2 then
	response.write "<font color='#008080'>"
	end if	
	%><%if rs("sell_price") =0 then 
	response.write "面试"
	else
	response.write rs("sell_price")
	end if
	%></td>
          <td align="center" colspan="2"  >
          <%
          	if rs("attop")=1 then
	response.write "<font color='#FF0000'>"
	end if	
	if rs("attop")=2 then
	response.write "<font color='#008080'>"
	end if	
	%><%if rs("buy_time") =0 then
	response.write "不详"
	else
	response.write rs("buy_time")
	end if
	%>
	
	</td>
                 <td align="center"   >
                 <%if rs("attop")=1 then%><font color="#FF0000">
				<%=right("0"&month(rs("topadddate")),2)%>-<%=right("0"&day(rs("topadddate")),2)%>
				<%elseif rs("attop")=2 then%><font color="#008080">
				<%else%>
	<%=right("0"&month(rs("adddate")),2)%>-<%=right("0"&day(rs("adddate")),2)%>
	<%end if%></td>
        </tr><%end if%>

						
  <%
'-----------------租赁车-----------------	
  if pysjzx="lease" then%><tr  bgColor="#f7f7f7" onmouseout="mOut(this,'#F7F7F7');" onmouseover="mOvr(this,'#FFD28E');">
          <td height="20" 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="center"><%if rs("attop")=1 then%><font color="#FF0000">
				<%elseif rs("attop")=2 then%><font color="#008080">
				<%else%><%end if%><a href="lease_list.asp?id=<%=rs("id")%>">
    <%
 response.write rs("model")
  %></a></td>
          <td  align="center" >
          <%if rs("day_lease_price") =0 then 
	response.write "面试"
	else
	response.write rs("day_lease_price")
	end if%></td>
          <td  align="center" colspan="2"  >
          <%if rs("month_lease_price") =0 then 
	response.write "面试"
	else
	response.write rs("month_lease_price")
	end if
	%>
          </td>
          <td  align="center"  ><%if rs("attop")=1 then%><font color="#FF0000">
				<%=right("0"&month(rs("topadddate")),2)%>-<%=right("0"&day(rs("topadddate")),2)%>
				<%elseif rs("attop")=2 then%><font color="#008080">
				<%else%>
	<%=right("0"&month(rs("adddate")),2)%>-<%=right("0"&day(rs("adddate")),2)%>
	<%end if%></td>
        </tr><%end if%>

							
						<%rs.movenext
		next
			end if
						rs.close
						
						%>						
						</table>
				</div>
				</div>
				<table width="100%">
					<tr>
						<td>
						<p align="right"><p align="right"><%	call PageControl(iCount,maxpage,page,"border=0 align=right","<p align=center>")


		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 width=200 valign="top" style="border: 1px solid #C0C0C0">
				　</td>
		</tr>
		</table>
</div>
</html>
<!--#include file=webfoot.asp-->