Use glyphicons for "Received Warning" column

This commit is contained in:
ruan 2015-09-12 11:10:24 +02:00
parent e39c4e721a
commit 2620a552a9
2 changed files with 13 additions and 7 deletions

View File

@ -205,7 +205,13 @@ class Page {
if ($header === "Reason") { if ($header === "Reason") {
$style = "style=\"width: 30%;\""; $style = "style=\"width: 30%;\"";
} }
echo "<td $style><a style=\"color: #fcfcfc;\" href=\"info.php?type=$type&id=$id\">$text</a></td>"; $a = "a";
if ($header === "Received Warning") {
$icon = ($text !== "No") ? "glyphicon-ok" : "glyphicon-remove";
$a .= " class=\"glyphicon $icon\" aria-hidden=true";
$text = "";
}
echo "<td $style><$a style=\"color: #fcfcfc;\" href=\"info.php?type=$type&id=$id\">$text</a></td>";
} }
echo "</tr>"; echo "</tr>";
} }

View File

@ -6,7 +6,7 @@ use PDO;
require_once './includes/page.php'; require_once './includes/page.php';
$page = new Page("warnings"); $page = new Page("warnings");
$page->print_title(); $page->print_title();
$headers = array("Name", "Warned By", "Reason", "Warned Until", "Received Warning?"); $headers = array("Name", "Warned By", "Reason", "Warned Until", "Received Warning");
$page->print_page_header(); $page->print_page_header();
@ -19,11 +19,11 @@ while ($row = $result->fetch(PDO::FETCH_ASSOC)) {
if ($player_name === null) continue; if ($player_name === null) continue;
$page->print_table_rows($row, array( $page->print_table_rows($row, array(
'Name' => $page->get_avatar($player_name, $row['uuid']), 'Name' => $page->get_avatar($player_name, $row['uuid']),
'Warned By' => $page->get_avatar($page->get_banner_name($row), $row['banned_by_uuid']), 'Warned By' => $page->get_avatar($page->get_banner_name($row), $row['banned_by_uuid']),
'Reason' => $page->clean($row['reason']), 'Reason' => $page->clean($row['reason']),
'Warned Until' => $page->expiry($row), 'Warned Until' => $page->expiry($row),
'Received Warning?' => $row['warned'] ? "Yes" : "No", 'Received Warning' => $row['warned'] ? "Yes" : "No",
)); ));
} }
$page->table_end(); $page->table_end();