|
|
|

|

|
Dicas
|

|
ASP - Active Server Page (Miscelâneas)
|
|
 |
Título da Dica: Paginação simples.
|
 |
|
|
Postada em 26/1/2004 por Mago_Pc
Response.Write("<font color=""#006600"" size=""2"" face=""Arial""><strong> Página " & PagAtual & " de " & TotalPages & " </strong></font> - ")
var01 = Len(PagAtual) 'Lê o tamanho do numero var02 = var01 - 1 'subtrai um da variavel , retirando o digito menos sig. var03 = Left(PagAtual,var02) 'obtem os digitos mais sig. do numero var04 = Right(PagAtual,1) 'obtem o digito menos sig. do numero
var05 = var03 & 0 ' Acrecenta ZERO no final IF var04 <> 0 THEN ' condição se o digito menos sig. é Zero inicial = var05 + 1 final = inicial + 9 ELSE inicial = var05 - 9 final = var05END IF indice_i = var04 - 1 'ultimo digito - 1 indice_f = 10 - var04 ' 10 - digito menos sig. ' If CInt(inicial) < 1 Then inicial = 1 If CInt(final) > CInt(TotalPages) Then final = TotalPages
IF PagAtual > 1 THEN
Response.Write("<font color=""#660066"" size=""1"" face=""Arial"">") Response.Write("<a href='jogos.asp?PagAtual=" & 1 & "'>") Response.Write("Primeira") Response.Write("</a></font> ")
Response.Write("<font color=""#660066"" size=""2"" face=""Arial"">") Response.Write("<a href='jogos.asp?PagAtual=" & PagAtual - 1 & "'>") Response.Write("Anterior") Response.Write("</a></font> ")
IF PagAtual > 10 THEN
Response.Write("<font color=""#660066"" size=""2"" face=""Arial"">") Response.Write("<a href='jogos.asp?PagAtual=" & inicial - 1 & "'>") Response.Write("...") Response.Write("</a></font> ")
ELSE
Response.Write("<font color=""#CCCCCC"" size=""2"" face=""Arial"">") Response.Write("....") Response.Write("</font> ")
END IF Else
Response.Write("<font color=""#EEEEEE"" size=""1"" face=""Arial"">") Response.Write("Primeira") Response.Write("</font> ")
Response.Write("<font color=""#CCCCCC"" size=""2"" face=""Arial"">") Response.Write("Anterior") Response.Write("</font> ") Response.Write("<font color=""#CCCCCC"" size=""2"" face=""Arial"">") Response.Write("...") Response.Write("</font> ")
End If '---------------------- NUMEROS --------------------------- For i = inicial To final If CInt(i)=CInt(PagAtual) Then Response.Write "<font color=""#660066"" size=""1"" face=""Arial"">[ " & i & " <font color=""#660066"">]</font> " END IF
If CInt(i) < CInt(PagAtual) Then Response.Write "<font color=""#660066"" size=""1"" face=""Arial""><a href='jogos.asp?PagAtual=" & i & "'>" & i & "</a></font> " END IF
If CInt(i) > CInt(PagAtual) Then Response.Write "<font color=""#660066"" size=""1"" face=""Arial""><a href='jogos.asp?PagAtual=" & i & "'>" & i & "</a></font> " END IF Next
'------------------------------------------------------
IF CInt(PagAtual) <> CInt(TotalPages) THEN p1 = Left(PagAtual,var02) p2 = Left(TotalPages,var02) p3 = Left(TotalPages,var02) & 0
IF (p1 <> p2) or (final = p3) or (var01 = 1) THEN
Response.Write("<font color=""#660066"" size=""2"" face=""Arial"">") Response.Write("<a href='jogos.asp?PagAtual=" & final + 1 & "'>") Response.Write("...") Response.Write("</a></font> ")
ELSE Response.Write("<font color=""#CCCCCC"" size=""2"" face=""Arial"">") Response.Write("...") Response.Write("</font> ")
END IF Response.Write("<font color=""#660066"" size=""2"" face=""Arial"">") Response.Write("<a href='jogos.asp?PagAtual=" & PagAtual + 1 & "'>") Response.Write("Próxima") Response.Write("</a></font> ") Response.Write("<font color=""#660066"" size=""1"" face=""Arial"">") Response.Write("<a href='jogos.asp?PagAtual=" & TotalPages & "'>") Response.Write("Ultima") Response.Write("</a></font> ") ELSE
Response.Write("<font color=""#CCCCCC"" size=""2"" face=""Arial"">") Response.Write("...") Response.Write("</font> ") Response.Write("<font color=""#CCCCCC"" size=""2"" face=""Arial"">") Response.Write("Próxima") Response.Write("</font> ") Response.Write("<font color=""#EEEEEE"" size=""1"" face=""Arial"">") Response.Write("Ultima") Response.Write("</font> ") End If
|
|
|
|

|