From c39a07b2d361fc1879d05461a25f0a3b16b7d166 Mon Sep 17 00:00:00 2001 From: Alexander Davis Date: Sun, 9 Aug 2020 18:20:18 +0100 Subject: [PATCH] Creation of File list @luketainton needs to look at line 123 to work out what should be displayed and how to click to download the file. This should be done in view.php Creation of get_files script in prereqs.php --- app/includes/prereqs.php | 10 ++++++++++ app/public/view.php | 41 ++++++++++++++++++++++++++++------------ 2 files changed, 39 insertions(+), 12 deletions(-) diff --git a/app/includes/prereqs.php b/app/includes/prereqs.php index f8d49ad..f2badaa 100644 --- a/app/includes/prereqs.php +++ b/app/includes/prereqs.php @@ -126,6 +126,16 @@ function get_updates($db, $request) { return $updates_result; } +function get_files($db, $request) { + $updates_stmt = "SELECT * FROM ticket_uploads WHERE ticket=:uuid"; + $updates_sql = $db->prepare($updates_stmt); + $updates_sql->bindParam(':uuid', $request['uuid']); + $updates_sql->execute(); + $updates_sql->setFetchMode(PDO::FETCH_ASSOC); + $updates_result = $updates_sql->fetchAll(); + return $updates_result; +} + function get_subscribers($db, $request) { $subs = array(); $users_stmt = "SELECT user_uuid FROM ticket_subscribers WHERE ticket_uuid=:uuid"; diff --git a/app/public/view.php b/app/public/view.php index 4fc208d..b02bae3 100644 --- a/app/public/view.php +++ b/app/public/view.php @@ -4,6 +4,7 @@ $request = get_request($db, $_GET['rid']); $updates = get_updates($db, $request); + $files = get_files($db, $request); $authorised_users = get_subscribers($db, $request); $is_authorised = isAuthorised($_SESSION['uuid'], $authorised_users, $request); ?> @@ -60,14 +61,14 @@
-
+
Information
  • Status: - + New
  • @@ -75,7 +76,7 @@
    Created by: - + Luke Tainton
    @@ -83,19 +84,14 @@
    Assigned to: - " . get_user_name($db, $request['assignee']) . ""); - } else { - echo("None"); - } ?> -
    + None
  • Created: - + 2020-08-04 13:26:22
  • @@ -103,13 +99,34 @@
    Last updated: - + 2020-08-04 13:26:22
    -
    +
    +
    Uploaded files
    +
      + No files uploaded"); + } else { + foreach($files as $file) { + ?> +
    • +
      +
      + +
      +
      + +
      +
      +
    • + +
    +