Interments can now be deleted
git-svn-id: https://rosehill.googlecode.com/svn/trunk@68 100bd78a-fc82-11de-b5bc-ffd2847a4b57
This commit is contained in:
parent
5d50a8125d
commit
e96b604573
|
@ -62,6 +62,14 @@ $return_url = $url->__toString();
|
||||||
Edit
|
Edit
|
||||||
</button>
|
</button>
|
||||||
";
|
";
|
||||||
|
$url = new URL(BASE_URL.'/interments/deleteInterment.php');
|
||||||
|
$url->interment_id = $interment->getId();
|
||||||
|
$url->return_url = "http://$_SERVER[SERVER_NAME]$_SERVER[REQUEST_URI]";
|
||||||
|
$deleteButton = "
|
||||||
|
<button type=\"button\" class=\"delete\" onclick=\"COB.deleteConfirmation('$url');\">
|
||||||
|
Delete
|
||||||
|
</button>
|
||||||
|
";
|
||||||
}
|
}
|
||||||
$last = View::escape($interment->getLastname());
|
$last = View::escape($interment->getLastname());
|
||||||
$middle = View::escape($interment->getMiddleInitial());
|
$middle = View::escape($interment->getMiddleInitial());
|
||||||
|
@ -79,7 +87,7 @@ $return_url = $url->__toString();
|
||||||
$section_lot = View::escape(implode(', ',$section_lot));
|
$section_lot = View::escape(implode(', ',$section_lot));
|
||||||
|
|
||||||
echo "
|
echo "
|
||||||
<tr><td>$editButton</td>
|
<tr><td>$editButton $deleteButton</td>
|
||||||
<td><a href=\"{$interment->getURL()}\">$last</a></td>
|
<td><a href=\"{$interment->getURL()}\">$last</a></td>
|
||||||
<td>$middle</td>
|
<td>$middle</td>
|
||||||
<td>$first</td>
|
<td>$first</td>
|
||||||
|
|
|
@ -126,6 +126,14 @@ class Interment
|
||||||
$this->id = $zend_db->lastInsertId('interments','id');
|
$this->id = $zend_db->lastInsertId('interments','id');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function delete()
|
||||||
|
{
|
||||||
|
if ($this->id) {
|
||||||
|
$zend_db = Database::getConnection();
|
||||||
|
$zend_db->delete('interments','id='.$this->id);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------
|
//----------------------------------------------------------------
|
||||||
// Generic Getters
|
// Generic Getters
|
||||||
//----------------------------------------------------------------
|
//----------------------------------------------------------------
|
||||||
|
|
|
@ -0,0 +1,18 @@
|
||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* @copyright 2010 City of Bloomington, Indiana
|
||||||
|
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.txt
|
||||||
|
* @author Cliff Ingham <inghamn@bloomington.in.gov>
|
||||||
|
* @param GET interment_id
|
||||||
|
* @param GET return_url
|
||||||
|
*/
|
||||||
|
if (!userIsAllowed('Interments')) {
|
||||||
|
$_SESSION['errorMessages'][] = new Exception('noAccessAllowed');
|
||||||
|
header('Location: '.BASE_URL);
|
||||||
|
exit();
|
||||||
|
}
|
||||||
|
|
||||||
|
$interment = new Interment($_GET['interment_id']);
|
||||||
|
$interment->delete();
|
||||||
|
|
||||||
|
header('Location: '.$_GET['return_url']);
|
Loading…
Reference in New Issue