query(get_query($table));
    } catch (PDOException $ex) {
        die($ex->getMessage());
    }
    return $result;
}
function get_avatar($name) {
    return " " . $name;
}
$uuid_name_cache = [];
function get_name($uuid) {
    global $conn, $table_history, $uuid_name_cache;
    if (array_key_exists($uuid, $uuid_name_cache)) return $uuid_name_cache[$uuid];
    $stmt = $conn->prepare("SELECT name FROM " . $table_history . " WHERE uuid=? ORDER BY date DESC LIMIT 1");
    if ($stmt->execute(array($uuid)) && $row = $stmt->fetch()) {
        $banner = $row['name'];
        $uuid_name_cache[$uuid] = $banner;
        return $banner;
    }
    return null;
}
function get_banner_name($row) {
    $uuid = $row['banned_by_uuid'];
    $name = get_name($uuid);
    if ($name !== null) {
        return $name;
    }
    $name = $row['banned_by_name'];
    return clean($name);
}
function millis_to_date($millis) {
    global $date_format;
    date_default_timezone_set("UTC");
    return date($date_format, $millis / 1000);
}
/**
 * Prepares text to be displayed on the web interface.
 * Removes chat colours, replaces newlines with proper HTML, and sanitizes the text.
 * @param $text
 * @return mixed|string
 */
function clean($text) {
    if (strstr($text, "\xa7") || strstr($text, "&")) {
        $regex = "/(?i)(\xa7|&)[0-9A-FK-OR]/";
        $text = preg_replace($regex, "", $text);
    }
    $text = htmlspecialchars($text, ENT_QUOTES, 'UTF-8');
    if (strstr($text, "\n")) {
        $text = preg_replace("/\n/", "
" . $name;
}
$uuid_name_cache = [];
function get_name($uuid) {
    global $conn, $table_history, $uuid_name_cache;
    if (array_key_exists($uuid, $uuid_name_cache)) return $uuid_name_cache[$uuid];
    $stmt = $conn->prepare("SELECT name FROM " . $table_history . " WHERE uuid=? ORDER BY date DESC LIMIT 1");
    if ($stmt->execute(array($uuid)) && $row = $stmt->fetch()) {
        $banner = $row['name'];
        $uuid_name_cache[$uuid] = $banner;
        return $banner;
    }
    return null;
}
function get_banner_name($row) {
    $uuid = $row['banned_by_uuid'];
    $name = get_name($uuid);
    if ($name !== null) {
        return $name;
    }
    $name = $row['banned_by_name'];
    return clean($name);
}
function millis_to_date($millis) {
    global $date_format;
    date_default_timezone_set("UTC");
    return date($date_format, $millis / 1000);
}
/**
 * Prepares text to be displayed on the web interface.
 * Removes chat colours, replaces newlines with proper HTML, and sanitizes the text.
 * @param $text
 * @return mixed|string
 */
function clean($text) {
    if (strstr($text, "\xa7") || strstr($text, "&")) {
        $regex = "/(?i)(\xa7|&)[0-9A-FK-OR]/";
        $text = preg_replace($regex, "", $text);
    }
    $text = htmlspecialchars($text, ENT_QUOTES, 'UTF-8');
    if (strstr($text, "\n")) {
        $text = preg_replace("/\n/", "
", $text);
    }
    return $text;
}
?>