diff --git a/blocks/html/interments/intermentList.inc b/blocks/html/interments/intermentList.inc
index 779ccef..8798af6 100644
--- a/blocks/html/interments/intermentList.inc
+++ b/blocks/html/interments/intermentList.inc
@@ -4,7 +4,10 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.txt
* @author Cliff Ingham
* @param IntermentList $this->intermentList
+ * @param GET sort
*/
+$previousSort = isset($_GET['sort']) ? $_GET['sort'] : 'deceasedDate';
+$url = new URL($_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI']);
?>
@@ -22,9 +25,21 @@
|
- Last Name |
- First Name |
- Date of Death |
+ sort = $previousSort=='lastname' ? 'lastname desc' : 'lastname';
+ echo "Last Name";
+ ?>
+ |
+ sort = $previousSort=='firstname' ? 'firstname desc' : 'firstname';
+ echo "First Name";
+ ?>
+ |
+ sort = $previousSort=='deceasedDate' ? 'deceasedDate desc' : 'deceasedDate';
+ echo "Date of Death";
+ ?>
+ |
Cemetery |
Section & Lot |
diff --git a/classes/IntermentList.php b/classes/IntermentList.php
index 7b320d4..e59c527 100644
--- a/classes/IntermentList.php
+++ b/classes/IntermentList.php
@@ -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');
diff --git a/html/interments/home.php b/html/interments/home.php
index e530ae4..6d2c613 100644
--- a/html/interments/home.php
+++ b/html/interments/home.php
@@ -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);
}
diff --git a/html/skins/local/screen.css b/html/skins/local/screen.css
index eec4544..0549ec5 100644
--- a/html/skins/local/screen.css
+++ b/html/skins/local/screen.css
@@ -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; }
\ No newline at end of file
+form table { border:none; }
+
+a.sorting { }
\ No newline at end of file