Example #1
0
 public function action_save()
 {
     RoutingEngine::setPage("runnDAILY Training Save", "PV__300");
     $t_item = new TrainingLog($_POST);
     if (array_safe($_POST, "t_rid") == "") {
         $t_item->rid = null;
     }
     if ($t_item->createItem()) {
         $affected_goals = Goal::getGoalIdsForUserInRange(User::$current_user->uid, $t_item->date);
         if ($affected_goals) {
             Goal::updatePercentForList($affected_goals);
         }
         Page::redirect("/training/");
     }
     Page::redirect("/training/");
 }