<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file="../inc/config.asp"-->
<!--#include file="../inc/conn.asp"-->
<%
'''''''''''''''''''''''''''''''''''''''''''''''
Response.buffer=true
Response.Expires = -1
Response.ExpiresAbsolute = Now() - 1
Response.Expires = 0
Response.CacheControl = "no-cache"
'''''''''''''''''''''''''''''''''''''''''''''''
response.Charset="gb2312"
response.ContentType="text/xml"
dim currentpage,totalpage,totalnum,recpage,urls,listtitle,sql,rs
recpage=15
dim lptypeid,lpareaid,lpeduarea,f_priceS,f_priceE,f_status,Key,bounds,barr
if(request.QueryString("page")<>"") then
	currentpage=Clng(request.QueryString("page"))
else
	currentpage=1
end if

if(request.QueryString("f_priceS")<>"") then
	f_priceS=Clng(request.QueryString("f_priceS"))
else
	f_priceS=0
end if
if(request.QueryString("f_priceE")<>"") then
	f_priceE=Clng(request.QueryString("f_priceE"))
else
	f_priceE=0
end if

if(request.QueryString("f_status")<>"") then
	f_status=Cint(request.QueryString("f_status"))
else
	f_status=0
end if
Key=request.QueryString("Key")
Key=replace(Key,"'","")
bounds=request.QueryString("bounds")
if(bounds<>"") then
	bounds=replace(bounds,"'","")
	barr=split(bounds,",")
end if
sql="select  id,Title,Lat,Lng,Stars from t_hotel where 1=1"
'Ìõ¼þÅÐ¶Ï
if isarray(barr) then
	sql=sql&" and Lat>"&barr(0)&" and Lat<"&barr(2)
	sql=sql&" and Lng>"&barr(1)&" and Lng<"&barr(3)
end if
if(f_priceS>=0 and f_priceE>f_priceS) then
	sql=sql&" and f_price>="&f_priceS&" and f_price<="&f_priceE
end if					
sql=sql&" order by id desc"
Set rs = Conn.Execute(sql)
response.Write("<?xml version=""1.0"" encoding =""utf-8""?>"&Chr(13))
response.Write("<root>"&Chr(13))
do while Not rs.Eof
	response.Write("<hotel id="""&rs(0)&""" title="""&rs(1)&"""  lat="""&rs(2)&""" lng="""&rs(3)&""" stars="""&rs(4)&""" />"&Chr(13))	
	rs.movenext
loop
response.Write("</root>"&Chr(13))
rs.close
set rs=nothing
call connclose()
function replaceBadChar(str)
	dim returnStr
	returnStr=str
	if(returnStr<>"") then
		returnStr=replace(returnStr,"'","")
		returnStr= Replace(returnStr,"&","&amp;")
		returnStr= Replace(returnStr,"<","&lt;")
		returnStr= Replace(returnStr,">","&gt;")
	end if
	replaceBadChar=returnStr
end function
%>