Merge branch 'main' into feature/39
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'];
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
try {
|
try {
|
||||||
// Process ticket data
|
// Process ticket data
|
||||||
$tkt_uuid = Uuid::uuid4()->toString();
|
$tkt_uuid = Uuid::uuid4()->toString();
|
||||||
$stmt = "INSERT INTO tickets (uuid, title, description, created_by) VALUES (:tktuuid, :title, :description, :user)";
|
$stmt = "INSERT INTO tickets (uuid, title, description, status, created_by) VALUES (:tktuuid, :title, :description, 'New', :user)";
|
||||||
$sql = $db->prepare($stmt);
|
$sql = $db->prepare($stmt);
|
||||||
$sql->bindParam(':tktuuid', $tkt_uuid);
|
$sql->bindParam(':tktuuid', $tkt_uuid);
|
||||||
$sql->bindParam(':title', $_POST['title']);
|
$sql->bindParam(':title', $_POST['title']);
|
||||||
@@ -15,7 +15,6 @@
|
|||||||
$sql->bindParam(':user', $_SESSION['uuid']);
|
$sql->bindParam(':user', $_SESSION['uuid']);
|
||||||
$sql->execute();
|
$sql->execute();
|
||||||
} catch (PDOException $e) {
|
} catch (PDOException $e) {
|
||||||
// echo("Error: <br>" . $e->getMessage() . "<br>");
|
|
||||||
$alert = array("danger", "Failed to create request: " . $e->getMessage());
|
$alert = array("danger", "Failed to create request: " . $e->getMessage());
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -39,7 +38,7 @@
|
|||||||
$alert = array("danger", "Failed to upload file: " . $e->getMessage());
|
$alert = array("danger", "Failed to upload file: " . $e->getMessage());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$newURL = "/view?rid=" . $tkt_uuid;
|
$newURL = "/view?rid=" . $tkt_uuid;
|
||||||
echo("<script>window.location = '$newURL'</script>");
|
echo("<script>window.location = '$newURL'</script>");
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user