diff --git a/client_contact_details.php b/client_contact_details.php index 053edc10..e2e44cc0 100644 --- a/client_contact_details.php +++ b/client_contact_details.php @@ -98,7 +98,7 @@ if (isset($_GET['contact_id'])) { $sql_related_notes = mysqli_query($mysqli, "SELECT * FROM contact_notes LEFT JOIN users ON contact_note_created_by = user_id WHERE contact_note_contact_id = $contact_id AND contact_note_archived_at IS NULL ORDER BY contact_note_created_at DESC"); $note_count = mysqli_num_rows($sql_related_notes); - // Documents + // Linked Documents $sql_linked_documents = mysqli_query($mysqli, "SELECT * FROM contact_documents, documents LEFT JOIN users ON document_created_by = user_id WHERE contact_documents.contact_id = $contact_id @@ -111,6 +111,17 @@ if (isset($_GET['contact_id'])) { $linked_documents = array(); + // Linked Files + $sql_linked_files = mysqli_query($mysqli, "SELECT * FROM contact_files, files + WHERE contact_files.contact_id = $contact_id + AND contact_files.file_id = files.file_id + AND file_archived_at IS NULL + ORDER BY file_name ASC" + ); + $file_count = mysqli_num_rows($sql_linked_files); + + $linked_files = array(); + ?>