Gazelle/sections/reportsv2/ajax_update_resolve.php

37 lines
756 B
PHP
Raw Normal View History

2011-03-28 14:21:28 +00:00
<?
// perform the back end of updating a resolve type
2013-05-04 08:00:48 +00:00
if (!check_perms('admin_reports')) {
2011-03-28 14:21:28 +00:00
error(403);
}
2013-05-04 08:00:48 +00:00
if (empty($_GET['newresolve'])) {
2011-03-28 14:21:28 +00:00
echo "No new resolve";
die();
}
2015-11-20 08:00:28 +00:00
$ReportID = (int) $_GET['reportid'];
$CategoryID = (int) $_GET['categoryid'];
2011-03-28 14:21:28 +00:00
$NewType = $_GET['newresolve'];
if (!empty($Types[$CategoryID])) {
$TypeList = $Types['master'] + $Types[$CategoryID];
$Priorities = array();
foreach ($TypeList as $Key => $Value) {
$Priorities[$Key] = $Value['priority'];
}
array_multisort($Priorities, SORT_ASC, $TypeList);
} else {
$TypeList = $Types['master'];
}
2013-05-04 08:00:48 +00:00
if (!array_key_exists($NewType, $TypeList)) {
2011-03-28 14:21:28 +00:00
echo "No resolve from that category";
die();
}
2013-11-02 08:01:09 +00:00
$DB->query("
UPDATE reportsv2
SET Type = '$NewType'
WHERE ID = $ReportID");