예제 #1
0
        return $a < $b ? 1 : -1;
    }
}
$page = new Page("history");
isset($_GET['uuid']) && is_string($_GET['uuid']) or die("Missing arguments (uuid).");
$staffhistory = isset($_GET['staffhistory']) && $_GET['staffhistory'] === "1";
$uuid = $_GET['uuid'];
$name = $page->get_name($uuid);
$name !== null or die("Player not found in database.");
if ($staffhistory) {
    $page->name = "Recent Punishments by {$name}";
} else {
    $page->name = "Recent Punishments for {$name}";
}
$page->print_title();
$page->print_page_header();
$from = null;
$from_title = null;
$from_href = null;
if (isset($_GET['from'])) {
    // sanitize $_GET['from']
    $info = $page->type_info($_GET['from']);
    if ($info['type'] !== null) {
        $from_title = $info['title'];
        $from = lcfirst($from_title);
        $from_href = "{$from}.php";
    }
}
try {
    $all = array();
    $counts = array();