
<!--#include file="../inc/Conn.asp"-->
<!--#include file="../inc/base64.asp"-->
<!--#include file="../inc/Function.asp"-->
<%
'*****************************************
' 作者：guke
' QQ：6692103
' http://www.my478.com
'*****************************************
Dim XH_Post,XH_In,XH_Inf,XH_Xh 
'自定义需要过滤的字串,用 "|" 分隔     ## 防注入 ##
XH_In = "<|>|(script)|on(mouseover|mouseon|mouseout|click|dblclick|blur|focus|change)|src|'|eval|\t|and|="
XH_Inf = split(XH_In,"|") 
For Each XH_Post In Request.Form 
For XH_Xh=0 To Ubound(XH_Inf) 
If Instr(LCase(Request.Form(XH_Post)),XH_Inf(XH_Xh))<>0 Then 
Response.End 
End If 
Next 
Next

function RemoveHTML(fString)
  dim   re   
  set   re   =   New   RegExp   
  re.Global   =   True   
  re.IgnoreCase   =   True   
  if   not   isnull(fString)   then   
  re.Pattern   =   "<(.[^>]*)>"   
  fString   =   re.Replace(fString,"") 
   fString   =  Replace(fString,"&nbsp;","")  
  RemoveHTML   =   fString   
  end   if 
end function

function cutstr(tempstr,tempwid)
if len(tempstr)>tempwid then
cutstr=left(tempstr,tempwid)&"..."
else
cutstr=tempstr
end if
end function

Dim last,amount
response.charset = "gb2312"
last = request.form("last")
amount = request.form("amount")
Theme = request("Theme")
Area = request("Area")
otype = request("otype")
keys = request("keys")

str_order=""
if Theme<>0 and Theme<>"" and keys="" then
str_sql=str_sql&" and Dream_Theme in (select id from Dream_Theme where Dream_Classid="&Theme&" or id="&Theme&")"
end if

if Area<>0 and Area<>"" and keys="" then
str_sql=str_sql&" and Dream_Area in (select id from Dream_Area where Dream_Classid="&Area&" or id="&Area&")"
end if

if keys<>0 and keys<>"" then
str_sql=str_sql&" and Dream_Title like '%"&keys&"%'"
end if

str_sql=str_sql&" and Dream_Mzk=true "

select case otype
case 1
str_order="Dream_OrderID desc,id desc"
case 2
str_order="Dream_OrderID desc,Dream_Elite asc,Dream_EliteTime desc,id desc"
case 3
str_order="Dream_OrderID desc,Dream_Hot asc,Dream_HotTime desc,id desc"
case 4
str_order="Dream_OrderID desc,Dream_New asc,Dream_NewTime desc,id desc"
case 5
str_order="Dream_OrderID desc,Dream_Choice asc,Dream_ChoiceTime desc,id desc"
case else
str_order="Dream_OrderID desc,id desc"
end select
 


if last="" or amount="" then
Response.End
end if

i=0
set rs=server.createobject("adodb.recordset")
if last=0 then
sql="select top "&amount&" * from [Dream_Menpiao] where id<>0 "&str_sql&" order by "&str_order
else
sql="select top "&amount&" * from [Dream_Menpiao] where id<>0 "&str_sql&" and id not in (select top "&last&" id from [Dream_Menpiao] where id<>0 "&str_sql&" order by "&str_order&") order by "&str_order
end if
rs.open sql,conn,1,1
if rs.eof then
Response.End
else
response.write "["
do while not rs.eof
icon=""
if rs("Dream_Elite")=true then
icon=icon&"<b class=icon1></b>"
end if
if rs("Dream_New")=true then
icon=icon&"<b class=icon3></b>"
end if
if rs("Dream_Hot")=true then
icon=icon&"<b class=icon2></b>"
end if
if rs("Dream_Choice")=true then
icon=icon&"<b class=icon4></b>"
end if

if rs("Dream_Mzk")=true then
icon=icon&"<b class=icon5></b>"
end if


if rs("Dream_DefaultPicUrl")<>"" then
DefaultPicUrl=rs("Dream_DefaultPicUrl")
else
DefaultPicUrl="/../m_images/nopic.jpg"
end if

if rs("Dream_Phone")<>"" then
Dream_Phone="<a href=tel:"&rs("Dream_Phone")&" class=tel>"&rs("Dream_Phone")&"</a>"
else
Dream_Phone"<a href=tel:"&Dream_Phone&" class=tel>"&Dream_Phone&"</a>"
end if

if rs("Dream_Address")<>"" then
Dream_Address="<a href="&rs("Dream_MapUrl")&" target=_blank class=add>"&rs("Dream_Address")&"</a>"
else
Dream_Address=""
end if


if i=0 then
response.write "{""url"":""view.asp?cid="&rs("Dream_Theme")&"&id="&rs("id")&""",""new_mplist_img"":"""&DefaultPicUrl&""",""new_mplist_t"":""<a href=view.asp?cid="&rs("Dream_Theme")&"&id="&rs("id")&">"&rs("Dream_Title")&"</a>"",""new_mplist_con"":"" "",""new_mplist_tel"":"""&Dream_Address&Dream_Phone&""",""new_mplist_icon"":"""&icon&"""}"
else
response.write ",{""url"":""view.asp?cid="&rs("Dream_Theme")&"&id="&rs("id")&""",""new_mplist_img"":"""&DefaultPicUrl&""",""new_mplist_t"":""<a href=view.asp?cid="&rs("Dream_Theme")&"&id="&rs("id")&">"&rs("Dream_Title")&"</a>"",""new_mplist_con"":"" "",""new_mplist_tel"":"""&Dream_Address&Dream_Phone&""",""new_mplist_icon"":"""&icon&"""}"
end if
i=i+1
rs.movenext
loop
end if
response.write "]"
rs.close
%>