From 48a5249030797edcf53d8dae3f3e4c2e5046833b Mon Sep 17 00:00:00 2001 From: Alexander Davis Date: Tue, 1 Sep 2020 02:34:46 +0100 Subject: [PATCH] Creation of Agent Area No checks to to see if user is agent or not. --- app/includes/app_functions.php | 12 +- app/public/agent/editsub.php | 173 +++++++++++++++++++++++++++ app/public/agent/existing.php | 105 +++++++++++++++++ app/public/agent/index.php | 126 ++++++++++++++++++++ app/public/agent/open.php | 69 +++++++++++ app/public/agent/update.php | 155 ++++++++++++++++++++++++ app/public/agent/upload.php | 155 ++++++++++++++++++++++++ app/public/agent/view.php | 209 +++++++++++++++++++++++++++++++++ 8 files changed, 1003 insertions(+), 1 deletion(-) create mode 100644 app/public/agent/editsub.php create mode 100644 app/public/agent/existing.php create mode 100644 app/public/agent/index.php create mode 100644 app/public/agent/open.php create mode 100644 app/public/agent/update.php create mode 100644 app/public/agent/upload.php create mode 100644 app/public/agent/view.php diff --git a/app/includes/app_functions.php b/app/includes/app_functions.php index 4cc589a..8b16fb9 100644 --- a/app/includes/app_functions.php +++ b/app/includes/app_functions.php @@ -15,7 +15,7 @@ $_SESSION['full_name'] = $fname . " " . $lname; $_SESSION['email'] = $email; } - + function is_signed_in() { if (isset($_SESSION['is_signed_in'])) { @@ -25,6 +25,16 @@ } } + function is_agent() + { + // Some SQL commands go here + if ($agent_result) { + return true; + } else { + return false; + } + } + function user_exists($db, $uuid) { try { diff --git a/app/public/agent/editsub.php b/app/public/agent/editsub.php new file mode 100644 index 0000000..1823190 --- /dev/null +++ b/app/public/agent/editsub.php @@ -0,0 +1,173 @@ +prepare($stmt); + $sql->bindParam(':uuid', $uuid); + $sql->execute(); + $sql->setFetchMode(PDO::FETCH_ASSOC); + $result = $sql->fetchAll(); + return $result; + } + + $subs = get_req_subs($db, $request['uuid']) +?> + + + + +
+ + +
+
+ +
+
+ +
+
+

+

+

+
+
+
+
+
+
+
+
+ Information +
+
    +
  • +
    +
    + Status: + +
    +
    +
  • +
  • +
    +
    + Created by: + +
    +
    +
  • +
  • +
    +
    + Assigned to: + " . get_user_name($db, $request['assignee']) . ""); + } else { + echo("None"); + } ?> +
    +
    +
  • +
  • +
    +
    + Created: + +
    +
    +
  • +
  • +
    +
    + Last updated: + +
    +
    +
  • +
+
+
+ +
+
+
+ Manage Subscribers +
+
    +
  • +
    +
    +
    +
    + + + +
    + +
    +
    +
    +
  • +
  • +
    +
    +
    +
    + + + +
    + +
    +
    +
    +
  • +
+
+
+
+
+
+ + +
+
+

You are not authorised to see this page.

+
+
+ + +
+ + diff --git a/app/public/agent/existing.php b/app/public/agent/existing.php new file mode 100644 index 0000000..6429133 --- /dev/null +++ b/app/public/agent/existing.php @@ -0,0 +1,105 @@ + + + + + +
+ +
+
+

Existing requests

+

+ Here you can find all of your requests, and other requests that you are subscribed to. +

+
+
+ +
+
+
+ My Requests +
+ +
+ +
+
    + No open tickets"); + } else { + foreach($open_requests as $tkt) { + ?> +
  • +
    +
    +
    + # + +

    +
    + +
    +
    +
  • + +
+
+ +
+
    + No closed tickets"); + } else { + foreach($closed_requests as $tkt) { + ?> +
  • +
    +
    +
    + # +

    +
    + +
    +
    +
  • + +
+
+
+
+
+ +
+ +
+ +
+ + diff --git a/app/public/agent/index.php b/app/public/agent/index.php new file mode 100644 index 0000000..9ef4e46 --- /dev/null +++ b/app/public/agent/index.php @@ -0,0 +1,126 @@ + + + +
+ + + + "); + unset($alert); + } + ?> +
+ +
+
+

Welcome to

+

+ + is the one-stop shop for all of your IT-related needs. Let us know how we can help you by opening a request. +

+ +

+ View open requests + View all requests +

+ +

Please log in to view requests.

+ +
+
+ + +
+
+
+
+
+ My Open Requests +
+
    + No open tickets"); + } else { + foreach ($requests as $tkt) { + ?> +
  • +
    +
    +
    + # +

    +
    + +
    +
    +
  • + +
+
+
+ +
+
+
+ My Subscribed Requests +
+
    + No subscribed tickets"); + } else { + foreach ($subscriptions as $sub) { ?> +
  • +
    +
    +
    + # +

    +
    + +
    +
    +
  • + +
+
+ +
+
+
+ + + diff --git a/app/public/agent/open.php b/app/public/agent/open.php new file mode 100644 index 0000000..94140b1 --- /dev/null +++ b/app/public/agent/open.php @@ -0,0 +1,69 @@ + + + + + +
+ +
+
+

Existing requests

+

+ Here you can find all of your requests, and other requests that you are subscribed to. +

+
+
+ +
+
+
+ My Requests +
+
    + No open tickets"); + } else { + foreach($open_requests as $tkt) { + ?> +
  • +
    +
    +
    + # + +

    +
    + +
    +
    +
  • + +
+
+ +
+ +
+ +
+ +
+ + diff --git a/app/public/agent/update.php b/app/public/agent/update.php new file mode 100644 index 0000000..88b95ae --- /dev/null +++ b/app/public/agent/update.php @@ -0,0 +1,155 @@ + + + + + +
+ + +
+
+ +
+
+ +
+
+

+

+

+
+
+
+
+
+
+
+
Information
+
    +
  • +
    +
    + Status: + +
    +
    +
  • +
  • +
    +
    + Created by: + +
    +
    +
  • +
  • +
    +
    + Assigned to: + " . get_user_name($db, $request['assignee']) . ""); + } else { + echo("None"); + } ?> +
    +
    +
  • +
  • +
    +
    + Created: + +
    +
    +
  • +
  • +
    +
    + Last updated: + +
    +
    +
  • +
+
+
+ +
+
+
Updates
+
    + No updates"); + } else { + foreach($updates as $update) { + ?> +
  • +
    +
    + + +
    +
    + +
    +
    +
  • + +
+
+
+ +
+
+
+ +
+
+
+
+
+
Post update
+
+
+ +
+
+ + + Cancel +
+
+
+
+
+
+
+ + +
+
+

You are not authorised to see this page.

+
+
+ + +
+ + diff --git a/app/public/agent/upload.php b/app/public/agent/upload.php new file mode 100644 index 0000000..4c0f75f --- /dev/null +++ b/app/public/agent/upload.php @@ -0,0 +1,155 @@ + + + + + +
+ + +
+
+ +
+
+ +
+
+

+

+

+
+
+
+
+
+
+
+
Information
+
    +
  • +
    +
    + Status: + +
    +
    +
  • +
  • +
    +
    + Created by: + +
    +
    +
  • +
  • +
    +
    + Assigned to: + " . get_user_name($db, $request['assignee']) . ""); + } else { + echo("None"); + } ?> +
    +
    +
  • +
  • +
    +
    + Created: + +
    +
    +
  • +
  • +
    +
    + Last updated: + +
    +
    +
  • +
+
+
+ +
+
+
Updates
+
    + No updates"); + } else { + foreach($updates as $update) { + ?> +
  • +
    +
    + + +
    +
    + +
    +
    +
  • + +
+
+
+ +
+
+
+ +
+
+
+
+
+
Upload file(s)
+
+
+ +
+
+ + + Cancel +
+
+
+
+
+
+
+ + +
+
+

You are not authorised to see this page.

+
+
+ + +
+ + diff --git a/app/public/agent/view.php b/app/public/agent/view.php new file mode 100644 index 0000000..edbd38c --- /dev/null +++ b/app/public/agent/view.php @@ -0,0 +1,209 @@ + + + + + +
+ +
+ + + + "); + unset($alert); + } + ?> +
+ + +
+
+ +
+
+ +
+
+

+

+

+

+ + Update the request + Add attachment(s) + + Manage subscribers + +

+ + + + Reopen request + +

+
+
+
+
+
+
+
+
Information
+
    +
  • +
    +
    + Status: + +
    +
    +
  • +
  • +
    +
    + Created by: + +
    +
    +
  • +
  • +
    +
    + Assigned to: + " . get_user_name($db, $request['assignee']) . ""); + } else { + echo("None"); + } ?> +
    +
    +
  • +
  • +
    +
    + Created: + +
    +
    +
  • +
  • +
    +
    + Last updated: + +
    +
    +
  • +
+
+
+ +
+
+
Files
+
    + No files uploaded"); + } else { + foreach($files as $file) { + ?> +
  • +
    +
    + + +
    +
    + +
    +
    +
  • + +
+
+
+ +
+
+
Updates
+
    + No updates"); + } else { + foreach($updates as $update) { + ?> +
  • +
    +
    + + +
    +
    + +
    +
    +
  • + +
+
+
+ +
+
+
+ +
+
+

You are not authorised to see this page.

+
+
+ + +
+ +