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") {
$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>";
}

View File

@ -6,7 +6,7 @@ use PDO;
require_once './includes/page.php';
$page = new Page("warnings");
$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();
@ -23,7 +23,7 @@ while ($row = $result->fetch(PDO::FETCH_ASSOC)) {
'Warned By' => $page->get_avatar($page->get_banner_name($row), $row['banned_by_uuid']),
'Reason' => $page->clean($row['reason']),
'Warned Until' => $page->expiry($row),
'Received Warning?' => $row['warned'] ? "Yes" : "No",
'Received Warning' => $row['warned'] ? "Yes" : "No",
));
}
$page->table_end();