public function targetsAction() { $group_id = $this->_request->getParam('g'); if ($group_id) { $target_DB = new Application_Model_DbTable_Target(); //$level_DB = new Application_Model_DbTable_Level(); $targets = $target_DB->getAll($_SESSION['Default']['field']); $_targets = array(); foreach ($targets as $t) { $t['subgoals'] = $target_DB->getAllSubGoals($t['goalID']); $_targets[] = $t; } $this->view->group_id = $group_id; $this->view->targets = $_targets; $groups_DB = new Application_Model_DbTable_Group(); $this->view->groupName = $groups_DB->getName($group_id); } }
public function subgoalsAction() { $goalID = $this->_request->getParam('g'); $goals_DB = new Application_Model_DbTable_Target(); $subgoals = $goals_DB->getAllSubGoals($goalID); $_subgoals = array(); foreach ($subgoals as $s) { $s['subgoals'] = $goals_DB->getAllSubGoals($s['goalID']); $_subgoals[] = $s; } $this->view->subgoals = $_subgoals; $this->view->goalParent = $goalID; }