2010-01-04 15:47:15 +00:00
|
|
|
<?php
|
|
|
|
/**
|
|
|
|
* @copyright 2010 City of Bloomington, Indiana
|
2011-06-14 13:29:37 +00:00
|
|
|
* @license http://www.gnu.org/licenses/agpl.txt GNU/AGPL, see LICENSE.txt
|
2010-01-04 15:47:15 +00:00
|
|
|
* @author Cliff Ingham <inghamn@bloomington.in.gov>
|
|
|
|
* @param GET section_id
|
|
|
|
*/
|
|
|
|
if (!userIsAllowed('Sections')) {
|
|
|
|
$_SESSION['errorMessages'][] = new Exception('noAccessAllowed');
|
|
|
|
header('Location: '.BASE_URL.'/sections');
|
|
|
|
exit();
|
|
|
|
}
|
|
|
|
|
|
|
|
$section = new Section($_REQUEST['section_id']);
|
2010-01-04 19:44:12 +00:00
|
|
|
if (isset($_POST['section_id'])) {
|
2010-01-04 15:47:15 +00:00
|
|
|
$section->setCode($_POST['code']);
|
|
|
|
$section->setName($_POST['name']);
|
|
|
|
|
|
|
|
try {
|
|
|
|
$section->save();
|
2010-01-04 19:44:12 +00:00
|
|
|
if (isset($_FILES)) {
|
|
|
|
if (isset($_FILES['highlight_map']) && $_FILES['highlight_map']['tmp_name']) {
|
|
|
|
$section->saveMap($_FILES['highlight_map'],'highlight');
|
|
|
|
}
|
|
|
|
if (isset($_FILES['zoom_map']) && $_FILES['zoom_map']['tmp_name']) {
|
|
|
|
$section->saveMap($_FILES['zoom_map'],'zoom');
|
|
|
|
}
|
|
|
|
}
|
2010-01-04 20:23:16 +00:00
|
|
|
header('Location: '.$section->getCemetery()->getURL());
|
2010-01-04 15:47:15 +00:00
|
|
|
exit();
|
|
|
|
}
|
|
|
|
catch (Exception $e) {
|
|
|
|
$_SESSION['errorMessages'][] = $e;
|
|
|
|
}
|
2010-01-04 19:44:12 +00:00
|
|
|
|
2010-01-04 15:47:15 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
$template = new Template();
|
|
|
|
$template->blocks[] = new Block('sections/updateSectionForm.inc',array('section'=>$section));
|
|
|
|
echo $template->render();
|