Fix info.php labels

This commit is contained in:
ruan 2016-10-15 08:39:00 +02:00
parent 5074cbfc5f
commit fc2471d94c
No known key found for this signature in database
GPG Key ID: 062534EE618F498C
2 changed files with 10 additions and 6 deletions

View File

@ -367,8 +367,10 @@ class Page {
echo "<tbody>"; echo "<tbody>";
} }
function print_header($container_start = true) { function print_header($container_start = true, $title = null) {
$title = $this->title; if ($title === null) {
$title = $this->title;
}
if ($container_start) { if ($container_start) {
echo '<div class="container">'; echo '<div class="container">';
} }

View File

@ -146,19 +146,21 @@ if ($st->execute(array($id))) {
$page->name = $page->title = "$name #$id"; $page->name = $page->title = "$name #$id";
$page->print_title(); $page->print_title();
$header = $page->name;
if (!($info instanceof KickInfo)) { if (!($info instanceof KickInfo)) {
$style = 'style="margin-left: 13px; font-size: 16px;"'; $style = 'style="margin-left: 13px; font-size: 16px;"';
$active = $page->active($row); $active = $page->active($row);
if ($active === true) { if ($active === true) {
$page->name .= "<span $style class='label label-danger'>Active</span>"; $header .= "<span $style class='label label-danger'>Active</span>";
} else { } else {
$page->name .= "<span $style class='label label-warning'>Inactive</span>"; $header .= "<span $style class='label label-warning'>Inactive</span>";
} }
if ($permanent) { if ($permanent) {
$page->name .= "<span $style class='label label-danger'>Permanent</span>"; $header .= "<span $style class='label label-danger'>Permanent</span>";
} }
} }
$page->print_header(); $page->print_header($header);
$map = $info->basic_info($row, $player_name); $map = $info->basic_info($row, $player_name);