I have a pagination made in PHP and Mysql:
$sqlVisualizarContar = mysqli_query($this->conexao,"SELECT * FROM tabela;");
$maximo = 10;
if($pagina >= 1){
$inicio = $pagina * $maximo;
$totalPag = mysqli_num_rows($sqlVisualizarContar) / $maximo;
}else{
$inicio = 0;
$maximo = 10;
}
if($pagina < 1){
$paginacao = "<a href=\"?pag=".($pagina + 1)."\" class='btn btn-warning btn-xs' style='background-color: #DA9139; color: #fff'>Próximo <i class=\"fa fa-angle-double-right\" aria-hidden=\"true\"></i> </a>";
}else{
$anterior = ($pagina - 1);
if($anterior == 0){
$pgAnterior = "visualizar-produtos.php";
}else{
$pgAnterior = "\"?pag=".$anterior."\"";
}
$proximo = ($pagina + 1);
$pgProximo = "\"?pag=".$proximo."\"";
$paginacao = "<a href='visualizar-produtos.php' class='btn btn-warning btn-xs' style='background-color: #DA9139; color: #fff'> Primeira Página </a> ";
$paginacao .= "<a href=".$pgAnterior." class='btn btn-warning btn-xs' style='background-color: #DA9139; color: #fff'> <i class=\"fa fa-angle-double-left\" aria-hidden=\"true\"></i> Anterior </a> ";
if($pagina != ceil($totalPag - 1)){
$paginacao .= "<a href=".$pgProximo." class='btn btn-warning btn-xs' style='background-color: #DA9139; color: #fff'> Próximo <i class=\"fa fa-angle-double-right\" aria-hidden=\"true\"></i> </a> ";
$paginacao .= "<a href=\"?pag=".ceil($totalPag - 1)."\" class='btn btn-warning btn-xs' style='background-color: #DA9139; color: #fff'> Última Página </a> ";
}
}
sqlVisualizar = mysqli_query($this->conexao,"SELECT * FROM tabela LIMIT ".$inicio.",".$maximo.";");
As a result, I get this way:
But the user to change pages, he has to click on the numbers, arrow or the word Last . I would like to know you can also use shortcut keys to change pages. If so, how would I do that?