Gazelle/sections/staffpm/ajax_delete_response.php

32 lines
554 B
PHP
Raw Normal View History

2012-09-01 08:00:24 +00:00
<?
enforce_login();
// Get user level
$DB->query("
SELECT
i.SupportFor,
p.DisplayStaff
FROM users_info as i
JOIN users_main as m ON m.ID = i.UserID
JOIN permissions as p ON p.ID = m.PermissionID
WHERE i.UserID = ".$LoggedUser['ID']
);
list($SupportFor, $DisplayStaff) = $DB->next_record();
if (!($SupportFor != '' || $DisplayStaff == '1')) {
// Logged in user is not FLS or Staff
error(403);
}
if ($ID = (int)$_POST['id']) {
2013-07-02 08:01:37 +00:00
$DB->query("
DELETE FROM staff_pm_responses
WHERE ID = $ID");
2012-09-01 08:00:24 +00:00
echo '1';
2013-02-22 08:00:24 +00:00
2012-09-01 08:00:24 +00:00
} else {
2013-07-02 08:01:37 +00:00
// No ID
2012-09-01 08:00:24 +00:00
echo '-1';
}
2013-07-02 08:01:37 +00:00
?>