*/
include "../core.php";
// Admin Check
$user = UserManager::getLocalUser();
if (!$user->isAdmin()) {
    PageManager::displayErrorPage("access");
    return;
}
$page = new Page($smarty, "modals/AdminGameserverAdd.tpl");
// Users
$c = UserManager::getAllUsers();
if ($c === false) {
    $page->assign("t_Report", Reporting::info("There are no users yet. Try <a href='" . Core::GetConfig("dirRoot") . "Customer'>adding one</a>."));
} else {
    $page->assign("customerArrayData", $c);
}
// Templates
$c = TemplateManager::getAllGameserverTemplates();
if ($c == false) {
    $page->assign("t_Report", Reporting::info("There are no not gameserver templates yet. Try <a href='" . Core::GetConfig("dirRoot") . "Templates'>adding one</a>."));
} else {
    $page->assign("templateArrayData", $c);
}
// Physical Servers
$c = PhysicalServerManager::getAllPhysicalServer();
if ($c === false) {
    $page->assign("t_Report", Reporting::info("There are no servers yet. Try <a href='" . Core::GetConfig("dirRoot") . "Server'>adding one</a>."));
} else {
    $page->assign("serverArrayData", $c);
}
$page->display();