Ir para conteúdo

Arquivado

Este tópico foi arquivado e está fechado para novas respostas.

Dr. admin

notificar ao usuário que a busca não a registros

Recommended Posts

Olha meu problema é o seguinte eu tenho uma página que mostra uma agenda, o usuário pode filtrar o mês para ele ver os eventos que aconteceu

em determinado mês, mas quando o usuário filtra um mês que não há registros eu quero que mostre uma mensagem falando que não foi encontrado registros.

 

eu ja testei e a página funciona se eu trirar um trecho do código da paginação ai funciona.

 

vou postar a página............

 

agenda.asp?mes=13

CODE

<%

Option Explicit

%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">

 

<%

DIM conexao 'variavel sa conexao

DIM rsMenu, rsMenuloja, rsMenuUtilidades, rsMenuCampanhas, rsNoticias, rsAgenda 'variáveis Recordsets

DIM sql_menu, sql_loja, sql_Utilidades, sql_Campanhas, sql_Noticias, strSQL 'instruções sql

DIM PagAtual, TotalPages, Count, i, cor, max_n_mostrados, intervalo, inicio, final ' variáveis de paginação

DIM Mes

 

PagAtual = Request.QueryString("PagAtual") 'página atual

mes = request.querystring("busca") 'filtra o mes que o usuário ecolheu

 

Call AbreConexao 'abre conexão

 

'selects

sql_menu = "select * from menu where categoria='menu' order by orden asc "

sql_loja = "select * from menu where categoria='loja virtual' order by nome asc "

sql_Utilidades = "select * from menu where categoria='Utilidades' order by nome asc "

sql_Campanhas = "select * from menu where categoria='Campanhas' order by nome asc "

sql_Noticias = "select top 5 * from noticias order by noticia_id desc "

 

select case request.QueryString("mes") 'seleciona e filtra o mes que o usuário ecolheu

 

case 01

strSQL = "select data,hora,igreja,cidade,estado,pais,evento,pastor,endereco FROM agenda WHERE data BETWEEN '01/01/2008' and '31/01/2008' ORDER BY data DESC, hora DESC "

 

case 02

strSQL = "select data,hora,igreja,cidade,estado,pais,evento,pastor,endereco FROM agenda WHERE data BETWEEN '01/02/2008' and '29/02/2008' ORDER BY data DESC, hora DESC "

 

case 03

strSQL = "select data,hora,igreja,cidade,estado,pais,evento,pastor,endereco FROM agenda WHERE data BETWEEN '01/03/2008' and '31/03/2008' ORDER BY data DESC, hora DESC "

 

case 04

strSQL = "select data,hora,igreja,cidade,estado,pais,evento,pastor,endereco FROM agenda WHERE data BETWEEN '01/04/2008' and '30/04/2008' ORDER BY data DESC, hora DESC "

 

case 05

strSQL = "select data,hora,igreja,cidade,estado,pais,evento,pastor,endereco FROM agenda WHERE data BETWEEN '01/05/2008' and '31/05/2008' ORDER BY data DESC, hora DESC "

 

case 06

strSQL = "select data,hora,igreja,cidade,estado,pais,evento,pastor,endereco FROM agenda WHERE data BETWEEN '01/06/2008' and '30/06/2008' ORDER BY data DESC, hora DESC "

 

case 07

strSQL = "select data,hora,igreja,cidade,estado,pais,evento,pastor,endereco FROM agenda WHERE data BETWEEN '01/07/2008' and '31/07/2008' ORDER BY data DESC, hora DESC "

 

case 08

strSQL = "select data,hora,igreja,cidade,estado,pais,evento,pastor,endereco FROM agenda WHERE data BETWEEN '01/08/2008' and '31/08/2008' ORDER BY data DESC, hora DESC "

 

case 09

strSQL = "select data,hora,igreja,cidade,estado,pais,evento,pastor,endereco FROM agenda WHERE data BETWEEN '01/09/2008' and '30/09/2008' ORDER BY data DESC, hora DESC "

 

case 10

strSQL = "select data,hora,igreja,cidade,estado,pais,evento,pastor,endereco FROM agenda WHERE data BETWEEN '01/10/2008' and '31/10/2008' ORDER BY data DESC, hora DESC "

 

case 11

strSQL = "select data,hora,igreja,cidade,estado,pais,evento,pastor,endereco FROM agenda WHERE data BETWEEN '01/11/2008' and '30/11/2008' ORDER BY data DESC, hora DESC "

 

case 12

strSQL = "select data,hora,igreja,cidade,estado,pais,evento,pastor,endereco FROM agenda WHERE data BETWEEN '01/12/2008' and '31/12/2008' ORDER BY data DESC, hora DESC "

 

case 13

strSQL = "select data,hora,igreja,cidade,estado,pais,evento,pastor,endereco FROM agenda ORDER BY data DESC, hora DESC "

 

End Select

 

SET rsMenu = conexao.execute(sql_menu)

SET rsMenuloja = conexao.execute(sql_loja)

SET rsMenuUtilidades = conexao.execute(sql_Utilidades)

SET rsMenuCampanhas = conexao.execute(sql_Campanhas)

SET rsNoticias = conexao.execute(sql_Noticias)

SET rsAgenda = conexao.execute(strSQL)

 

Const NumPorPage = 3 'Registros por página*******************************

'****************************************************************************

'****************************************************************************

'****************************************************************************

'****************************************************************************

'****************************************************************************

IF Request.QueryString("PagAtual") = "" Then

PagAtual = 1 'Primeira página

Else

PagAtual = Request.QueryString("PagAtual")

End If

rsAgenda.CacheSize = NumPorPage

rsAgenda.MoveFirst 'Move o RecorSet para o início

rsAgenda.PageSize = NumPorPage 'Coloca a quantidade de páginas

TotalPages = rsAgenda.PageCount

rsAgenda.AbsolutePage = PagAtual 'Configura a página atual

Count = 0 'Zera o contador

i = 0

%>

<html>

<head>

<%

Response.Charset="utf-8"

%>

<title>:: Missão Mundial Graça e Paz :: Igreja que Ama Você!</title>

<link href="css/pg_index.css" rel="stylesheet" type="text/css" />

<script src="Scripts/AC_RunActiveContent.js" type="text/javascript"></script>

 

<style type="text/css">

 

</style>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head>

<body>

<div id="divgeral">

 

 

<div id="divmeio_um">

<table width="468" border="0" align="center" cellpadding="5" cellspacing="0">

<tr>

<td><div align="center" class="style9 style10">

<script type="text/javascript">

AC_FL_RunContent( 'codebase','http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0,width,450,height,30,src,swf/texto_bemvindo,quality,high,pluginspage,http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash,wmode,transparent,movie,swf/texto_bemvindo' ); //end AC code

</script>

<noscript>

<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwa...ersion=9,0,28,0" width="450" height="30">

<param name="movie" value="swf/texto_bemvindo.swf" />

<param name="quality" value="high" />

<param name="wmode" value="transparent" />

<embed src="swf/texto_bemvindo.swf" width="450" height="30" quality="high" pluginspage="http://www.adobe.com/shockwave/download/do...=ShockwaveFlash" type="application/x-shockwave-flash" wmode="transparent"></embed>

</object>

</noscript>

</div></td>

</tr>

</table>

<br />

<br />

<form action="agenda.asp" method="get" name="form" id="form">

<table width="480" border="0" align="center" cellpadding="3" cellspacing="0" class="tabelas">

<tr>

<td width="256" bgcolor="#5D7294"><div align="left"><span class="style16"><img src="imagens/botu.jpg" alt="" width="17" height="17" align="absmiddle" /> Agenda!</span></div></td>

<td width="212" bgcolor="#5D7294"><div align="left" class="style16"><strong>Filtrar Mês:

</strong>

<select name="mes" class="titulos-boto" id="mes">

<option value="13" selected>Todos</option>

<option value="01">Janeiro</option>

<option value="02">Fevereiro</option>

<option value="03">Março</option>

<option value="04">Abril</option>

<option value="05">Maio</option>

<option value="06">Junho</option>

<option value="07">Julho</option>

<option value="08">Agosto</option>

<option value="09">Setembro</option>

<option value="10">Outubro</option>

<option value="11">Novembro</option>

<option value="12">Dezembro</option>

</select>

<input type="submit" class="bts" value="Filtrar">

</div></td>

</tr>

</table>

</form>

<br>

<table width="480px" border="0" align="center" cellpadding="3" cellspacing="0" bordercolor="#D3DBE7" class="tabelas">

<tr>

<%

if not rsAgenda.eof then

DO WHILE NOT rsAgenda.EOF And Count < rsAgenda.PageSize 'paginacao And Count < RS.PageSize

if i mod 2<>0 then

cor = "#F4F4F4"

else

cor = "#e1e1e1"

end if

%>

<td colspan="2" bgcolor="#D6DBE7"><span class="style18">Data: 

<% = rsAgenda("data") %>

 - Hora: 

<% = rsAgenda("hora") %>

</span></td>

</tr>

<tr>

<td width="17%" bordercolor="#FFFFFF" bgcolor="#D6DBE7"><span class="style20">Igreja:</span></td>

<td width="83%" bordercolor="#D3DBE7" bgcolor="#D6DBE7"><div align="left">

<input type="text" readonly="true" class="cxmostratxt" value="<% = rsAgenda("igreja") %>" size="45" maxlength="255">

</div></td>

</tr>

<tr>

<td bordercolor="#FFFFFF" bgcolor="#D6DBE7"><span class="style20">Evento:</span></td>

<td bordercolor="#D3DBE7" bgcolor="#D6DBE7"><div align="left">

 

<input type="text" class="cxmostratxt" readonly="true" value="<% = rsAgenda("evento") %>" size="45" maxlength="255">

</div></td>

</tr>

<tr>

<td bordercolor="#FFFFFF" bgcolor="#D6DBE7"><span class="style20">Pastor:</span></td>

<td bordercolor="#D3DBE7" bgcolor="#D6DBE7"><div align="left">

 

<input type="text" class="cxmostratxt" readonly="true" value="<% = rsAgenda("pastor") %>" size="45" maxlength="255">

</div></td>

</tr>

<tr>

<td bordercolor="#FFFFFF" bgcolor="#D6DBE7"><span class="style20">Endereço:</span></td>

<td bordercolor="#D3DBE7" bgcolor="#D6DBE7"><div align="left">

 

<input type="text" readonly="true" class="cxmostratxt" value="<% = rsAgenda("endereco") %>" size="45" maxlength="255">

</div></td>

</tr>

<tr>

<td bordercolor="#FFFFFF" bgcolor="#D6DBE7"><span class="style20">Cidade:</span></td>

<td bordercolor="#D3DBE7" bgcolor="#D6DBE7"><div align="left">

 

<input type="text" readonly="true" class="cxmostratxt" value="<% = rsAgenda("cidade") %>" size="45" maxlength="255">

</div></td>

</tr>

<tr>

<td bordercolor="#FFFFFF" bgcolor="#D6DBE7"><span class="style20">Estado:</span></td>

<td bordercolor="#D3DBE7" bgcolor="#D6DBE7"><div align="left">

<input readonly="true" type="text" class="cxmostratxt" value="<% = rsAgenda("estado") %>" size="45" maxlength="255">

</div></td>

</tr>

<tr bordercolor="#FFFFFF">

<td bgcolor="#D6DBE7"><span class="style20">País:</span></td>

<td bordercolor="#D3DBE7"><div align="left">

<input readonly="true" type="text" class="cxmostratxt" value="<% = rsAgenda("pais") %>" size="45" maxlength="255">

</div></td>

</tr>

<%

i = i+1

Count = Count + 1 'paginacao

rsAgenda.MoveNext

loop 'tb paginacao

else

response.write "<b>Nenhum registro foi encontrado</b>."

end if

%>

<tr>

<td bordercolor="#D3DBE7"> </td>

</tr>

</table>

<table width="480" align="center" class="tabelas">

<tr>

<td colspan="2" align="left">

<%

'################## paginacao 01 #####################

 

'Coloca o Nº página atual / Nº Total de páginas

 

Response.Write("<strong>Página</strong> " & PagAtual & " <strong>de</strong> " & TotalPages & " - ")

 

'Mostra os botões: Anterior e Próxima, utilizando da opção de IF

 

IF PagAtual > 1 THEN

 

'Se for a primeira página, Mostra apenas o botão Próximo e Ultima

Response.Write("<B><font color=""#000000"">")

Response.Write("<a href='agenda.asp?PagAtual=" & 1 & "&mes=" & request.QueryString("mes") & "'>")

Response.Write("Primeira")

Response.Write("</a></font></B> ")

 

Response.Write("<B><font color=""#000000"">")

Response.Write("<a href='agenda.asp?PagAtual=" & PagAtual - 1 & "&mes=" & request.QueryString("mes") & "'>")

Response.Write("Anterior")

Response.Write("</a></font></B> ")

Else

 

Response.Write("<B><font color=""#D6DBE7"" size=""1"" face=""Arial"">")

Response.Write("")

Response.Write("</font></B> ")

 

Response.Write("<B><font color=""#D6DBE7"" size=""2"" face=""Arial"">")

Response.Write("")

Response.Write("</font></B> ")

 

 

End If

 

'------------------- numero -------------------------

'---------- Numero de numeros para ser mostrados ----

max_n_mostrados = 9

 

intervalo = Int(max_n_mostrados /2)

inicio = PagAtual - intervalo

final = PagAtual + intervalo

 

If CInt(inicio) <1 Then

inicio = 1

final = 10

END IF

If CInt(final) > CInt(TotalPages) Then final = TotalPages

 

For i = inicio To final

If CInt(i)=CInt(PagAtual) Then

Response.Write "<font color=""#660066"" size=""1"" face=""Arial"">[ <B>" & i & "</B> <font color=""#660066"">]</font> "

END IF

If CInt(i) < CInt(PagAtual) Then

Response.Write "<a href='agenda.asp?PagAtual=" & i & "&mes=" & request.QueryString("mes") & "'>" & i & "</a> "

END IF

If CInt(i) > CInt(PagAtual) Then

Response.Write "<a href='agenda.asp?PagAtual=" & i & "&mes=" & request.QueryString("mes") & "'>" & i & "</a> "

END IF

Next

 

'------------------------------------------------------

 

IF CInt(PagAtual) <> CInt(TotalPages) THEN

 

'Se estiver na última página, mostra apenas o botão Anterior e Primeira

 

Response.Write("<B><font color=""#D6DBE7"" size=""2"" face=""Arial"">")

Response.Write("<a href='agenda.asp?PagAtual=" & PagAtual + 1 & "&mes=" & request.QueryString("mes") & "'>")

Response.Write("Próxima")

Response.Write("</a></font></B> ")

 

Response.Write("<B><font color=""#D6DBE7"" size=""1"" face=""Arial"">")

Response.Write("<a href='agenda.asp?PagAtual=" & TotalPages & "&mes=" & request.QueryString("mes") & "'>")

Response.Write("Ultima")

Response.Write("</a></font></B> ")

 

Else

Response.Write("<B><font color=""#D6DBE7"" size=""2"" face=""Arial"">")

Response.Write("Próxima")

Response.Write("</font></B> ")

 

Response.Write("<B><font color=""#D6DBE7"" size=""1"" face=""Arial"">")

Response.Write("Ultima")

Response.Write("</font></B> ")

End If

'################## fim paginacao 01 ########################

%></td>

</tr>

</table>

<br />

<br />

<br />

<br />

 

<p><br />

</p>

</div>

 

 

</div>

</body>

</html>

<%

rsMenuloja.close

rsMenu.close

rsMenuUtilidades.close

rsMenuCampanhas.close

rsNoticias.close

rsAgenda.close

Call FechaConexao

Set rsMenuloja = nothing

Set rsMenu = nothing

Set rsMenuUtilidades = nothing

Set rsMenuCampanhas = nothing

Set rsNoticias = nothing

Set rsAgenda = nothing

%>

 

agora vou colocar o trecho do código que tirando da página o aviso é mostrado que não há registros.

 

CODE

rsAgenda.CacheSize = NumPorPage

rsAgenda.MoveFirst 'Move o RecorSet para o início

rsAgenda.PageSize = NumPorPage 'Coloca a quantidade de páginas

TotalPages = rsAgenda.PageCount

rsAgenda.AbsolutePage = PagAtual 'Configura a página atual

como é que eu faço para resolver esse problema???

 

não posso tirar esse trecho de código pois se não a paginação não vai funcionar, o que eu faço???

por favor me ajudem.

Compartilhar este post


Link para o post
Compartilhar em outros sites

Coloque esse trecho do código mais perto do seu laço de repetição e "abrace" com o IF que verifica se tem dados no RecordSet.

 

Testa e retorne se funcionou.

Compartilhar este post


Link para o post
Compartilhar em outros sites

Muito obrigado mais uma vez salgado............

o Problema foi resolvido eu peguei o trecho do código e coloquei antes do DO WHILE..........

e para não mostrar a paginação, tipo página 1,próxima, ultima e etc da paginação eu coloquei o código da notificação em baixo

das instruções do loop............

 

vou postar o código da página alterado.............

 

lembrando galera que a primeira linha ai da página que declara a linguagem, eu tirei para poder postar o código aqui no forum,

pois se não iria dar erro............

 

CODE

<%

Option Explicit

%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">

<!--#Include file="conexao/conexao_sql.asp"-->

<%

DIM conexao 'variavel sa conexao

DIM rsMenu, rsMenuloja, rsMenuUtilidades, rsMenuCampanhas, rsNoticias, rsAgenda 'variáveis Recordsets

DIM sql_menu, sql_loja, sql_Utilidades, sql_Campanhas, sql_Noticias, strSQL 'instruções sql

DIM PagAtual, TotalPages, Count, i, cor, max_n_mostrados, intervalo, inicio, final ' variáveis de paginação

DIM Mes

 

PagAtual = Request.QueryString("PagAtual") 'página atual

mes = request.querystring("busca") 'filtra o mes que o usuário ecolheu

 

Call AbreConexao 'abre conexão

 

'selects

sql_menu = "select * from menu where categoria='menu' order by orden asc "

sql_loja = "select * from menu where categoria='loja virtual' order by nome asc "

sql_Utilidades = "select * from menu where categoria='Utilidades' order by nome asc "

sql_Campanhas = "select * from menu where categoria='Campanhas' order by nome asc "

sql_Noticias = "select top 5 * from noticias order by noticia_id desc "

 

select case request.QueryString("mes") 'seleciona e filtra o mes que o usuário ecolheu

 

case 01

strSQL = "select data,hora,igreja,cidade,estado,pais,evento,pastor,endereco FROM agenda WHERE data BETWEEN '01/01/2008' and '31/01/2008' ORDER BY data DESC, hora DESC "

 

case 02

strSQL = "select data,hora,igreja,cidade,estado,pais,evento,pastor,endereco FROM agenda WHERE data BETWEEN '01/02/2008' and '29/02/2008' ORDER BY data DESC, hora DESC "

 

case 03

strSQL = "select data,hora,igreja,cidade,estado,pais,evento,pastor,endereco FROM agenda WHERE data BETWEEN '01/03/2008' and '31/03/2008' ORDER BY data DESC, hora DESC "

 

case 04

strSQL = "select data,hora,igreja,cidade,estado,pais,evento,pastor,endereco FROM agenda WHERE data BETWEEN '01/04/2008' and '30/04/2008' ORDER BY data DESC, hora DESC "

 

case 05

strSQL = "select data,hora,igreja,cidade,estado,pais,evento,pastor,endereco FROM agenda WHERE data BETWEEN '01/05/2008' and '31/05/2008' ORDER BY data DESC, hora DESC "

 

case 06

strSQL = "select data,hora,igreja,cidade,estado,pais,evento,pastor,endereco FROM agenda WHERE data BETWEEN '01/06/2008' and '30/06/2008' ORDER BY data DESC, hora DESC "

 

case 07

strSQL = "select data,hora,igreja,cidade,estado,pais,evento,pastor,endereco FROM agenda WHERE data BETWEEN '01/07/2008' and '31/07/2008' ORDER BY data DESC, hora DESC "

 

case 08

strSQL = "select data,hora,igreja,cidade,estado,pais,evento,pastor,endereco FROM agenda WHERE data BETWEEN '01/08/2008' and '31/08/2008' ORDER BY data DESC, hora DESC "

 

case 09

strSQL = "select data,hora,igreja,cidade,estado,pais,evento,pastor,endereco FROM agenda WHERE data BETWEEN '01/09/2008' and '30/09/2008' ORDER BY data DESC, hora DESC "

 

case 10

strSQL = "select data,hora,igreja,cidade,estado,pais,evento,pastor,endereco FROM agenda WHERE data BETWEEN '01/10/2008' and '31/10/2008' ORDER BY data DESC, hora DESC "

 

case 11

strSQL = "select data,hora,igreja,cidade,estado,pais,evento,pastor,endereco FROM agenda WHERE data BETWEEN '01/11/2008' and '30/11/2008' ORDER BY data DESC, hora DESC "

 

case 12

strSQL = "select data,hora,igreja,cidade,estado,pais,evento,pastor,endereco FROM agenda WHERE data BETWEEN '01/12/2008' and '31/12/2008' ORDER BY data DESC, hora DESC "

 

case 13

strSQL = "select data,hora,igreja,cidade,estado,pais,evento,pastor,endereco FROM agenda ORDER BY data DESC, hora DESC "

 

End Select

 

SET rsMenu = conexao.execute(sql_menu)

SET rsMenuloja = conexao.execute(sql_loja)

SET rsMenuUtilidades = conexao.execute(sql_Utilidades)

SET rsMenuCampanhas = conexao.execute(sql_Campanhas)

SET rsNoticias = conexao.execute(sql_Noticias)

SET rsAgenda = conexao.execute(strSQL)

 

Const NumPorPage = 3 'Registros por página*******************************

'****************************************************************************

'****************************************************************************

'****************************************************************************

'****************************************************************************

'****************************************************************************

IF Request.QueryString("PagAtual") = "" Then

PagAtual = 1 'Primeira página

Else

PagAtual = Request.QueryString("PagAtual")

End If

%>

<html>

<head>

<%

Response.Charset="utf-8"

%>

<title>:: Missão Mundial Graça e Paz :: Igreja que Ama Você!</title>

<link href="css/pg_index.css" rel="stylesheet" type="text/css" />

<script src="Scripts/AC_RunActiveContent.js" type="text/javascript"></script>

 

<style type="text/css">

<!--

.style16 {color: #FFFFFF}

.style18 {color: #5D7294}

a {

font-family: Verdana, Arial, Helvetica, sans-serif;

font-size: 9px;

color: #000000;

}

a:visited {

color: #000000;

}

a:hover {

color: #000000;

font-weight: bold;

}

a:active {

color: #000000;

}

.style20 {color: #000000; font-weight: bold; }

-->

</style>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head>

<body>

<div id="divgeral">

<!--#Include file="inc/topo.asp"-->

<!--#Include file="inc/botoes.asp"-->

<div id="divmeio_um">

<table width="468" border="0" align="center" cellpadding="5" cellspacing="0">

<tr>

<td><div align="center" class="style9 style10">

<script type="text/javascript">

AC_FL_RunContent( 'codebase','http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0,width,450,height,30,src,swf/texto_bemvindo,quality,high,pluginspage,http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash,wmode,transparent,movie,swf/texto_bemvindo' ); //end AC code

</script>

<noscript>

<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwa...ersion=9,0,28,0" width="450" height="30">

<param name="movie" value="swf/texto_bemvindo.swf" />

<param name="quality" value="high" />

<param name="wmode" value="transparent" />

<embed src="swf/texto_bemvindo.swf" width="450" height="30" quality="high" pluginspage="http://www.adobe.com/shockwave/download/do...=ShockwaveFlash" type="application/x-shockwave-flash" wmode="transparent"></embed>

</object>

</noscript>

</div></td>

</tr>

</table>

<br />

<br />

<form action="agenda.asp" method="get" name="form" id="form">

<table width="480" border="0" align="center" cellpadding="3" cellspacing="0" class="tabelas">

<tr>

<td width="256" bgcolor="#5D7294"><div align="left"><span class="style16"><img src="imagens/botu.jpg" alt="" width="17" height="17" align="absmiddle" /> Agenda!</span></div></td>

<td width="212" bgcolor="#5D7294"><div align="left" class="style16"><strong>Filtrar Mês:

</strong>

<select name="mes" class="titulos-boto" id="mes">

<option value="13" selected>Todos</option>

<option value="01">Janeiro</option>

<option value="02">Fevereiro</option>

<option value="03">Março</option>

<option value="04">Abril</option>

<option value="05">Maio</option>

<option value="06">Junho</option>

<option value="07">Julho</option>

<option value="08">Agosto</option>

<option value="09">Setembro</option>

<option value="10">Outubro</option>

<option value="11">Novembro</option>

<option value="12">Dezembro</option>

</select>

<input type="submit" class="bts" value="Filtrar">

</div></td>

</tr>

</table>

</form>

<br>

<table width="480px" border="0" align="center" cellpadding="3" cellspacing="0" bordercolor="#D3DBE7" class="tabelas">

<tr>

<%

if not rsAgenda.eof then

rsAgenda.CacheSize = NumPorPage

rsAgenda.MoveFirst 'Move o RecorSet para o início

rsAgenda.PageSize = NumPorPage 'Coloca a quantidade de páginas

TotalPages = rsAgenda.PageCount

rsAgenda.AbsolutePage = PagAtual 'Configura a página atual

Count = 0 'Zera o contador

i = 0

DO WHILE NOT rsAgenda.EOF And Count < rsAgenda.PageSize 'paginacao And Count < RS.PageSize

if i mod 2<>0 then

cor = "#F4F4F4"

else

cor = "#e1e1e1"

end if

%>

<td colspan="2" bgcolor="#D6DBE7"><span class="style18">Data: 

<% = rsAgenda("data") %>

 - Hora: 

<% = rsAgenda("hora") %>

</span></td>

</tr>

<tr>

<td width="17%" bordercolor="#FFFFFF" bgcolor="#D6DBE7"><span class="style20">Igreja:</span></td>

<td width="83%" bordercolor="#D3DBE7" bgcolor="#D6DBE7"><div align="left">

<input type="text" readonly="true" class="cxmostratxt" value="<% = rsAgenda("igreja") %>" size="45" maxlength="255">

</div></td>

</tr>

<tr>

<td bordercolor="#FFFFFF" bgcolor="#D6DBE7"><span class="style20">Evento:</span></td>

<td bordercolor="#D3DBE7" bgcolor="#D6DBE7"><div align="left">

 

<input type="text" class="cxmostratxt" readonly="true" value="<% = rsAgenda("evento") %>" size="45" maxlength="255">

</div></td>

</tr>

<tr>

<td bordercolor="#FFFFFF" bgcolor="#D6DBE7"><span class="style20">Pastor:</span></td>

<td bordercolor="#D3DBE7" bgcolor="#D6DBE7"><div align="left">

 

<input type="text" class="cxmostratxt" readonly="true" value="<% = rsAgenda("pastor") %>" size="45" maxlength="255">

</div></td>

</tr>

<tr>

<td bordercolor="#FFFFFF" bgcolor="#D6DBE7"><span class="style20">Endereço:</span></td>

<td bordercolor="#D3DBE7" bgcolor="#D6DBE7"><div align="left">

 

<input type="text" readonly="true" class="cxmostratxt" value="<% = rsAgenda("endereco") %>" size="45" maxlength="255">

</div></td>

</tr>

<tr>

<td bordercolor="#FFFFFF" bgcolor="#D6DBE7"><span class="style20">Cidade:</span></td>

<td bordercolor="#D3DBE7" bgcolor="#D6DBE7"><div align="left">

 

<input type="text" readonly="true" class="cxmostratxt" value="<% = rsAgenda("cidade") %>" size="45" maxlength="255">

</div></td>

</tr>

<tr>

<td bordercolor="#FFFFFF" bgcolor="#D6DBE7"><span class="style20">Estado:</span></td>

<td bordercolor="#D3DBE7" bgcolor="#D6DBE7"><div align="left">

<input readonly="true" type="text" class="cxmostratxt" value="<% = rsAgenda("estado") %>" size="45" maxlength="255">

</div></td>

</tr>

<tr bordercolor="#FFFFFF">

<td bgcolor="#D6DBE7"><span class="style20">País:</span></td>

<td bordercolor="#D3DBE7"><div align="left">

<input readonly="true" type="text" class="cxmostratxt" value="<% = rsAgenda("pais") %>" size="45" maxlength="255">

</div></td>

</tr>

<%

i = i+1

Count = Count + 1 'paginacao

rsAgenda.MoveNext

loop 'tb paginacao

%>

<tr>

<td bordercolor="#D3DBE7"> </td>

</tr>

</table>

<table width="480" align="center" class="tabelas">

<tr>

<td colspan="2" align="left">

<%

'################## paginacao 01 #####################

 

'Coloca o Nº página atual / Nº Total de páginas

 

Response.Write("<strong>Página</strong> " & PagAtual & " <strong>de</strong> " & TotalPages & " - ")

 

'Mostra os botões: Anterior e Próxima, utilizando da opção de IF

 

IF PagAtual > 1 THEN

 

'Se for a primeira página, Mostra apenas o botão Próximo e Ultima

Response.Write("<B><font color=""#000000"">")

Response.Write("<a href='agenda.asp?PagAtual=" & 1 & "&mes=" & request.QueryString("mes") & "'>")

Response.Write("Primeira")

Response.Write("</a></font></B> ")

 

Response.Write("<B><font color=""#000000"">")

Response.Write("<a href='agenda.asp?PagAtual=" & PagAtual - 1 & "&mes=" & request.QueryString("mes") & "'>")

Response.Write("Anterior")

Response.Write("</a></font></B> ")

Else

 

Response.Write("<B><font color=""#D6DBE7"" size=""1"" face=""Arial"">")

Response.Write("")

Response.Write("</font></B> ")

 

Response.Write("<B><font color=""#D6DBE7"" size=""2"" face=""Arial"">")

Response.Write("")

Response.Write("</font></B> ")

 

 

End If

 

'------------------- numero -------------------------

'---------- Numero de numeros para ser mostrados ----

max_n_mostrados = 9

 

intervalo = Int(max_n_mostrados /2)

inicio = PagAtual - intervalo

final = PagAtual + intervalo

 

If CInt(inicio) <1 Then

inicio = 1

final = 10

END IF

If CInt(final) > CInt(TotalPages) Then final = TotalPages

 

For i = inicio To final

If CInt(i)=CInt(PagAtual) Then

Response.Write "<font color=""#660066"" size=""1"" face=""Arial"">[ <B>" & i & "</B> <font color=""#660066"">]</font> "

END IF

If CInt(i) < CInt(PagAtual) Then

Response.Write "<a href='agenda.asp?PagAtual=" & i & "&mes=" & request.QueryString("mes") & "'>" & i & "</a> "

END IF

If CInt(i) > CInt(PagAtual) Then

Response.Write "<a href='agenda.asp?PagAtual=" & i & "&mes=" & request.QueryString("mes") & "'>" & i & "</a> "

END IF

Next

 

'------------------------------------------------------

 

IF CInt(PagAtual) <> CInt(TotalPages) THEN

 

'Se estiver na última página, mostra apenas o botão Anterior e Primeira

 

Response.Write("<B><font color=""#D6DBE7"" size=""2"" face=""Arial"">")

Response.Write("<a href='agenda.asp?PagAtual=" & PagAtual + 1 & "&mes=" & request.QueryString("mes") & "'>")

Response.Write("Próxima")

Response.Write("</a></font></B> ")

 

Response.Write("<B><font color=""#D6DBE7"" size=""1"" face=""Arial"">")

Response.Write("<a href='agenda.asp?PagAtual=" & TotalPages & "&mes=" & request.QueryString("mes") & "'>")

Response.Write("Ultima")

Response.Write("</a></font></B> ")

 

Else

Response.Write("<B><font color=""#D6DBE7"" size=""2"" face=""Arial"">")

Response.Write("Próxima")

Response.Write("</font></B> ")

 

Response.Write("<B><font color=""#D6DBE7"" size=""1"" face=""Arial"">")

Response.Write("Ultima")

Response.Write("</font></B> ")

End If

'################## fim paginacao 01 ########################

%><%else

response.write "<b>Nenhum registro foi encontrado</b>."

end if%></td>

</tr>

</table>

<br />

<br />

<br />

<br />

<!--#Include file="inc/ultimas_noticias.asp"-->

<p><br />

</p>

</div>

<!--#Include file="inc/div_lat_direita.asp"-->

<!--#Include file="inc/barra.asp"-->

</div>

</body>

</html>

<%

rsMenuloja.close

rsMenu.close

rsMenuUtilidades.close

rsMenuCampanhas.close

rsNoticias.close

rsAgenda.close

Call FechaConexao

Set rsMenuloja = nothing

Set rsMenu = nothing

Set rsMenuUtilidades = nothing

Set rsMenuCampanhas = nothing

Set rsNoticias = nothing

Set rsAgenda = nothing

%>

Compartilhar este post


Link para o post
Compartilhar em outros sites

×

Informação importante

Ao usar o fórum, você concorda com nossos Termos e condições.