public function reportAction() { $student_id = $this->_request->getParam('s'); $_SESSION['Default']['report'] = true; $student_DB = new Application_Model_DbTable_StudentsInField(); $student = $student_DB->getRecordsForAllFields($student_id); $results = array(); foreach ($student as $row) { if ($row['grade'] && $row['goal'] && $row['date'] && $row['fieldName']) { $results[] = $row; } } if ($student && isset($student[0]) && isset($student[0]['student'])) { $this->view->student_name = $student[0]['student']; } $this->view->records = $results; }