Warning: Undefined array key "site" in /home/blusolor/public_html/blusolreformar/includes/header.php on line 16
Warning: Undefined array key "email" in /home/blusolor/public_html/blusolreformar/includes/header.php on line 17
Warning: Undefined array key "telefone_02" in /home/blusolor/public_html/blusolreformar/includes/header.php on line 19
Deprecated: preg_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated in /home/blusolor/public_html/blusolreformar/includes/header.php on line 22
Warning: Undefined array key "whatsapp_msg" in /home/blusolor/public_html/blusolreformar/includes/header.php on line 24
Deprecated: urlencode(): Passing null to parameter #1 ($string) of type string is deprecated in /home/blusolor/public_html/blusolreformar/includes/header.php on line 24
Warning: Undefined array key "cnpj" in /home/blusolor/public_html/blusolreformar/includes/header.php on line 30
Warning: Undefined array key "empresa" in /home/blusolor/public_html/blusolreformar/includes/header.php on line 40
Warning: Undefined array key "keywords" in /home/blusolor/public_html/blusolreformar/includes/header.php on line 42
class Paginacao {
private $pagina;
private $maximo;
private $anterior;
private $prox;
private $inicio;
private $total;
private $formatado = 0;
public function __construct($maximo = 20, $total = null){
// Declaraçao da página inicial
if (isset($_GET['pagina'])){
$this->pagina = intval($_GET['pagina']);
} else {
$this->pagina = 1;
}
// Máximo de registros por página
$this->maximo = intval($maximo);
if ($this->maximo == 0) $this->maximo++;
// Calculando o registro inicial
$this->inicio = $this->pagina - 1;
$this->inicio *= $this->maximo;
// Calculando pagina anterior
$this->anterior = $this->pagina - 1;
// Calculando pagina posterior
$this->prox = $this->pagina + 1;
if ($total !== null){
$this->setTotal($total);
}
}
public function setTotal($total){
$this->total = intval($total);
$pgs = $this->total / $this->maximo;
$this->formatado = ceil($pgs);
}
public function setMaximo($maximo){
$this->maximo = intval($maximo);
if ($this->maximo == 0) $this->maximo++;
// Calculando o registro inicial
$this->inicio = $this->pagina - 1;
$this->inicio *= $this->maximo;
}
public function getInicio(){
return max(0,$this->pagina-1) * $this->maximo;
}
public function getTotal(){
return $this->total;
}
public function getContador(){
$fim = $this->inicio + $this->maximo;
$resultados = ($this->total > 0) ? ($this->inicio+1) : 0;
$resultados .= ' a ';
$resultados .= ($fim >= $this->total) ? $this->total : $fim;
$resultados .= ' de ';
$resultados .= ($this->total > 0) ? $this->total : 0;
return $resultados.' registros';
}
public function getPaginacao($amigavel = true){
global $pagina,$page;
if ($this->formatado > 1){
if ($amigavel){
$path = $_SERVER['REQUEST_URI'];
if (isset($_GET['pagina'])){
$path = preg_replace('/'.$_GET['pagina'].'\/?$/','',$path);
}
if ($this->formatado > 1){
if($this->total > $this->maximo) {
$campos = "";
// Se não for a primeira página, coloca este link
if ($this->pagina > 1){
$campos .= '«';
}
$x = $this->maximo;
$i = 1;
while ($x < $this->total + $this->maximo){ // Calcula o número de cada página
if ($i == $this->pagina){
$campos .= ''.$i.'';
// Páginas antes e depois da atual
} elseif (($i >= ($this->pagina - 3)) && (($i <= ($this->pagina + 3)))) {
$campos .= ''.$i.'';
}
$x += $this->maximo;
$i++;
}
// Se não for a última página, coloca este link
if ($this->pagina < $this->formatado){
$campos .= '»';
}
$html = ''.$campos.'
';
return $html;
}
}
} else {
$path = $page.'.php?';
$params = $_SERVER['QUERY_STRING'];
$params = preg_replace('/\&?pagina=([\d]+)/','',$params);
$path .= $params;
if ($this->formatado > 1){
if($this->total > $this->maximo) {
$campos = "";
// Se não for a primeira página, coloca este link
if ($this->pagina > 1){
$campos .= '«';
}
$x = $this->maximo;
$i = 1;
while ($x < $this->total + $this->maximo){ // Calcula o número de cada página
if ($i == $this->pagina){
$campos .= ''.$i.'';
// Páginas antes e depois da atual
} elseif (($i >= ($this->pagina - 3)) && (($i <= ($this->pagina + 3)))) {
$campos .= ''.$i.'';
}
$x += $this->maximo;
$i++;
}
// Se não for a última página, coloca este link
if ($this->pagina < $this->formatado){
$campos .= '»';
}
$html = ''.$campos.'
';
return $html;
}
}
}
return '';
}
}
}
Fatal error: Uncaught Error: Class "Paginacao" not found in /home/blusolor/public_html/blusolreformar/includes/header.php:55
Stack trace:
#0 /home/blusolor/public_html/blusolreformar/includes/topo.php(4): include()
#1 /home/blusolor/public_html/blusolreformar/index.php(1): include('/home/blusolor/...')
#2 {main}
thrown in /home/blusolor/public_html/blusolreformar/includes/header.php on line 55