<?php error_reporting(E_ALL ^ E_NOTICE); $res = $db->GetAll($table4, $iid); $pnumber = is_array($res) ? count($res) : 0; if (isset($_GET['page'])) { $pageNum = $_GET['page']; } $offset = ($pageNum - 1) * $rowsPerPage; $maxPage = ceil($pnumber / $rowsPerPage); for ($page = 1; $page <= $maxPage; $page++) { if ($page == $pageNum) { $nav .= " {$page} "; // no need to create a link to current page } else { $nav .= "{$self}&page={$page}"; } } $query = $table4 . " LIMIT " . $offset . "," . $rowsPerPage; $res = $db->GetAll($query, $iid); $tableheader = header_vehicle(0, $chbox); foreach ($res as $row) { $tablerows .= row_vehicle($row, $chbox); } include 'paging.php';
if (isset($_GET['page'])) { $pageNum = $_GET['page']; } $offset = ($pageNum - 1) * $rowsPerPage; $maxPage = ceil($pnumber / $rowsPerPage); for ($page = 1; $page <= $maxPage; $page++) { if ($page == $pageNum) { $nav .= " {$page} "; } else { $nav .= "{$self}&page={$page}"; } } $query = $query . " LIMIT " . $offset . "," . $rowsPerPage . ";"; $res = mysql_query($query) or die(mysql_error()); $number = mysql_num_rows($res); $chbox = ''; if (!$serverrunning) { $chbox = '<th class="product-table-header"><a>Delete</a></th>'; $formhead = '<form action="index.php?view=table&show=4" method="post">'; $formfoot = '<input type="submit" class="submit" /></form>'; } $tableheader = header_vehicle($show, $chbox, $order); while ($row = mysql_fetch_array($res)) { if (!$serverrunning) { $chbox = '<td align="center" class="gear_preview"><input name="vehicle[]" value="' . $row['id'] . '" type="checkbox" /></td>'; } else { $chbox = ''; } $tablerows .= row_vehicle($row, $chbox, $serverworld); } include 'paging.php';