public function action_delete() { RoutingEngine::setPage("runnDAILY Training Delete", "PV__300"); $t_item = new TrainingLog($_POST); if ($t_item->deleteItemSecure()) { $affected_goals = Goal::getGoalIdsForUserInRange(User::$current_user->uid, $t_item->date); if ($affected_goals) { Goal::updatePercentForList($affected_goals); } Page::redirect("/training/"); } Page::redirect("/training/create?tid={$t_item->tid}"); }