<!--#include file="inc/conn.asp"-->
<%
response.expires = 0
response.expiresabsolute = now() - 0
response.addHeader "pragma","no-cache"
response.addHeader "cache-control","private"
Response.CacheControl = "no-cache"

const advertlistnumber=24

set rs=server.createobject("adodb.recordset")
sql="Select * from [dlxf_ads] where dlxf_act=1 and dlxf_class <> 0 order by dlxf_time"
rs.open sql,conn,1,3

while not rs.eof

advertvirtualvalue=0

if rs("dlxf_class")=1 then
if rs("dlxf_click")>=rs("dlxf_clicks") then
advertvirtualvalue=1
end if

elseif rs("dlxf_class")=2 then
if rs("dlxf_show")>=rs("dlxf_shows") then
advertvirtualvalue=1
end if

elseif rs("dlxf_class")=3 then
if date()>=rs("dlxf_lasttime") then
advertvirtualvalue=1
end if

elseif rs("dlxf_class")=4 then
if rs("dlxf_click")>=rs("dlxf_clicks") then
advertvirtualvalue=1
end if
if rs("dlxf_show")>=rs("dlxf_shows") then
advertvirtualvalue=1
end if

elseif rs("dlxf_class")=5 then
if rs("dlxf_click")>=rs("dlxf_clicks") then
advertvirtualvalue=1
end if
if date()>=rs("dlxf_lasttime") then
advertvirtualvalue=1
end if

elseif rs("dlxf_class")=6 then
if rs("dlxf_show")>=rs("dlxf_shows") then
advertvirtualvalue=1
end if
if date()>=rs("dlxf_lasttime") then
advertvirtualvalue=1
end if

elseif rs("dlxf_class")=7 then
if rs("dlxf_click")>=rs("dlxf_clicks") then
advertvirtualvalue=1
end if
if rs("dlxf_show")>=rs("dlxf_shows") then
advertvirtualvalue=1
end if
if date()>=rs("dlxf_lasttime") then
advertvirtualvalue=1
end if
end if



if advertvirtualvalue>=1 then
rs("dlxf_act")=2
rs.update
end if
rs.movenext
wend
rs.close
set rs=nothing 

getprice=request.querystring("priceid")
getplace=cint(request.querystring("place"))
set rs=server.createobject("adodb.recordset")
sql="Select top 1 * from [dlxf_ads] where dlxf_act=1 and dlxf_place="&getplace&" and dlxf_priceid="&getprice&" order by dlxf_time"
rs.open sql,conn,1,3
if not rs.eof then
getshow=rs("dlxf_show")+1
rs("dlxf_show")=getshow
rs("dlxf_time")=now()
rs.Update


if rs("dlxf_window")=0 then
ttarg = "_blank"
else
ttarg="_top"
end if
if rs("dlxf_showtype")="i" then
'===========================
viewads="<a title=""支持本站请点击本站广告！"" href="&cityurl&"adsurl.asp?id="&rs("dlxf_id")&" target="&ttarg&"><img border=0 width="&rs("dlxf_width")&" height="&rs("dlxf_height")&" src="&rs("dlxf_gif_url")&"></a>"
%>

document.write('<%=viewads%>');

<%
elseif rs("dlxf_showtype")="f" then
%>
document.write('<embed src=\"<%=rs("dlxf_gif_url")%>\" quality=high pluginspage=\"http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash\" type=\"application/x-shockwave-flash\" width=<%=rs("dlxf_width")%> height=<%=rs("dlxf_height")%>></embed>');
<%
else
%>
document.write('');
<%
end if

end if
rs.close
set rs=nothing 
set conn=nothing
%>