Home Files
Adminer
Execute Command
PHP Eval
Symlink
File Upload
Owner :
www-data
PHP Version
8.1.8
Disk Space
203.89 GB
Server Addr
171.9.3.2
Your IP
171.9.3.1
Edit File
File:
<?php class Paginacao { var $pagina = 0; var $itens_por_pagina = '10'; var $num_total = ''; var $num_paginas = ''; var $max_links = 6; public function limit() { if ($this->pagina == 0) $this->pagina = '0'; return " LIMIT " . ($this->pagina * $this->itens_por_pagina) . ", " . $this->itens_por_pagina; } public function paginar() { $pagination = null; $url = null; if ($this->num_total > 0) { $this->num_paginas = ceil($this->num_total / $this->itens_por_pagina); foreach ($_GET as $chave => $valor) { if ($chave != 'pagina' and $chave != 'route') { $url = $url . $chave . "=" . $valor . "&"; } } $pagination .= " <div class='center-block text-right'> <ul class='mb-0 mt-5'>"; if ($this->pagina > 0 and $this->pagina < $this->num_paginas) { $pagination .= " <li class='page-item page-prev'> <a href='?" . $url . "pagina=" . ($this->pagina - 1) . "' class='page-link' aria-label='Previous'> <i class='fa fa-angle-left'></i> Anterior </a> </li>"; } if ($this->pagina == 0) { $pagination .= " <li class='page-item active'> <a class='page-link' > 1 </a> </li>"; } else { $pagination .= " <li class='page-item'> <a href='?" . $url . "pagina=0' class='page-link' > 1 </a> </li>"; } $links_laterais = ceil($this->max_links / 2); $inicio = $this->pagina - $links_laterais; $limite = $this->pagina + $links_laterais; for ($i = $inicio; $i <= $limite; $i++) { if ($this->pagina != ($i)) { $link = " href='?" . $url . "pagina=" . ($i) . "'"; $active = ""; } else { $link = ""; $active = " active"; } if ($i >= 1 && $i < ($this->num_paginas - 1)) { $pagination .= "<li class='page-item " . $active . "'><a class='page-link' " . $link . ">" . ($i + 1) . "</a></li>"; } } if (($this->num_paginas) == ($this->pagina + 1)) { $active = " active"; } if ($this->num_paginas > 1) { $pagination .= "<li class='page-item " . $active . "'> <a href='?" . $url . "pagina=" . ($this->num_paginas - 1) . "' class='page-link' aria-label='Next'> " . $this->num_paginas . " </a> </li>"; } if (($this->num_paginas - 1) > $this->pagina) { $pagination .= "<li class='page-item' > <a href='?" . $url . "pagina=" . ($this->pagina + 1) . "' class='page-link' aria-label='Next'> Próximo <i class='fa fa-angle-right'></i> </a> </li>"; } $pagination .= "</ul> </div>"; if ($this->num_paginas > 1) { return $pagination; } else { return ''; } } } }