Ir para conteúdo

Arquivado

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

estranho.com

[Resolvido] Sql?

Recommended Posts

Estou com duvidas em uma pesquisa com paginação... adicionei em um código já existente um campo de pesquisa q permite fazer consultas em outros itens do banco.. só que não consigo fazer a paginação funcionar... tambem possui um erro em 2 itens que estou destacando... Se puderem me ajudar... obrigado desde já...

 

 

 

<html>
<head>
<title> Paginação </title>
<style type="text/css">
	body, td {font: 11px Tahoma; color: black;}
	A:link {font: 11px Tahoma; color: black; text-decoration: none;}
	A:hover {font: 11px Tahoma; color: #FF9900; text-decoration: none;}
	A:visited {font: 11px Tahoma; color: black; text-decoration: none;}
</style>
</head>

<body>
<%
Dim letra,letras,DSNtest,Conn,RS,pesquisa,aonde
pesquisa = Request.Querystring("pesquisa")
aonde = Request.Querystring("aonde")
PagAtual = Request.QueryString("PagAtual")
letra = Request.QueryString("Letra")
letras = "#0123456789ABCDEFGHIJKLMNOPQRSTUVXYWZ"

if pesquisa <> "" then
letra = pesquisa
end if

Set Conn= server.createobject("adodb.connection")
DSNtest = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath("dados.mdb")
Conn.Open DSNtest
Set RS= Server.CreateObject("ADODB.Recordset") 
if aonde = "Local" then
		SQL = "SELECT * FROM controle where Local =  '"&pesquisa&"'"
  else
if aonde = "Tipo" then
		SQL = "SELECT * FROM controle where Tipo LIKE '"&letra&"%' Order by Tipo ASC"
  else 
if aonde = "NTelefone" then
		SQL = "SELECT * FROM controle where NºTelefone =  '"&pesquisa&"'"
  else 
if aonde = "Data" then
		SQL = "SELECT * FROM controle where Data =  '"&pesquisa&"'"
  else 
if aonde = "Operador" then
		SQL = "SELECT * FROM controle where Operador =  '"&pesquisa&"'"
  else  
  If letra = "" Then 
		SQL = "SELECT * FROM controle" 
  Else 
	If letra = "Todas" Then 
		SQL = "SELECT * FROM controle Order by Solicitante ASC" 
	Else
		SQL = "SELECT * FROM controle WHERE Solicitante LIKE '"&letra&"%' Order by Solicitante ASC" 
	End if
  End If	 
End if 
End if 
End if
End if
End if
RS.Open SQL, conn, 3,3
If RS.EOF Then 


	For i = 1 to 36 
		Response.write("<a href=paginacao.asp?letra="&Replace(Mid(letras, i,1),"#", "Todas")&"><b>"&Replace(Mid(letras, i,1),"#", "Todas")&"</b></a>  ") 
	Next

	Response.write("<br><br><table cellpadding=""5"" width=""600"">")
	Response.write("<tr><td bgcolor=""#F0F0F0"">Nenhum registro encontrado!</td></tr>")
	Response.write("</table>")
	Response.write("</td></tr></table>")
	
Else	
Const NumPorPage = 30

   Dim PagAtual

   IF Request.QueryString("PagAtual") = "" Then
			   PagAtual = 1
		 Else
				PagAtual = Request.QueryString("PagAtual")
   End If

   RS.CacheSize = NumPorPage 

	RS.MoveFirst				
	RS.PageSize = NumPorPage   

	Dim TotalPages			  
	TotalPages = RS.PageCount

	RS.AbsolutePage = PagAtual 

Count = 0  
	Response.write("<table cellpadding=""5"" width=""600"">")
	Response.write("<tr><td align=""center"">")
 Response.write("<form name='form1' method='get' action='paginacao.asp'>")
	Response.write("<input type='text' name='pesquisa'>")
		 Response.write("          ")
	Response.write("<select name='aonde' size=""1"">")
		 Response.write("<option name=""aonde"" value='Tipo'>Tipo</option>")
		 Response.write("<option name=""aonde"" value='NTelefone'>Nº Telefone</option>")
		 [u][color="#FF0000"]'Response.write("<option name=""aonde"" value='Data'>Data</option>")[/color] [/u]
		 Response.write("<option name=""aonde"" value='Operador'>Operador</option>")
		[u] [color="#FF0000"]'Response.write("<option name=""aonde"" value='Local'>Local</option>")[/color][/u]
	 Response.write("</select>")
	 Response.write("          ")
	 Response.write("<input type='submit' name='Submit' value='Pesquisar'><br>")
	 Response.write("</form>")

i = 0 

For i = 1 to 36 
  Response.write("<a href=paginacao.asp?letra="&Replace(Mid(letras, i,1),"#", "Todas")&"><b>"&Replace(Mid(letras, i,1),"#", "Todas")&"</b></a>  ") 
Next	


Response.write("<br><br><table cellpadding=""5"" width=""600"">")
Response.write("<tr style=""cursor: hand;"" >")
	Response.write("<td  onmouseover=""java script:this.style.backgroundColor='#FFECEC';"" >Data</td>")
	Response.write("<td  onmouseover=""java script:this.style.backgroundColor='#FFECEC';"" >Hora</td>")
	Response.write("<td  onmouseover=""java script:this.style.backgroundColor='#FFECEC';"" >DDD-NºTelefone</td>")
	Response.write("<td  onmouseover=""java script:this.style.backgroundColor='#FFECEC';"" >Solicitante</td>")
	Response.write("<td  onmouseover=""java script:this.style.backgroundColor='#FFECEC';"">Local</td>")
	Response.write("<td  onmouseover=""java script:this.style.backgroundColor='#FFECEC';"" >Operador</td>")
	Response.write("<td  onmouseover=""java script:this.style.backgroundColor='#FFECEC';"" >Tipo</td>")
Response.write("</tr>")
Do While Not RS.EOF And Count < RS.PageSize 

	if i mod 2<>0 then
		cor = "#F0F0F0"
	else
		cor = "#E8E8E8"
	end if 

%> 


<tr style="cursor: hand;">
	<td bgcolor="<%=cor%>" onmouseover="java script:this.style.backgroundColor='#FFECEC';" onmouseout="java script:this.style.backgroundColor='<%=cor%>';"><%=RS("Data")%></td>
	<td bgcolor="<%=cor%>" onmouseover="java script:this.style.backgroundColor='#FFECEC';" onmouseout="java script:this.style.backgroundColor='<%=cor%>';"><%=RS("Hora")%></td>
	<td bgcolor="<%=cor%>" onmouseover="java script:this.style.backgroundColor='#FFECEC';" onmouseout="java script:this.style.backgroundColor='<%=cor%>';"><%=RS("DDD")%>-<%=RS("NºTelefone")%></td>
	<td bgcolor="<%=cor%>" onmouseover="java script:this.style.backgroundColor='#FFECEC';" onmouseout="java script:this.style.backgroundColor='<%=cor%>';"><%=RS("Solicitante")%></td>
	<td bgcolor="<%=cor%>" onmouseover="java script:this.style.backgroundColor='#FFECEC';" onmouseout="java script:this.style.backgroundColor='<%=cor%>';"><%=RS("Local")%></td>
	<td bgcolor="<%=cor%>" onmouseover="java script:this.style.backgroundColor='#FFECEC';" onmouseout="java script:this.style.backgroundColor='<%=cor%>';"><%=RS("Operador")%></td>
	<td bgcolor="<%=cor%>" onmouseover="java script:this.style.backgroundColor='#FFECEC';" onmouseout="java script:this.style.backgroundColor='<%=cor%>';"><%=RS("Tipo")%></td>
</tr>

<%
	i = i+1
	Count = Count + 1  
	RS.MoveNext
Loop			  

response.write("</table><br>")
Response.Write("<B>Página " & PagAtual & " de " & TotalPages & " </B> - ")   

If PagAtual > 1 Then 
	Response.Write("<B>") 
	Response.Write("<a href='paginacao.asp?PagAtual=" &  1 & "&Letra="&letra&"'>")
	Response.Write("Primeira") 
	Response.Write("</a></B> ")
	  
	Response.Write("<B>") 
	Response.Write("<a href='paginacao.asp?PagAtual=" & PagAtual - 1 & "&Letra="&letra&"'>")
	Response.Write("Anterior") 
	Response.Write("</a></B>  ")
Else 
	Response.Write("Primeira ") 
	Response.Write("Anterior  ") 
End If

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 "<B>" & i & "</B>  "
		End If

		If CInt(i) < CInt(PagAtual) Then
			Response.Write "<a href='paginacao.asp?PagAtual=" & i & "&Letra="&letra&"'>" & i & "</a>  "
		End If

		If CInt(i) > CInt(PagAtual) Then
			Response.Write "<a href='paginacao.asp?PagAtual=" & i & "&Letra="&letra&"'>" & i & "</a>  "
		End If
	Next


	If CInt(PagAtual) <> CInt(TotalPages) Then
		Response.Write("  <B>")
		Response.Write("<a href='paginacao.asp?PagAtual=" & PagAtual + 1 & "&Letra="&letra&"'>")
		Response.Write("Próxima")
		Response.Write("</a></B>") 

		Response.Write(" <B>")
		Response.Write("<a href='paginacao.asp?PagAtual=" & TotalPages & "&Letra="&letra&"'>")
		Response.Write("Ultima")
		Response.Write("</a></B>")		

	Else
		Response.Write("  Próxima") 
		Response.Write(" Ultima")
	End If 
End If

Response.write("<br> <br><center><A HREF='index.asp'>..: Voltar :..</A></center></td></tr></table>")

Rs.Close  
Set RS = Nothing
Conn.Close	  
Set Conn = Nothing	   
   
%> 

</body>
</html>

Compartilhar este post


Link para o post
Compartilhar em outros sites

eu resolvi o problema.. éra o link da paginação.. ficou assim caso alguem prescise...

 

 

 

 

 

 

 

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Documento sem título</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
<!--
body {
	background-color: #003300;
}
.style1 {font-family: Verdana, Arial, Helvetica, sans-serif}
-->
</style></head>



<%
		Dim letra,letras,DSNtest,Conn,RS,pesquisa,aonde,username,rsuser
		
		 username = Request.Cookies("username")
		
'Abrir a conexão

Dim ConnectString
ConnectString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath("dados.mdb")'  <<<<<<----  endereço de onde esta seu banco de dados
Set conn = Server.CreateObject("ADODB.Connection")
conn.open ConnectString

'nome no topo da página e ver se é adm

Set rsuser = Server.CreateObject("ADODB.Recordset") 
SQL = "SELECT * FROM users WHERE nome = '"&username&"'"
rsuser.Open SQL,Conn,3,3

%>		


<body>
<table width="100%" height="100%" border="0" bordercolor="#FFFFFF">
  <tr> 
	<td colspan="4" bordercolor="#FFFFFF"> <div align="center"><img src="imagens/banner_controle_tel2.png" width="1030" height="150"></div></td>
  </tr>
  <tr> 
	<td colspan="4" bordercolor="#FFFFFF"> </td>
  </tr>
  <tr> 
	<td width="574" height="23"> <table width="353">
		<tr> 
		  <td  height="23"> <a href="index.asp"> 
			<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="110" height="20">
			  <param name="movie" value="imagens/01.swf">
			  <param name="quality" value="high">
			  <param name="BGCOLOR" value="#003300">
			  <embed src="imagens/01.swf" width="110" height="20" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" bgcolor="#003300"></embed></object>
			</a> </td>
		  <td > <a href="paginacao.asp"> 
			<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="110" height="20">
			  <param name="movie" value="imagens/02.swf">
			  <param name="quality" value="high">
			  <param name="BGCOLOR" value="#003300">
			  <embed src="imagens/02.swf" width="110" height="20" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" bgcolor="#003300"></embed></object>
			</a></td>
		  <td > 
			<% if rsuser("adm") = "Sim" then %>
			<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="110" height="20">
			  <param name="movie" value="imagens/03.swf">
			  <param name="quality" value="high">
			  <param name="BGCOLOR" value="#003300">
			  <embed src="imagens/03.swf" width="110" height="20" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" bgcolor="#003300"></embed></object> 
			<%else%>
			  
			<% end if %>
		  </td>
		  <td > 
			<% if rsuser("adm") = "Sim" then %>
			<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="110" height="20">
			  <param name="movie" value="imagens/04.swf">
			  <param name="quality" value="high">
			  <param name="BGCOLOR" value="#003300">
			  <embed src="imagens/04.swf" width="110" height="20" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" bgcolor="#003300"></embed></object> 
			<%else%>
			  
			<% end if %>
		  </td>
		</tr>
	  </table></td>
	<td width="319"> 
	  <!--.......................inicio data atualizada  -->
	  <div align="right"> 
		<script type="text/javascript" language="JavaScript">
var Franca = "São Paulo,"
var now = new Date(); 
var hours = now.getHours(); 
var minutes = now.getMinutes(); 
var timeValue = "" + ((hours >12) ? hours -12 :hours) 
timeValue += ((minutes < 10) ? ":0" : ":") + minutes
timeValue += (hours >= 12) ? " PM" : " AM" 
timerRunning = true; 

mydate = new Date(); 
myday = mydate.getDay(); 
mymonth = mydate.getMonth(); 
myweekday= mydate.getDate(); 
weekday= myweekday; 
myyear= mydate.getYear(); 
year = myyear

if(myday == 0) 
day = " Domingo, " 

else if(myday == 1) 
day = " Segunda Feira, " 

else if(myday == 2) 
day = " Terça Feira, " 

else if(myday == 3) 
day = " Quarta Feira, " 

else if(myday == 4) 
day = " Quinta Feira, " 

else if(myday == 5) 
day = " Sexta Feira, " 

else if(myday == 6) 
day = " Sábado, " 

if(mymonth == 0) 
month = " de Janeiro de " 

else if(mymonth ==1) 
month = " de Fevereiro de " 

else if(mymonth ==2) 
month = " de Março de " 

else if(mymonth ==3) 
month = " de Abril de " 

else if(mymonth ==4) 
month = " de Maio de "

else if(mymonth ==5) 
month = " de Junho de " 

else if(mymonth ==6) 
month = " de Julho de " 

else if(mymonth ==7) 
month = " de Agosto de " 

else if(mymonth ==8)
month = " de Setembro de " 

else if(mymonth ==9) 
month = " de Outubro de " 

else if(mymonth ==10) 
month = " de Novembro de " 

else if(mymonth ==11) 
month = " de Dezembro de " 

document.write("<FONT SIZE='30' COLOR='#ffffff' style='font-size: 8pt;font-family:Arial'  align='right'>" + Franca + day + myweekday + month + year + " - " + timeValue+"</FONT>"); 

</script>
		<!--.......................fim data atualizada -->
	  </div>
	  <br> <form action="signout.asp" method="get"><div align="right">
		<font color="#FFFFFF" face="Verdana, Arial, Helvetica, sans-serif">Seja 
		Bem Vindo!</font><font color="#FFFFFF"> <%=rsuser("Operador") %></font> 
		        
		<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="110" height="20">
		  <param name="movie" value="imagens/Sair.swf">
		  <param name="quality" value="high">
		  <param name="BGCOLOR" value="#003300">
		  <embed src="imagens/Sair.swf" width="110" height="20" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" bgcolor="#003300"></embed></object>
	  </form></td>
	<td width="124"> </td>
	<td width="1" bordercolor="#FFFFFF" > </td>
  </tr>
  <tr> <td height="242" colspan="5" bordercolor="#FFFFFF">
	<table width="97%" height="100%" border="0" bordercolor="#FFFFFF" background="Imagens/banner_controle_fundo.png">
	  <tr> 
		<td width="10" height="10" bordercolor="#FFFFFF" background="imagens/banner_controle_fundo.png"> </td>
		<td colspan="2" bordercolor="#FFFFFF"> </td>
		<td width="10" height="10"> </td>
	  </tr>
	  <tr> 
		<td width="10" height="387" bordercolor="#FFFFFF"> </td>
		<td colspan="2" bordercolor="#FFFFFF"> 
		  <%

pesquisa = Request.Querystring("pesquisa")
aonde = Request.Querystring("aonde")
PagAtual = Request.QueryString("PagAtual")
letra = Request.QueryString("Letra")
letras = "#0123456789ABCDEFGHIJKLMNOPQRSTUVXYWZ"

if pesquisa <> "" then
letra = pesquisa
end if
if pesquisa = "periodo" then
pesquisa 
end if

Set RS= Server.CreateObject("ADODB.Recordset") 
if aonde = "periodo" then
	   		 SQL = "SELECT *FROM controle WHERE data <= '"&adata1&"%' AND data >= '"&adata2&"%' Order by Local ASC"  
  else

if aonde = "Local" then
		SQL = "SELECT * FROM controle where Local LIKE '"&letra&"%' Order by Local ASC" 
  else
if aonde = "Solicitante" then
		SQL = "SELECT * FROM controle where Solicitante LIKE '"&letra&"%' Order by Solicitante ASC" 
  else
if aonde = "Tipo" then
		SQL = "SELECT * FROM controle WHERE Tipo LIKE '"&letra&"%' Order by Tipo ASC" 
  else 
if aonde = "NTelefone" then
		SQL = "SELECT * FROM controle where NºTelefone LIKE '"&letra&"%' Order by NºTelefone ASC" 
  else 
if aonde = "Data" then
		SQL = "SELECT * FROM controle where Data LIKE '"&letra&"%' Order by Data ASC" 
  else 
if aonde = "Operador" then
		SQL = "SELECT * FROM controle where Operador LIKE '"&letra&"%' Order by Operador ASC" 
  else  
  If letra = "" Then 
		SQL = "SELECT * FROM controle" 
  Else 
	If letra = "Todas" Then 
		SQL = "SELECT * FROM controle Order by Solicitante ASC" 
	Else
		SQL = "SELECT * FROM controle WHERE Solicitante LIKE '"&letra&"%' Order by Solicitante ASC" 
	End if
  End If	 
End if 
End if 
End if
End if
End if
End if 
End if 
RS.Open SQL, conn, 3,3

If RS.EOF Then 


	

	Response.write("<br><br><table cellpadding=""5"" width=""100%"">")
	Response.write("<tr><td bgcolor=""#F0F0F0"">Nenhum registro encontrado!</td></tr>")
	Response.write("</table>")
	Response.write("</td></tr></table>")
	
Else	
Const NumPorPage = 30

   Dim PagAtual

   IF Request.QueryString("PagAtual") = "" Then
			   PagAtual = 1
		 Else
				PagAtual = Request.QueryString("PagAtual")
   End If

   RS.CacheSize = NumPorPage 

	RS.MoveFirst				
	RS.PageSize = NumPorPage   

	Dim TotalPages			  
	TotalPages = RS.PageCount

	RS.AbsolutePage = PagAtual 

Count = 0  
	Response.write("<table cellpadding=""5"" width=""100%"">")
	Response.write("<tr><td align=""center"">")
 Response.write("<form name='form1' method='get' action='teste.asp'>")
	Response.write("<input type='text' name='pesquisa'>")
		 Response.write("          ")
	Response.write("<select name='aonde' size=""1"">")
		 Response.write("<option name=""aonde"" value='Tipo'>Tipo</option>")
		 Response.write("<option name=""aonde"" value='NTelefone'>Nº Telefone</option>")
		 Response.write("<option name=""aonde"" value='Data'>Data</option>") 
		 Response.write("<option name=""aonde"" value='Operador'>Operador</option>")
		 Response.write("<option name=""aonde"" value='Local'>Local</option>")
		 Response.write("<option name=""aonde"" value='Solicitante'>Solicitante</option>")
		 Response.write("<option name=""aonde"" value='periodo'>periodo</option>")
	 Response.write("</select>")
	 Response.write("          ")
	 Response.write("<input type='submit' name='Submit' value='Pesquisar'><br>")
	 Response.write("</form>")

Response.write("<br><br><table cellpadding=""5"" width=""100%"">")
Response.write("<tr style=""cursor: hand;"" >")
	Response.write("<td  onmouseover=""java script:this.style.backgroundColor='#ffffff';"" ><font color=""#FFFFFF"" face=""Verdana, Arial, Helvetica, sans-serif"">Data</font></td>")
	Response.write("<td  onmouseover=""java script:this.style.backgroundColor='#ffffff';"" ><font color=""#FFFFFF"" face=""Verdana, Arial, Helvetica, sans-serif"">Hora</font></td>")
	Response.write("<td  onmouseover=""java script:this.style.backgroundColor='#ffffff';"" ><font color=""#FFFFFF"" face=""Verdana, Arial, Helvetica, sans-serif"">DDD-NºTelefone</font></td>")
	Response.write("<td  onmouseover=""java script:this.style.backgroundColor='#ffffff';"" ><font color=""#FFFFFF"" face=""Verdana, Arial, Helvetica, sans-serif"">Solicitante</font></td>")
	Response.write("<td  onmouseover=""java script:this.style.backgroundColor='#ffffff';""><font color=""#FFFFFF"" face=""Verdana, Arial, Helvetica, sans-serif"">Local</font></td>")
	Response.write("<td  onmouseover=""java script:this.style.backgroundColor='#ffffff';"" ><font color=""#FFFFFF"" face=""Verdana, Arial, Helvetica, sans-serif"">Operador</font></td>")
	Response.write("<td  onmouseover=""java script:this.style.backgroundColor='#ffffff';"" ><font color=""#FFFFFF"" face=""Verdana, Arial, Helvetica, sans-serif"">Tipo</font></td>")
Response.write("</tr>")
Do While Not RS.EOF And Count < RS.PageSize 

	if i mod 2<>0 then
		cor = "#F0F0F0"
	else
		cor = "#E8E8E8"
	end if 

%>
	  <tr style="cursor: hand;"> 
		<td bgcolor="<%=cor%>" onMouseOver="java script:this.style.backgroundColor='#FFECEC';" onMouseOut="java script:this.style.backgroundColor='<%=cor%>';"><%=RS("Data")%></td>
		<td bgcolor="<%=cor%>" onMouseOver="java script:this.style.backgroundColor='#FFECEC';" onMouseOut="java script:this.style.backgroundColor='<%=cor%>';"><%=RS("Hora")%></td>
		<td bgcolor="<%=cor%>" onMouseOver="java script:this.style.backgroundColor='#FFECEC';" onMouseOut="java script:this.style.backgroundColor='<%=cor%>';"><%=RS("DDD")%>-<%=RS("NºTelefone")%></td>
		<td bgcolor="<%=cor%>" onMouseOver="java script:this.style.backgroundColor='#FFECEC';" onMouseOut="java script:this.style.backgroundColor='<%=cor%>';"><%=RS("Solicitante")%></td>
		<td bgcolor="<%=cor%>" onMouseOver="java script:this.style.backgroundColor='#FFECEC';" onMouseOut="java script:this.style.backgroundColor='<%=cor%>';"><%=RS("Local")%></td>
		<td bgcolor="<%=cor%>" onMouseOver="java script:this.style.backgroundColor='#FFECEC';" onMouseOut="java script:this.style.backgroundColor='<%=cor%>';"><%=RS("Operador")%></td>
		<td bgcolor="<%=cor%>" onMouseOver="java script:this.style.backgroundColor='#FFECEC';" onMouseOut="java script:this.style.backgroundColor='<%=cor%>';"><%=RS("Tipo")%></td>
	  </tr>
	  <%
	i = i+1
	Count = Count + 1  
	RS.MoveNext
Loop			  

response.write("</table><br>")
 Response.Write("<font color=""#FFFFFF"" face=""Verdana, Arial, Helvetica, sans-serif"">")  
Response.Write("<B>Página " & PagAtual & " de " & TotalPages & " </B> - ")   

If PagAtual > 1 Then 
	Response.Write("<B>") 
	Response.Write("<a href='teste.asp?PagAtual=" &  1 & "&Letra="&letra&"&aonde="&aonde&"'>")
	Response.Write("Primeira") 
	Response.Write("</a></B> ")
	  
	Response.Write("<B>") 
	Response.Write("<a href='teste.asp?PagAtual=" & PagAtual - 1 & "&Letra="&letra&" &aonde="&aonde&"'>")
	Response.Write("Anterior") 
	Response.Write("</a></B>  ")
Else 
	Response.Write("Primeira ") 
	Response.Write("Anterior  ") 
End If

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 "<B>" & i & "</B>  "
		End If

		If CInt(i) < CInt(PagAtual) Then
			Response.Write "<a href='teste.asp?PagAtual=" & i & "&Letra="&letra&"&aonde="&aonde&"'>" & i & "</a>  "
		End If

		If CInt(i) > CInt(PagAtual) Then
			Response.Write "<a href='teste.asp?PagAtual=" & i & "&Letra="&letra&"&aonde="&aonde&"'>" & i & "</a>  "
		End If
	Next


	If CInt(PagAtual) <> CInt(TotalPages) Then
		Response.Write("  <B>")
		Response.Write("<a href='teste.asp?PagAtual=" & PagAtual + 1 & "&Letra="&letra&"&aonde="&aonde&"'>")
		Response.Write("Próxima")
		Response.Write("</a></B>") 

		Response.Write(" <B>")
		Response.Write("<a href='teste.asp?PagAtual=" & TotalPages & "&Letra="&letra&"&aonde="&aonde&"'>")
		Response.Write("Ultima")
		Response.Write("</a></B>")		

	Else
		Response.Write("  Próxima") 
		Response.Write(" Ultima")
	End If 
End If

Response.write("<br> <br><center><A HREF='index.asp'>..: Voltar :..</A></center></td></tr></table>")
Response.Write("</font>") 
Rs.Close  
Set RS = Nothing
Conn.Close	  
Set Conn = Nothing	   
   
%></td>
	  <td width="10"> </td>
	  </tr>
	  <tr> 
		<td width="10" height="10" bordercolor="#FFFFFF"> </td>
		<td height="10" colspan="2" bordercolor="#FFFFFF"> </td>
		<td width="10" height="10"> </td>
	  </tr>
	</table></td>
  </tr>
  <tr> 
	<td height="40" colspan="4" bordercolor="#FFFFFF"><table width="1024" border="0" align="center" cellpadding="0">
		<tr> 
		  <td><div align="center"><img src="imagens/faixa_rodapetrans.png" width="1024" height="60"></div></td>
		</tr>
	  </table></td>
  </tr>
</table>

</body>
</html>

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.