<?php $zonename = $_POST['zonename']; $zone = Zone::loadById($_POST['zoneid']); $zone->setName($zonename); $zone->save(); header("Location: " . e_SELF);
<?php global $ns; $zone = Zone::loadById($_GET['id']); $text .= "\n<script type=\"application/javascript\">\nfunction submitEditZone() {\n\tif (document.editzone.zonename.value == \"\") {\n\t\talert(\"You must specify a zone name.\");\n\t\tdocument.editzone.zonename.style.border = \"3px solid #FF0000\";\n\t} else {\n\t\tdocument.editzone.submit();\n\t}\n}\n</script>\n<div style=\"text-align: center;\">\n<h2>Edit Zone</h2>\n<form name=\"editzone\" method=\"post\" action=\"" . e_SELF . "?action=update\">\n<table>\n<tr><td><label for=\"zonename\">Zone Name</label></td><td><input type=\"text\" name=\"zonename\" value=\"" . $zone->getName() . "\"/></td></tr>\n<tr><td colspan=\"2\"><input type=\"button\" value=\"Reset Form\" onclick=\"javascript: document.editzone.reset();\"/><input type=\"button\" value=\"Edit Zone\" onclick=\"javascript: submitEditZone();\"/></td></tr>\n</table>\n<input type=\"hidden\" name=\"zoneid\" value=\"" . $zone->getId() . "\"/>\n</form>\n"; $text .= "<a href=\"admin_e107dkp.php\">Main Menu</a>"; $text .= "</div>"; $ns->tableRender("<a href=\"admin_e107dkp.php\">Main Menu</a> -> <a href=\"" . e_SELF . "\">Manage Zones</a> -> Edit Zone", $text);
private function _setZone($zone) { if ($zone instanceof Zone) { $this->_zone = $zone; } else { $this->_zone = Zone::loadById($zone); } }