From 9a70344c4a36c0f0a1fa207196448f638ab96ee7 Mon Sep 17 00:00:00 2001 From: Alexander Davis Date: Sun, 9 Aug 2020 22:41:51 +0100 Subject: [PATCH 1/2] Fixed #55 --- app/public/actions/close.php | 2 +- app/public/existing.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/public/actions/close.php b/app/public/actions/close.php index 4e9bc4a..18a4ec5 100644 --- a/app/public/actions/close.php +++ b/app/public/actions/close.php @@ -10,7 +10,7 @@ if ($is_authorised == true) { if($_SERVER['REQUEST_METHOD'] == 'POST') { try { - $stmt = "UPDATE tickets SET status= 5 WHERE uuid=:uuid"; + $stmt = "UPDATE tickets SET status='Closed' WHERE uuid=:uuid"; $sql = $db->prepare($stmt); $sql->bindParam(':uuid', $request['uuid']); $sql->execute(); diff --git a/app/public/existing.php b/app/public/existing.php index 04c7341..e079b73 100644 --- a/app/public/existing.php +++ b/app/public/existing.php @@ -7,7 +7,7 @@ $closed_requests = array(); $subscriptions = get_subscribed_requests($db); - $requests = get_my_requests($db); + $requests = get_my_open_requests($db); foreach($requests as $req) { if ($req['status'] != "Closed") { -- 2.49.1 From 951f9ec383bae7cb1a328dc78dadba644d748e1e Mon Sep 17 00:00:00 2001 From: Alexander Davis Date: Sun, 9 Aug 2020 22:55:18 +0100 Subject: [PATCH 2/2] Update close.php --- app/public/actions/close.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/public/actions/close.php b/app/public/actions/close.php index 18a4ec5..318e004 100644 --- a/app/public/actions/close.php +++ b/app/public/actions/close.php @@ -12,7 +12,7 @@ try { $stmt = "UPDATE tickets SET status='Closed' WHERE uuid=:uuid"; $sql = $db->prepare($stmt); - $sql->bindParam(':uuid', $request['uuid']); + $sql->bindParam(':uuid', $_GET['rid']); $sql->execute(); } catch (PDOException $e) { $alert = array("danger", "Failed to close request: " . $e->getMessage()); -- 2.49.1