2009-12-18 16:54:06 +00:00
|
|
|
<?php
|
|
|
|
/**
|
|
|
|
* @copyright 2009 City of Bloomington, Indiana
|
|
|
|
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.txt
|
|
|
|
* @author Cliff Ingham <inghamn@bloomington.in.gov>
|
2009-12-18 17:40:05 +00:00
|
|
|
* @param IntermentList $this->intermentList
|
2010-01-06 15:34:36 +00:00
|
|
|
* @param GET sort
|
2009-12-18 16:54:06 +00:00
|
|
|
*/
|
2010-01-06 15:34:36 +00:00
|
|
|
$previousSort = isset($_GET['sort']) ? $_GET['sort'] : 'deceasedDate';
|
|
|
|
$url = new URL($_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI']);
|
2009-12-18 16:54:06 +00:00
|
|
|
?>
|
|
|
|
<div class="interfaceBox">
|
|
|
|
<h1>
|
|
|
|
<?php
|
2009-12-18 17:40:05 +00:00
|
|
|
if (userIsAllowed('Interments')) {
|
2009-12-18 16:54:06 +00:00
|
|
|
echo "
|
2009-12-18 17:40:05 +00:00
|
|
|
<button type=\"button\" class=\"add\" onclick=\"document.location.href='".BASE_URL."/interments/addInterment.php';\">
|
2009-12-18 16:54:06 +00:00
|
|
|
Add
|
|
|
|
</button>
|
|
|
|
";
|
|
|
|
}
|
|
|
|
?>
|
2009-12-18 17:40:05 +00:00
|
|
|
Interments
|
2009-12-18 16:54:06 +00:00
|
|
|
</h1>
|
|
|
|
<table>
|
|
|
|
<thead>
|
|
|
|
<tr><th></th>
|
2010-01-06 15:34:36 +00:00
|
|
|
<th><?php
|
|
|
|
$url->sort = $previousSort=='lastname' ? 'lastname desc' : 'lastname';
|
|
|
|
echo "<a href=\"$url\" class=\"sorting\">Last Name</a>";
|
|
|
|
?>
|
|
|
|
</th>
|
|
|
|
<th><?php
|
|
|
|
$url->sort = $previousSort=='firstname' ? 'firstname desc' : 'firstname';
|
|
|
|
echo "<a href=\"$url\" class=\"sorting\">First Name</a>";
|
|
|
|
?>
|
|
|
|
</th>
|
|
|
|
<th><?php
|
|
|
|
$url->sort = $previousSort=='deceasedDate' ? 'deceasedDate desc' : 'deceasedDate';
|
|
|
|
echo "<a href=\"$url\" class=\"sorting\">Date of Death</a>";
|
|
|
|
?>
|
|
|
|
</th>
|
2009-12-18 16:54:06 +00:00
|
|
|
<th>Cemetery</th>
|
|
|
|
<th>Section & Lot</th>
|
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
<tbody>
|
|
|
|
<?php
|
2009-12-18 17:40:05 +00:00
|
|
|
foreach ($this->intermentList as $interment) {
|
2009-12-18 16:54:06 +00:00
|
|
|
$editButton = '';
|
2009-12-18 17:40:05 +00:00
|
|
|
if (userIsAllowed('Interments')) {
|
|
|
|
$url = new URL(BASE_URL.'/interments/updateInterment.php');
|
|
|
|
$url->interment_id = $interment->getId();
|
2009-12-18 16:54:06 +00:00
|
|
|
$editButton = "
|
|
|
|
<button type=\"button\" class=\"edit\" onclick=\"document.location.href='$url';\">
|
|
|
|
Edit
|
|
|
|
</button>
|
|
|
|
";
|
|
|
|
}
|
2009-12-18 17:40:05 +00:00
|
|
|
$last = View::escape($interment->getLastname());
|
|
|
|
$first = View::escape($interment->getFirstname());
|
|
|
|
$date = $interment->getDeceasedDate('n/j/Y');
|
|
|
|
$cemetery = View::escape($interment->getCemetery());
|
2009-12-18 16:54:06 +00:00
|
|
|
|
|
|
|
$section_lot = array();
|
2009-12-18 17:40:05 +00:00
|
|
|
if ($interment->getSection()) {
|
|
|
|
$section_lot[] = $interment->getSection();
|
2009-12-18 16:54:06 +00:00
|
|
|
}
|
2009-12-18 17:40:05 +00:00
|
|
|
if ($interment->getLot()) {
|
|
|
|
$section_lot[] = $interment->getLot();
|
2009-12-18 16:54:06 +00:00
|
|
|
}
|
|
|
|
$section_lot = View::escape(implode(', ',$section_lot));
|
|
|
|
|
|
|
|
echo "
|
|
|
|
<tr><td>$editButton</td>
|
2009-12-18 20:57:41 +00:00
|
|
|
<td><a href=\"{$interment->getURL()}\">$last</a></td>
|
2009-12-18 16:54:06 +00:00
|
|
|
<td>$first</td>
|
|
|
|
<td>$date</td>
|
|
|
|
<td>$cemetery</td>
|
|
|
|
<td>$section_lot</td>
|
|
|
|
</tr>
|
|
|
|
";
|
|
|
|
}
|
|
|
|
?>
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
</div>
|
|
|
|
<?php
|
2009-12-18 17:40:05 +00:00
|
|
|
if ($this->intermentList->getPaginator()) {
|
2009-12-18 16:54:06 +00:00
|
|
|
$pageNavigation = new Block('pageNavigation.inc',
|
2009-12-18 17:40:05 +00:00
|
|
|
array('pages'=>$this->intermentList->getPaginator()->getPages()));
|
2009-12-18 16:54:06 +00:00
|
|
|
echo $pageNavigation->render('html');
|
|
|
|
}
|
|
|
|
?>
|