
<!--#include file=webhead.asp-->
<head>
<meta http-equiv="Content-Language" content="zh-cn">
<title><%=webname%>-房产新闻-新闻搜索</title>
<%
servername1=cstr(request.servervariables("http_referer"))
servername2=cstr(request.servervariables("server_name"))
if mid(servername1,8,len(servername2)) <> servername2 then
response.write "路径有误，禁止从网站外部提交表单！"
response.end
end if

keyword=trim(request("keyword"))
keyword=replace(keyword,"'","")
where=request("where")
where=lcase(trim(request("where")))  
					  if IsNumeric(request.form("where"))=False or request.form("where")="" then
		response.write"<SCRIPT language=JavaScript>alert('参数错误！');"
		response.write"javascript:history.go(-1)</SCRIPT>"
		response.end	
		end if
		
				Set rs2news= Server.CreateObject("ADODB.Recordset")
				if where=1 then
		  sql="select * from news where newsname like '%"&keyword&"%' order by adddate desc"
		  end if
		  
		  if where=2 then
		  sql="select * from news where newscontent like '%"&keyword&"%' order by adddate desc"
		  end if
		  
		  if where=3 then
		  sql="select * from news where addname like '%"&keyword&"%' order by adddate desc"
		  end if
		rs2news.open sql,conn,1,1
%>
</head>
<div align="center">
	<table border="0" width="784" cellspacing="0" cellpadding="0" bordercolor="#000000" style="border-left-style: solid; border-left-width: 1px; border-right-style: solid; border-right-width: 1px; border-top-width: 1px; border-bottom-width: 1px" >
		<tr>
			<td bgcolor="#E9E9E9" height=2></td>
				</tr>
		<tr>
			<td height=5></td>
				</tr>
		<tr>
			<td align="center">
			<p align="center"><%if ad2461class=0 then%><a target="_blank" href="<%=ad2461url%>"><img  alt="<%=ad2461name%>" src="<%=ad2461%>"  border="0" width=777 height=123></a>
	<%else%>
													<object classid="clsid:D27CDB6E-AE6D-11CF-96B8-444553540000" id="obj1" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0" border="0" width="777" height="123">
	<param name="movie" value="<%=ad2461%>">
	<param name="quality" value="High">
	<embed src="<%=ad2461%>" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" name="obj1" width="777" height="123"></object>

	<%end if%>
												</td>
				</tr>
		<tr>
			<td height=5></td>
				</tr>
		<tr>
			<td height=5></td>
				</tr>
			</table>
</div>
<div align="center">
	<table border="0" width="784" cellspacing="0" cellpadding="0"  bordercolor="#000000" style="border-left-style: solid; border-left-width: 1px; border-right-style: solid; border-right-width: 1px; border-top-width: 1px; border-bottom-width: 1px" >
		<tr>
			<td></td>
		</tr>
	</table>
	<table border="0" width="784" cellspacing="0" cellpadding="0"  bordercolor="#000000" style="border-left-style: solid; border-left-width: 1px; border-right-style: solid; border-right-width: 1px; border-top-width: 1px; border-bottom-width: 1px" >
		<tr>
			<td width="200" valign="top" >
						<!--#include file="in_hotnews.asp"-->
									<!--#include file="in_jdnews.asp"-->
			　</td>
			<td width=3 bgcolor="#ffffff">　</td>
			<td width=1 bgcolor="#E9E9E9">　</td>
			<td width=3 bgcolor="#ffffff">　</td>
			<td width=580 valign="top">
			<table border="0" width="100%" cellspacing="0" cellpadding="0">
				<tr>
					<td align="right">
					<div align="left">
						<table border="0" width="99%" cellspacing="0" cellpadding="0"><form name="myform" method="post" action="search.asp">
												<tr>
													<td bgcolor="#F7F7F7" height=20>
													&nbsp;房产新闻　</td>
															
													<td bgcolor="#E9E9E9"  width=2></td>
												</tr>
												<tr>
												
													<td bgcolor="#E9E9E9" height=2 colspan="1"></td>
													<td bgcolor="#E9E9E9" height=2 colspan="1"></td>

												</tr>
											</table></div>
					</td>
				</tr>
				<tr>
					<td align="right"  height="5"></td>
				</tr>
				<tr>
					<td align="right"  height="30">
					<p align="left">分类:<a href="index.asp?class=0">地产新闻</a>
					<a href="index.asp?class=1">购房须知</a>
					<a href="index.asp?class=2">租房须知</a>
					<a href="index.asp?class=3">房货金融</a>
					<a href="index.asp?class=4">房产法律</a>
					<a href="index.asp?class=5">售楼技巧</a>
					<a href="index.asp?class=6">家居装饰</a>
					<a href="index.asp?class=7">政策法规</a>
					<a href="index.asp?class=8">土地评估</a></td>
				</tr>
				<tr>
					<td align="right"  height="5"></td>
				</tr>
				<tr>
					<td align="right"  height="30">文章搜索：<input type=text name=keyword size=17 maxlength=20 class=wenbenkuang ><input type=radio name=where value=1 id="where1" checked class="input1"><label for="where1">标题</label><input type=radio name=where value=2 id="where2" class="input1"><label for="where2">内容</label><input type=radio name=where value=3 id="where3" class="input1" ><label for="where3">来源</label>&nbsp;
					<input type=submit value="搜索">&nbsp;&nbsp;
					</td>
				</tr>
				</form>
				<tr>
					<td align="right"  height="5"></td>
				</tr>
				<tr>
					<td  height="20"><table border="0" width="555" id="table2" cellspacing="0" cellpadding="0">
				<tr>
					<td align="center"></td>
				</tr>
				<tr>
					<td></td>
				</tr>
				<%
		if rs2news.recordcount=0 then 
		
		%>
				<tr>
					<td>暂无信息
					　</td>
				</tr>
				<%else%>
				<tr>
					<td align="center">
					<%

	  		rs2news.PageSize =30 '每页记录条数
			iCount=rs2news.RecordCount '记录总数
			iPageSize=rs2news.PageSize
    		maxpage=rs2news.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
    
    rs2news.AbsolutePage=Page

	if page=maxpage then
		x=iCount-(maxpage-1)*iPageSize
	else
		x=iPageSize
	end if
	%>
        <table width="95%" border="0" style="border-collapse: collapse" cellspacing="1">
         
          <%
			
			byshop_i=1
			For i=1 To x
			%>
          <tr > 
		    <td  width="538" ><a href="list.asp?id=<%=rs2news("newsid")%>" title="<%=trim(rs2news("newsname"))%>"><%=trim(rs2news("newsname"))%></a><font color="#ff9900">&nbsp;&nbsp;[ 
			<%=rs2news("adddate")%>     &nbsp;&nbsp;浏览：<%=rs2news("viewcount")%> ]</font></td>
          </tr>
         <%if   byshop_i mod 10 = 0 then%>
          <tr > 
		    <td  width="538" >　</td>
          </tr>
         <%end if%>
         
          <%
          byshop_i=byshop_i+1
			rs2news.movenext
		    next
			%>
        </table>
        <table border="0" width="100%" cellspacing="0" cellpadding="0">
			<tr>
				<td align="right">&nbsp;<%call PageControl(iCount,maxpage,page,"border=0 align=right","<p align=right>")%></td>
			</tr>
		</table>
        <%
		
		end if
		rs2news.close
		set rs2news=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 )    
 Response.Write(" 共有" & iCount & "条信息" &"&nbsp;"&   vbCrLf)
     Response.Write(" 共：" & pageCount & "页" &"&nbsp;"&   vbCrLf)
      Response.Write(" 每页" & iPageSize & "篇" &"&nbsp;"&  vbCrLf)
       Response.Write(" 当前第：" & page & "页" &"&nbsp;"&  vbCrLf)
    if page<=1 then
        Response.Write ("首页 " & vbCrLf)        
        Response.Write ("上一页 " & vbCrLf)
    else        
        Response.Write("<A HREF=" & action & "?" & temp & "Page=1>首页</A> " & vbCrLf)
        Response.Write("<A HREF=" & action & "?" & temp & "Page=" & (Page-1) & ">上一页</A> " & vbCrLf)
    end if

    if page>=pagecount then
        Response.Write ("下一页 " & vbCrLf)
        Response.Write ("尾页 " & vbCrLf)            
    else
        Response.Write("<A HREF=" & action & "?" & temp & "Page=" & (Page+1) & ">下一页</A> " & vbCrLf)
        Response.Write("<A HREF=" & action & "?" & temp & "Page=" & pagecount & ">尾页</A> " & vbCrLf)            
    end if
    Response.Write("</TD>" & vbCrLf )                
    Response.Write("</TR></form>" & vbCrLf )        
    Response.Write("</table>" & vbCrLf )        
End Sub
%></td>
				</tr>
				<tr>
					<td></td>
				</tr>
			</table>　</td>
				</tr>

			</table>
			</td>
		</tr>
	</table>
</div>
<!--#include file=webfoot.asp-->