Skip to content
Snippets Groups Projects
Commit a6072f5d authored by Tim Steiner's avatar Tim Steiner
Browse files

Added an annual csv report to the UCC module.

parent dda5ba6e
No related branches found
No related tags found
No related merge requests found
......@@ -48,13 +48,53 @@ class Ucc_ReportsController extends App_Controller_Action
}
}
public function annualAction()
{
$year = $this->_getParam('year');
$startDate = new Zend_Date();
$startDate->setYear($year);
$startDate->setMonth(1);
$startDate->setDay(1);
$startDate->setHour(0);
$startDate->setMinute(0);
$startDate->setSecond(0);
$endDate = clone $startDate;
$endDate->addMonth(1);
$data = new Unl_Model_Collection('Unl_Model_Array');
for ($i = 0; $i < 12; $i++) {
$data->merge($this->_getSummaryData($startDate, $endDate, 31), TRUE);
$data->merge($this->_getSummaryData($startDate, $endDate, 313), TRUE);
$data->merge($this->_getSummaryData($startDate, $endDate, 325), TRUE);
$startDate->addMonth(1);
$endDate->addMonth(1);
}
echo '"Date","College","Course Code","Type","Result"'. PHP_EOL;
foreach ($data as $row) {
echo '"' . date('m-d-y', $row->getTime()) . '",'
. '"' . $row->getCollege() . '",'
. '"' . $row->getCourseCode() . '",'
. '"' . $row->getType() . '",'
. '"' . ($row->getVoteResult() == 'Approve' ? 'Approved' : 'Not Approved') . '"'
. PHP_EOL;
}
header('Content-Disposition: attachment; filename="UCC ' . $year . ' Report.csv"');
exit;
}
protected function _monthlySummaryReport($startDate, $endDate)
{
$this->view->data = $this->_getSummaryData($startDate, $endDate, 31);
$this->view->aceData = $this->_getSummaryData($startDate, $endDate, 313);
$this->view->aceData->merge($this->_getSummaryData($startDate, $endDate, 325), TRUE);
$this->render('monthly-summary');
}
......@@ -109,7 +149,8 @@ class Ucc_ReportsController extends App_Controller_Action
'esAreas' => $originalCourse->getEssentialStudiesAreas(),
'crosslist' => $originalCourse->getCrosslistingsText(),
'course' => $originalCourse->getCourseId(),
'voteResult' => $voteResult
'voteResult' => $voteResult,
'type' => $request->getTypeDescription()
));
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment