% response.buffer="true" %>
<%
'######################################
'######################################
'### Sistema Criado por Lucas R. ###
'### ICQ: 176038617 ###
'### MSN: lucasruinas@hotmail.com ###
'### POWERED BY --== RUINAS ==-- ###
'######################################
'######################################
AbreConexao
'Selecionar os Banner com numero de impressões menor que o maximo.
SQL = "select Count(idbanner)AS total_banner from Banners where impressoes < max_imp "
Set rs = conexao.execute(SQL)
total = FormatNumber(rs("total_banner"),0)
if total <> 0 Then 'IF DO NUMERO DE BANNER <> 0
Randomize Time
RNDbanner = int(RND * total)
'Selecionar o banner a ser mostrado
SQL = "select * from Banners where impressoes < max_imp "
Set rs = conexao.execute(SQL)
Rs.Move RNDbanner
If rs("html") = true Then
response.write rs("cod_html")
else
response.write ""
response.write ""
End if
SQL = "update Banners set impressoes = impressoes + 1 Where idbanner = "& rs("idbanner")
Set rs = conexao.execute(SQL)
END IF 'END IF DO IF NUMERO DE BANNER <> 0
%>