%
w_h_admin
dim add,mixid,maxid,rs
if request("add")<>"" then
add="AdAdd='"&request("add")&"' and "
else
add="AdAdd='' and "
end if
sql="Select * from Ad where "&add&" checked=1"
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,3,1
if rs.bof or rs.eof then
response.write "document.write('
ÉÐ ÎÞ ¹ã ¸æ ͼ Ƭ
');"
response.end
rs.close
else
rs.movefirst
minid=rs("id")
rs.movelast
maxid=rs("id")
rs.close
randomize
x=fix((maxid-minid+1)*rnd)+minid
sql = "Select * From ad where "&add&" id="&x&" and checked=1"
rs.Open sql,conn, 1,3
if rs.bof or rs.eof then
rs.close
sql="Select * From ad where "&add&" checked=1"
rs.Open sql,conn, 3,1
rs.movefirst
showad
else
showad
end if
rs.close
end if
set rs=nothing
conn.close
set conn=nothing
sub showad
if rs("adwidth")<>0 then adwidth=" width="&rs("adwidth")
if rs("adheight")<>0 then adheight=" height="&rs("adheight")
if rs("isflash")=1 then
response.write ("document.write('');")
else
response.write ("document.write('
');")
response.end
end if
end sub
%>