🐛 Fix request closure problem
Signed-off-by: Luke Tainton <luke@tainton.uk>
This commit is contained in:
@@ -8,18 +8,16 @@
|
|||||||
|
|
||||||
// Close request
|
// Close request
|
||||||
if ($is_authorised == true) {
|
if ($is_authorised == true) {
|
||||||
if($_SERVER['REQUEST_METHOD'] == 'POST') {
|
try {
|
||||||
try {
|
$stmt = "UPDATE tickets SET status='Closed' WHERE uuid=:uuid";
|
||||||
$stmt = "UPDATE tickets SET status='Closed' WHERE uuid=:uuid";
|
$sql = $db->prepare($stmt);
|
||||||
$sql = $db->prepare($stmt);
|
$sql->bindParam(':uuid', $_GET['rid']);
|
||||||
$sql->bindParam(':uuid', $_GET['rid']);
|
$sql->execute();
|
||||||
$sql->execute();
|
} catch (PDOException $e) {
|
||||||
} catch (PDOException $e) {
|
$alert = array("danger", "Failed to close request: " . $e->getMessage());
|
||||||
$alert = array("danger", "Failed to close request: " . $e->getMessage());
|
}
|
||||||
}
|
$newURL = "/";
|
||||||
}
|
echo("<script>window.location = '$newURL'</script>");
|
||||||
$newURL = "/";
|
|
||||||
echo("<script>window.location = '$newURL'</script>");
|
|
||||||
} else {
|
} else {
|
||||||
$alert = array("danger", "You are not authorised to close this request.");
|
$alert = array("danger", "You are not authorised to close this request.");
|
||||||
$newURL = "/view?rid=" . $request['uuid'];
|
$newURL = "/view?rid=" . $request['uuid'];
|
||||||
|
|||||||
Reference in New Issue
Block a user