CreateGreenBox("Successful", "Your submission has been added into the database, and will be reviewed by one of our admins");
        } else {
            CreateRedBox("Error", "There was an error uploading your demo to the server. Please try again later.");
            $log = new CSystemLog("e", "Demo Upload Failed", "A demo failed to upload for a submission from (" . $Email . ")");
        }
    }
}
//$mod_list = $GLOBALS['db']->GetAssoc("SELECT mid,name FROM ".DB_PREFIX."_mods WHERE `mid` > 0 AND `enabled`= 1 ORDER BY mid ");
require_once INCLUDES_PATH . '/CServerInfo.php';
//serverlist
$server_list = $GLOBALS['db']->Execute("SELECT sid, ip, port FROM `" . DB_PREFIX . "_servers` WHERE enabled = 1 ORDER BY modid, sid");
$servers = array();
while (!$server_list->EOF) {
    $info = array();
    $sinfo = new CServerInfo($server_list->fields[1], $server_list->fields[2]);
    $info = $sinfo->getInfo();
    if (empty($info['hostname'])) {
        $info['hostname'] = "Error Connecting (" . $server_list->fields[1] . ":" . $server_list->fields[2] . ")";
    }
    $info['sid'] = $server_list->fields[0];
    array_push($servers, $info);
    $server_list->MoveNext();
}
$theme->assign('STEAMID', $SteamID == "" ? "STEAM_0:" : $SteamID);
$theme->assign('ban_ip', $BanIP);
$theme->assign('ban_reason', $BanReason);
$theme->assign('player_name', $PlayerName);
$theme->assign('subplayer_name', $SubmitterName);
$theme->assign('player_email', $Email);
$theme->assign('server_list', $servers);
$theme->assign('server_selected', $SID);
function ServerHostPlayers_list($sid, $type = "servers", $obId = "")
{
    $objResponse = new xajaxResponse();
    require INCLUDES_PATH . '/CServerInfo.php';
    $sids = explode(";", $sid, -1);
    if (count($sids) < 1) {
        return $objResponse;
    }
    $ret = "";
    for ($i = 0; $i < count($sids); $i++) {
        $sid = (int) $sids[$i];
        $res = $GLOBALS['db']->GetRow("SELECT sid, ip, port FROM " . DB_PREFIX . "_servers WHERE sid = {$sid}");
        if (empty($res[1]) || empty($res[2])) {
            return $objResponse;
        }
        $info = array();
        $sinfo = new CServerInfo($res[1], $res[2]);
        $info = $sinfo->getInfo();
        if (!empty($info['hostname'])) {
            $ret .= trunc($info['hostname'], 48, false) . "<br />";
        } else {
            $ret .= "<b>Error connecting</b> (<i>" . $res[1] . ":" . $res[2] . "</i>)<br />";
        }
    }
    if ($type == "id") {
        $objResponse->addAssign("{$obId}", "innerHTML", $ret);
    } else {
        $objResponse->addAssign("ban_server_{$type}", "innerHTML", $ret);
    }
    return $objResponse;
}
function CreateHostnameCache()
{
    require_once INCLUDES_PATH . '/CServerInfo.php';
    $res = $GLOBALS['db']->Execute("SELECT sid, ip, port FROM " . DB_PREFIX . "_servers ORDER BY sid");
    $servers = array();
    while (!$res->EOF) {
        $info = array();
        $sinfo = new CServerInfo($res->fields[1], $res->fields[2]);
        $info = $sinfo->getInfo();
        if (!empty($info['hostname'])) {
            $servers[$res->fields[0]] = $info['hostname'];
        } else {
            $servers[$res->fields[0]] = $res->fields[1] . ":" . $res->fields[2];
        }
        $res->MoveNext();
    }
    return $servers;
}