$limit += $offset; } $i = 0; foreach ($all as $row) { $i++; if ($page->settings->show_pager && $i < $offset) { continue; } if ($i > $limit) { break; } $type = $row['__table__']; $page->set_info($page->type_info($type)); $style = 'style="font-size: 13px;"'; $label_type = $page->type; $label_name = Info::create($row, $page, $label_type)->name(); //ucfirst($label_type); $label = "<span {$style} class='label label-{$label_type}'>{$label_name}</span>"; $page->print_table_rows($row, array('Type' => $label, 'Player' => $page->get_avatar($page->get_name($row['uuid']), $row['uuid']), 'Moderator' => $page->get_avatar($page->get_banner_name($row), $row['banned_by_uuid']), 'Reason' => $page->clean($row['reason']), 'Date' => $page->millis_to_date($row['time']), 'Expires' => $page->expiry($row))); } $page->table_end(); // print pager if ($page->settings->show_pager) { $page->name = "history"; $args = "&uuid={$uuid}"; if ($from !== null) { $args .= "&from={$from}"; } if ($staffhistory) { $args .= "&staffhistory=1"; }
$type = $_GET['type']; $id = $_GET['id']; $page = new Page($type); $page->type !== null or die("Unknown page type requested."); filter_var($id, FILTER_VALIDATE_INT) or die("Invalid ID."); $id = (int) $id; $type = $page->type; $table = $page->table; $sel = $page->get_selection($table); $query = "SELECT {$sel} FROM {$table} WHERE id=? LIMIT 1"; $st = $page->conn->prepare($query); if ($st->execute(array($id))) { $row = $st->fetch() or die("Error: {$type} not found in database."); $player_name = $page->get_name($row['uuid']); $player_name !== null or die("Error: Player name not found."); $info = Info::create($row, $page, $type); $name = $info->name(); $permanent = $info->permanent(); $page->name = "{$name} #{$id}"; $page->print_title(); if (!$info instanceof KickInfo) { $style = 'style="margin-left: 13px; font-size: 16px;"'; $active = $page->active($row); if ($active === true) { $page->name .= "<span {$style} class='label label-danger'>Active</span>"; } else { $page->name .= "<span {$style} class='label label-warning'>Inactive</span>"; } if ($permanent) { $page->name .= "<span {$style} class='label label-danger'>Permanent</span>"; }