Esempio n. 1
0
<?php

global $ns;
$zonestable = new RaidZonesTable();
$zones = $zonestable->fetchAll();
$text .= "<div style=\"text-align: center;\">";
if ($zones->count()) {
    $text .= "<table>";
    $text .= "<tr><th>" . LAN_ADMIN_ZONES_INDEX_ZONENAME . "</th><th>" . LAN_ADMIN_COMMON_EDIT . "</th><th>" . LAN_ADMIN_COMMON_DELETE . "</th></tr>";
    foreach ($zones as $zone) {
        $text .= "<tr><td>" . $zone->name . "</td><td><a href=\"?action=edit&id=" . $zone->id . "\">Edit</a></td><td><a href=\"?action=delete&id=" . $zone->id . "\" onclick=\"javascript: return confirm('Are you sure you want to delete " . $zone->name . "?');\">Delete</a></td></tr>";
    }
    $text .= "</table>";
} else {
    $text .= "<p>" . LAN_ADMIN_ZONES_INDEX_NOZONES . ".</p>";
}
$text .= "<a href=\"?action=add\">" . LAN_ADMIN_ZONES_INDEX_CREATE . "</a><br/><br/>";
$text .= "<a href=\"admin_e107dkp.php\">" . LAN_ADMIN_COMMON_MAINMENU . "</a>";
$text .= "</div>";
$ns->tableRender("<a href=\"admin_e107dkp.php\">Main Menu</a> -> " . LAN_ADMIN_ZONES_INDEX_TITLE, $text);
Esempio n. 2
0
<?php

$zonename = $_POST['zonename'];
$raidzonestable = new RaidZonesTable();
$zone = $raidzonestable->createRow();
$zone->name = $zonename;
$zone->save();
header("Location: " . e_SELF);
Esempio n. 3
0
<?php

global $ns;
$raidzonestable = new RaidZonesTable();
$zone = $raidzonestable->fetchById($_GET['id']);
if ($zone) {
    $text .= "\n\t<script type=\"application/javascript\">\n\tfunction submitEditZone() {\n\t\tif (document.editzone.zonename.value == \"\") {\n\t\t\talert(\"" . LAN_ADMIN_ZONES_EDIT_NONAME . ".\");\n\t\t\tdocument.editzone.zonename.style.border = \"3px solid #FF0000\";\n\t\t} else {\n\t\t\tdocument.editzone.submit();\n\t\t}\n\t}\n\t</script>\n\t<div style=\"text-align: center;\">\n\t<h2>" . LAN_ADMIN_ZONES_EDIT_TITLE . "</h2>\n\t<form name=\"editzone\" method=\"post\" action=\"" . e_SELF . "?action=update\">\n\t<table>\n\t<tr><td><label for=\"zonename\">" . LAN_ADMIN_ZONES_EDIT_ZONENAME . "</label></td><td><input type=\"text\" name=\"zonename\" value=\"" . $zone->name . "\"/></td></tr>\n\t<tr><td colspan=\"2\"><input type=\"button\" value=\"" . LAN_ADMIN_COMMON_RESET . "\" onclick=\"javascript: document.editzone.reset();\"/><input type=\"button\" value=\"" . LAN_ADMIN_ZONES_EDIT_EDITZONE . "\" onclick=\"javascript: submitEditZone();\"/></td></tr>\n\t</table>\n\t<input type=\"hidden\" name=\"zoneid\" value=\"" . $zone->id . "\"/>\n\t</form>\n\t";
    $text .= "<a href=\"admin_e107dkp.php\">" . LAN_ADMIN_COMMON_MAINMENU . "</a>";
    $text .= "</div>";
} else {
    $text .= "<div style=\"text-align: center;\"><p>" . LAN_ADMIN_ZONES_EDIT_NOSUCHZONE . "</p><a href=\"" . e_SELF . "\">Back</a></div>";
}
$ns->tableRender("<a href=\"admin_e107dkp.php\">" . LAN_ADMIN_COMMON_MAINMENU . "</a> -> <a href=\"" . e_SELF . "\">" . LAN_ADMIN_ZONES_EDIT_PARENTTITLE . "</a> -> " . LAN_ADMIN_ZONES_EDIT_TITLE, $text);
Esempio n. 4
0
<?php

$raidzonestable = new RaidZonesTable();
$zone = $raidzonestable->fetchById($_POST['zoneid']);
if ($zone) {
    $zone->name = $_POST['zonename'];
    var_dump($zone);
    $zone->save();
}
header("Location: " . e_SELF);