diff --git a/client/document.php b/client/document.php index e3b9de77..5a56e2c4 100644 --- a/client/document.php +++ b/client/document.php @@ -29,7 +29,7 @@ if (!isset($_GET['id']) && !intval($_GET['id'])) { $document_id = intval($_GET['id']); $sql_document = mysqli_query($mysqli, - "SELECT document_id, document_name, document_content + "SELECT document_id, document_name, document_content, document_description FROM documents WHERE document_id = $document_id AND document_client_visible = 1 AND document_client_id = $session_client_id AND document_archived_at IS NULL LIMIT 1" @@ -41,11 +41,21 @@ if ($row) { $document_id = intval($row['document_id']); $document_name = nullable_htmlentities($row['document_name']); $document_content = $purifier->purify($row['document_content']); + $document_description = nullable_htmlentities($row['document_description']); } else { header("Location: post.php?logout"); exit(); } +// Check for associated files +$sql_files = mysqli_query($mysqli, + "SELECT f.file_id, f.file_name, f.file_reference_name, f.file_ext, f.file_size, f.file_mime_type + FROM files f + INNER JOIN document_files df ON f.file_id = df.file_id + WHERE df.document_id = $document_id AND f.file_client_id = $session_client_id + ORDER BY f.file_name ASC" +); + ?>
-
+ Type: File
+ Size:
+
$document_description
") { ?> +