Gazelle/sections/reportsv2/ajax_update_resolve.php

47 lines
983 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['reportid']) || !is_number($_GET['reportid'])) {
2011-03-28 14:21:28 +00:00
echo 'HAX ATTEMPT!'.$_GET['reportid'];
die();
}
2013-05-04 08:00:48 +00:00
if (empty($_GET['categoryid']) || !is_number($_GET['categoryid'])) {
2011-03-28 14:21:28 +00:00
echo 'HAX ATTEMPT!!'.$_GET['categoryid'];
die();
}
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();
}
$ReportID = $_GET['reportid'];
$CategoryID = $_GET['categoryid'];
$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");