public function edit($id) { if (!$id) { header("Location: /manager"); } else { if (user::accessLevel($_COOKIE['id']) == 1) { if ($_SERVER['REQUEST_METHOD'] == 'POST') { manager::UPDATE($id, $_POST['name']); if ($_GET['return-url']) { $redirect = "Location: " . $_GET['return-url']; header($redirect); } } managerController::loadView('edit', $args = array('id' => $id)); } else { //alert("YOU HAVE NO ACCESS"); header("Location: /manager/view/{$id}"); } } }