diff --git a/application/modules/default/views/scripts/naked-layout.phtml b/application/modules/default/views/scripts/naked-layout.phtml new file mode 100644 index 0000000000000000000000000000000000000000..b2fdde452425ccc93a4219b7a4c533e5fa438273 --- /dev/null +++ b/application/modules/default/views/scripts/naked-layout.phtml @@ -0,0 +1,20 @@ +<?php echo "<?xml version='1.0' encoding='UTF-8'?>\n"; ?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en" > + + <head> + <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> + <title><?php echo $this->layout()->title; ?></title> + <link rel="shortcut icon" href="/ucomm/templatedependents/templatesharedcode/includes/metanfavico/favicon.ico" /> + + <?php echo $this->headLink()->__toString(); ?> + <?php echo $this->headMeta()->__toString(); ?> + <?php echo $this->headScript()->__toString(); ?> + <?php echo $this->headStyle()->__toString(); ?> + </head> + + <body onload="handleOnLoad('/~tsteiner/CREQ3');"> + <?php echo $this->layout()->content; ?> + </body> + +</html> \ No newline at end of file diff --git a/application/modules/iace/controllers/ReportsController.php b/application/modules/iace/controllers/ReportsController.php new file mode 100644 index 0000000000000000000000000000000000000000..a9c668e056af94e10d9ed52b97b29b51befc3957 --- /dev/null +++ b/application/modules/iace/controllers/ReportsController.php @@ -0,0 +1,79 @@ +<?php + +class Iace_ReportsController extends App_Controller_Action +{ + + public function indexAction() + { + // + } + + public function weeklyAction() + { + $filters = array(); + $validators = array( + 'year' => 'Digits', + 'month' => 'Digits', + 'day' => 'Digits' + ); + $in = new Zend_Filter_Input($filters, $validators, $this->_getAllParams()); + if ($in->isValid()) { + $endDate = new Zend_Date(); + $endDate->setYear($in->year); + $endDate->setMonth($in->month); + $endDate->setDay($in->day); + $endDate->setHour(0); + $endDate->setMinute(0); + $endDate->setSecond(0); + $endDate->addDay(1); + $startDate = clone $endDate; + $startDate->subDay(8); + } else { + $endDate = new Zend_Date(0); + $startDate = $startDate; + } + + $db = Zend_Registry::get('db'); + $select = new Zend_Db_Select($db); + $select->from(array('h' => 'creqApprovalHistories'), array('time')); + $select->join(array('r' => 'creqRequests'), 'h.request = r.requestId', array('r.requestId')); + $select->where('h.approvalActionName = ?', 'Make Official'); + $select->where('r.type = 7'); + $select->where('h.time >= ?', $startDate->getTimestamp()); + $select->where('h.time < ?', $endDate->getTimestamp()); + + $data = $select->query()->fetchAll(); + $requestIds = array(); + $finalizeTimes = array(); + foreach ($data as $row) { + $requestIds[] = $row['requestId']; + $finalizeTimes[$row['requestId']] = $row['time']; + } + + $requests = Requests_RequestModel::find($requestIds); + $courses = Courses_CourseModel::findLatestOfRequest($requests); + + $courses->orderBy('getCourseCode'); + + $data = array(); + foreach ($courses as $requestId => $course) { + $request = $requests[$requestId]; + $finalizeTime = $finalizeTimes[$request->getId()]; + foreach ($course->getAceOutcomes() as $aceOutcome) { + $data[] = array( + 'slo' => substr($aceOutcome['slo'], 3), + 'courseCode' => $course->getCourseCode(), + 'college' => $course->getCollege(), + 'title' => $course->getTitle(), + 'finalizeTime' => $finalizeTime + ); + } + } + + //$this->_helper->layout->disableLayout(); + $this->_helper->layout->setLayout('naked-layout'); + $this->view->data = $data; + $this->view->endDate = $endDate->subDay(1); + } + +} \ No newline at end of file diff --git a/application/modules/iace/views/scripts/reports/weekly.phtml b/application/modules/iace/views/scripts/reports/weekly.phtml new file mode 100644 index 0000000000000000000000000000000000000000..cce4c9c1d131d5b15aa8071c941cf84de118d49f --- /dev/null +++ b/application/modules/iace/views/scripts/reports/weekly.phtml @@ -0,0 +1,28 @@ +<?php $this->headLink()->appendStylesheet($this->baseUrl() . '/css/iace/reports/weekly.css', 'all'); ?> +<?php $this->layout()->tagline = ''; ?> +<?php $this->layout()->hideMenu = true; ?> + +<h2> + ACE Certified Courses<br /> + Interim ACE Committee<br /> + Week Ending <?php echo date('F j, Y', $this->endDate->getTimestamp()); ?> +</h2> + +<table> + <tr> + <th>SLO</th> + <th>Course</th> + <th>College</th> + <th>Title</th> + <th>Certified</th> + </tr> + <?php foreach ($this->data as $record) { ?> + <tr <?php if ($rowCount++ % 2) { ?>class="even"<?php } ?>> + <td><?php echo $record['slo']; ?></td> + <td><?php echo $record['courseCode']; ?></td> + <td><?php echo $record['college']; ?></td> + <td><?php echo $record['title']; ?></td> + <td><?php echo date('n/j/Y', $record['finalizeTime']); ?></td> + </tr> + <? } ?> +</table> \ No newline at end of file diff --git a/document_root/css/iace/reports/weekly.css b/document_root/css/iace/reports/weekly.css new file mode 100644 index 0000000000000000000000000000000000000000..64030627a730fabde308dd87ca6d852d223a8af9 --- /dev/null +++ b/document_root/css/iace/reports/weekly.css @@ -0,0 +1,23 @@ +@CHARSET "UTF-8"; + +h2 { + text-align: center; + font-size: 14px; +} + +table { + width: 100%; +} + +table th { + background-color: #ccd; + text-align: left; + padding: 0.2em 0.5em; +} + +table tr.even { + background-color: #eee; +} +table td { + padding: 0.2em 0.5em; +} \ No newline at end of file