<div class="page-header"> <h1>Scanned ticket log</h1> </div> <?php $limit = 30; if (isset($_GET['page'])) { $page = $_GET['page']; $offset = $page * $limit; } else { $page = 0; $offset = 0; } $ticket = new ticket(); $logs = $ticket->getLogs($offset, $limit); $rows = $logs->total; $pages = ceil($rows / $limit); $i = 0; $nextpage = $page + 1; $prevpage = $page - 1; $logs = $logs->logs; if ($pages > 1) { ?> <ul class='pagination'> <?php if ($prevpage >= 0) { ?> <li><a href="?page=<?php echo $prevpage;