public function view($id) { if (!isset($id)) { Page::redirect("/goals"); } RoutingEngine::setPage("runnDAILY View Goal", "PV__300"); $goal = Goal::getGoalById($id); $training_items = TrainingLog::getItemsForUserForGoalView(User::$current_user->uid, $goal->start, $goal->end); $goal->buildGoalDataUsingTrainingItems($training_items); RoutingEngine::getSmarty()->assign("goal", $goal); RoutingEngine::getSmarty()->assign("training_items", $training_items); }
public static function updatePercentForList($goal_list) { foreach ($goal_list as $item) { $goal = Goal::getGoalById($item['go_id']); $goal->updatePercent(); } }