diff --git a/app/public/actions/close.php b/app/public/actions/close.php
index 318e004..eb71ade 100644
--- a/app/public/actions/close.php
+++ b/app/public/actions/close.php
@@ -8,18 +8,16 @@
// Close request
if ($is_authorised == true) {
- if($_SERVER['REQUEST_METHOD'] == 'POST') {
- try {
- $stmt = "UPDATE tickets SET status='Closed' WHERE uuid=:uuid";
- $sql = $db->prepare($stmt);
- $sql->bindParam(':uuid', $_GET['rid']);
- $sql->execute();
- } catch (PDOException $e) {
- $alert = array("danger", "Failed to close request: " . $e->getMessage());
- }
- }
- $newURL = "/";
- echo("");
+ try {
+ $stmt = "UPDATE tickets SET status='Closed' WHERE uuid=:uuid";
+ $sql = $db->prepare($stmt);
+ $sql->bindParam(':uuid', $_GET['rid']);
+ $sql->execute();
+ } catch (PDOException $e) {
+ $alert = array("danger", "Failed to close request: " . $e->getMessage());
+ }
+ $newURL = "/";
+ echo("");
} else {
$alert = array("danger", "You are not authorised to close this request.");
$newURL = "/view?rid=" . $request['uuid'];
diff --git a/app/public/actions/create.php b/app/public/actions/create.php
index 7c8d339..f6779eb 100644
--- a/app/public/actions/create.php
+++ b/app/public/actions/create.php
@@ -7,7 +7,7 @@
try {
// Process ticket data
$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->bindParam(':tktuuid', $tkt_uuid);
$sql->bindParam(':title', $_POST['title']);
@@ -15,7 +15,6 @@
$sql->bindParam(':user', $_SESSION['uuid']);
$sql->execute();
} catch (PDOException $e) {
- // echo("Error:
" . $e->getMessage() . "
");
$alert = array("danger", "Failed to create request: " . $e->getMessage());
}
@@ -39,7 +38,7 @@
$alert = array("danger", "Failed to upload file: " . $e->getMessage());
}
}
-
+
$newURL = "/view?rid=" . $tkt_uuid;
echo("");
}