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

iACE Weekly Reports

parent da0cd215
No related branches found
No related tags found
No related merge requests found
<?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
<?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
<?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
@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
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