hasAccess())
{
$access->setUser();
$user = $_SESSION['user'];
// The "main" page handles dashboard, ignore, log, view
if ($p == "main") {
if (isset($_POST['action'])) {
$action = $_POST['action'];
} else $action = "";
if (isset($_POST['task'])) {
$task = $_POST['task'];
} else $task = "";
if ($action == "Log") {
if ($task == "runlog") {
$log = new LogIncident($_POST);
if ($log->isValid()) {
$log->log($_POST);
echo "Message Logged
";
include('pages/view.php');
} else {
$error = TRUE;
echo "" . $log->getError() . "
";
include('pages/form.php');
}
} else include('pages/form.php');
} elseif ($action == "Ignore") {
if ($task == "runignore") {
$ignore = new IgnoreIncident($_POST['id'], $_POST['ignorereason']);
if ($ignore->isValid()) {
echo "Message Ignored
";
include('pages/dashboard.php');
} else {
echo "" . $ignore->getError() . "
";
include('pages/ignore.php');
}
} else include('pages/ignore.php');
} elseif ($action == "Merge") {
if ($task == "runmerge") {
$merge = new Merge($_POST['id'], $_POST['repid']);
echo "Merged Successfully!
";
include('pages/view.php');
} else include('pages/merge.php');
} elseif ($action == "View") {
include('pages/view.php');
} elseif ($action == "Copy") {
$copy = new Copy($_POST['pageid']);
$_POST['id'] = $copy->getId();
include('pages/form.php');
} else {
include('scripts/getMail.php');
include('pages/dashboard.php');
}
}elseif($p == "settings" && $access->getRole() == "Admin")
{
if (isset($_POST['action'])) {
$action = $_POST['action'];
} else $action = "";
if($q == "users")
{
if($action == "changerole")
{
$access->changeRole($_POST['id'], $_POST['role']);
}elseif($action == "adduser")
{
$access->addUser($_POST['netid']);
}
include_once('settings/users.php');
}elseif($q == "templates")
{
include_once('settings/templates.php');
}elseif($q == "addtemplates")
{
include_once('settings/addtemplate.php');
}elseif($q == "types")
{
include_once('settings/types.php');
}elseif($q == "college")
{
include_once('settings/college.php');
}elseif($q == "hospitals")
{
include_once('settings/hospital.php');
}
}elseif($p == "reporting" && $access->getRole() == "Admin")
{
if($q == "allincidents")
{
if(isset($_POST['id']))
{
include_once('pages/view.php');
}else include_once('reports/allincidents.php');
}elseif($q == "allpages")
{
if(isset($_POST['id']))
{
include_once('pages/view.php');
}else include_once('reports/allpages.php');
}elseif($q == "ignoredpages")
{
include_once('reports/allignored.php');
}elseif($q == "statistics")
{
include_once('reports/statistics.php');
}elseif($q == "goodsam")
{
if(isset($_POST['id']))
{
include_once('pages/view.php');
}else include_once('reports/goodsam.php');
}
}elseif($p == "followup" && ($access->getRole() == "Admin" || $access->isDSL()))
{
if(isset($_POST['id']))
{
include_once('pages/view.php');
}elseif($q == "current")
{
if(isset($_POST['id']))
{
include_once('pages/view.php');
}else include_once('reports/followup.php');
}elseif($q == "archive")
{
if(isset($_POST['id']))
{
include_once('pages/view.php');
}else include_once('reports/followup30.php');
}
}
}
require('includes/footer.php')
?>