diff --git a/app/includes/app_functions.php b/app/includes/app_functions.php
index 4011194..6d7bf28 100644
--- a/app/includes/app_functions.php
+++ b/app/includes/app_functions.php
@@ -1,4 +1,17 @@
prepare($stmt);
+ $sql->execute();
+ $sql->setFetchMode(PDO::FETCH_ASSOC);
+ $result = $sql->fetchAll();
+ } catch (PDOException $e) {
+ echo("Error: " . $e->getMessage());
+ }
+ return $result;
+ }
+
function get_user_name($db, $user_uuid) {
try {
$stmt = "SELECT given_name, family_name FROM users WHERE uuid=:uuid";
diff --git a/app/public/actions/addsub.php b/app/public/actions/addsub.php
new file mode 100644
index 0000000..6a18db0
--- /dev/null
+++ b/app/public/actions/addsub.php
@@ -0,0 +1,30 @@
+prepare($stmt);
+ $sql->bindParam(':tktuuid', $request['uuid']);
+ $sql->bindParam(':usruuid', $POST['addSubSelector']);
+ $sql->execute();
+ } catch (PDOException $e) {
+ $alert = array("danger", "Failed to add subscriber: " . $e->getMessage());
+ }
+ }
+ $newURL = "/managesub?rid=" . $request['uuid'];
+ echo("");
+ } else {
+ $alert = array("danger", "You are not authorised to manage subscribers on this request.");
+ $newURL = "/managesub?rid=" . $request['uuid'];
+ echo("");
+ }
+
+?>
diff --git a/app/public/actions/delsub.php b/app/public/actions/delsub.php
new file mode 100644
index 0000000..917e59a
--- /dev/null
+++ b/app/public/actions/delsub.php
@@ -0,0 +1,32 @@
+prepare($stmt);
+ $sql->bindParam(':tktuuid', $request['uuid']);
+ $sql->bindParam(':usruuid', $sub);
+ $sql->execute();
+ } catch (PDOException $e) {
+ $alert = array("danger", "Failed to remove subscriber(s): " . $e->getMessage());
+ }
+ }
+ }
+ $newURL = "/managesub?rid=" . $request['uuid'];
+ echo("");
+ } else {
+ $alert = array("danger", "You are not authorised to manage subscribers on this request.");
+ $newURL = "/managesub?rid=" . $request['uuid'];
+ echo("");
+ }
+
+?>
diff --git a/app/public/editsub.php b/app/public/editsub.php
new file mode 100644
index 0000000..e403603
--- /dev/null
+++ b/app/public/editsub.php
@@ -0,0 +1,159 @@
+
+
+
+
+
+
+
+
+
+
+
+ You need to log in to access this page.
+
+
+
+
+
+
+
+
+
+
+
+
+
+ -
+
+
+ -
+
+
+ -
+
+
+ Assigned to:
+ " . get_user_name($db, $request['assignee']) . "");
+ } else {
+ echo("None");
+ } ?>
+
+
+
+ -
+
+
+ -
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
You are not authorised to see this page.
+
+
+
+
+
+
+
diff --git a/app/public/editsub.php.old b/app/public/editsub.php.old
new file mode 100644
index 0000000..127379c
--- /dev/null
+++ b/app/public/editsub.php.old
@@ -0,0 +1,154 @@
+
+
+
+
+
+
+
+
+
+
+
+ You need to log in to access this page.
+
+
+
+
+
+
+
+
+
+
+
+
+
+ -
+
+
+ -
+
+
+ -
+
+
+ Assigned to:
+ " . get_user_name($db, $request['assignee']) . "");
+ } else {
+ echo("None");
+ } ?>
+
+
+
+ -
+
+
+ -
+
+
+
+
+
+
+
+
+
+
+ No updates");
+ } else {
+ foreach($updates as $update) {
+ ?>
+ -
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
You are not authorised to see this page.
+
+
+
+
+
+
+
diff --git a/app/public/view.php b/app/public/view.php
index 65bb1e6..6d58f22 100644
--- a/app/public/view.php
+++ b/app/public/view.php
@@ -53,8 +53,9 @@
Update the request
- Add attachment(s)
-
+ Add attachment(s)
+ Manage subscribers
+