function UpdateUser() { $user = GetUserById($_GET['id']); if (isset($_POST['is_admin']) && isset($_POST['is_banned'])) { $userArray = array('id' => $user->id, 'is_admin' => $_POST['is_admin'], 'is_banned' => $_POST['is_banned']); $result = ModelFacade::UpdateUser($userArray); switch ($result[0]) { case 0: $success = 'User ' . $user->username . ' updated successfully'; break; default: $error = 'There was an error updating the users database'; break; } $user = GetUserById($_GET['id']); include_once '/Views/Admin/User.html'; } else { header("Location: /AdminUsers.php"); } }