The interment list is now sortable
git-svn-id: https://rosehill.googlecode.com/svn/branches/php@26 100bd78a-fc82-11de-b5bc-ffd2847a4b57
This commit is contained in:
parent
4f5971b522
commit
31dad3a967
|
@ -4,7 +4,10 @@
|
|||
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.txt
|
||||
* @author Cliff Ingham <inghamn@bloomington.in.gov>
|
||||
* @param IntermentList $this->intermentList
|
||||
* @param GET sort
|
||||
*/
|
||||
$previousSort = isset($_GET['sort']) ? $_GET['sort'] : 'deceasedDate';
|
||||
$url = new URL($_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI']);
|
||||
?>
|
||||
<div class="interfaceBox">
|
||||
<h1>
|
||||
|
@ -22,9 +25,21 @@
|
|||
<table>
|
||||
<thead>
|
||||
<tr><th></th>
|
||||
<th>Last Name</th>
|
||||
<th>First Name</th>
|
||||
<th>Date of Death</th>
|
||||
<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>
|
||||
<th>Cemetery</th>
|
||||
<th>Section & Lot</th>
|
||||
</tr>
|
||||
|
|
|
@ -28,11 +28,16 @@ class IntermentList extends ZendDbResultIterator
|
|||
* @param int $itemsPerPage Turns on Pagination
|
||||
* @param int $currentPage
|
||||
*/
|
||||
public function __construct($fields=null,$itemsPerPage=null,$currentPage=null)
|
||||
public function __construct($fields=null,$order=null,$itemsPerPage=null,$currentPage=null)
|
||||
{
|
||||
parent::__construct($itemsPerPage,$currentPage);
|
||||
if (is_array($fields)) {
|
||||
$this->find($fields);
|
||||
if ($order) {
|
||||
$this->find($fields,$order);
|
||||
}
|
||||
else {
|
||||
$this->find($fields);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -44,7 +49,7 @@ class IntermentList extends ZendDbResultIterator
|
|||
* @param int $limit
|
||||
* @param string|array $groupBy Multi-column group by should be given as an array
|
||||
*/
|
||||
public function find($fields=null,$order='id',$limit=null,$groupBy=null)
|
||||
public function find($fields=null,$order='deceasedDate',$limit=null,$groupBy=null)
|
||||
{
|
||||
$this->select->from('interments');
|
||||
|
||||
|
|
|
@ -35,7 +35,8 @@ foreach ($_GET as $field=>$value) {
|
|||
}
|
||||
|
||||
if (count($search)) {
|
||||
$intermentList = new IntermentList($search,20,$currentPage);
|
||||
$order = isset($_GET['sort']) ? $_GET['sort'] : null;
|
||||
$intermentList = new IntermentList($search,$order,20,$currentPage);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -14,8 +14,7 @@
|
|||
.pageNavigation ul{ display:inline; }
|
||||
.pageNavigation li { padding-left:5px; }
|
||||
|
||||
|
||||
.searchInterment th {text-align:left; width:75px; }
|
||||
.searchInterment th { text-align:left; width:75px; }
|
||||
|
||||
table { margin:8px 0; overflow:auto; }
|
||||
tr { }
|
||||
|
@ -30,4 +29,6 @@ tbody th {
|
|||
height:8pt; padding:4px 4px 2px 2px;
|
||||
}
|
||||
th a:link,th a:visited { color:#3366cc; background-color:inherit; }
|
||||
form table { border:none; }
|
||||
form table { border:none; }
|
||||
|
||||
a.sorting { }
|
Loading…
Reference in New Issue