Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- <head>
- <script type="text/javascript" src="jquery-1.4.3.min.js"></script>
- <script type="text/javascript" language="javascript">
- function pan(str){
- //VARIAVEL
- if (str==""){
- document.getElementById("conteudo").innerHTML="";
- return;
- }
- $("#conteudo").load("jquery2.php?PaginaAtual="+str);
- </script>
- </head>
- <body>
- <?php
- $numero = rand(1,100);
- echo "$numero";
- echo '<div id="nada">ESTATICA</div><br><br><br>';
- echo '<div id="conteudo">';
- $NossoArray = array('a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'x', 'z');
- $RegistrosPorPagina = 5;
- if (!isset($_GET["PaginaAtual"]))
- {
- $PaginaAtual = 1;
- }
- else{
- $PaginaAtual = $_GET["PaginaAtual"];
- }
- $TotalDeRegistros = (count($NossoArray) - 1);
- $TotalDePaginas = ceil($TotalDeRegistros/$RegistrosPorPagina);
- $PrimeiroRegistro = (($PaginaAtual * $RegistrosPorPagina) - $RegistrosPorPagina);
- function CriarLinks ($TotalDePaginas)
- {
- $link = '';
- //Inicia a variavel
- for ($i = 1; $i <= $TotalDePaginas; $i++)
- {
- //Faz um for até o números de paginas
- $link .= " <a href=javascript:abre('?PaginaAtual=$i','GET')>$i</a> |";
- //Adiciona a pagina na string
- }
- return $link;
- //Tem como retorno a string com os links já criados
- }
- for ($i = $PrimeiroRegistro; $i < ($RegistrosPorPagina + $PrimeiroRegistro); $i++)
- {
- if(isset($NossoArray[$i]))
- {
- echo $NossoArray[$i].'<br>';
- }
- }
- echo CriarLinks($TotalDePaginas);
- echo '</div>';
- ?>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement