diff --git a/public/userportal/documents-settings.php b/public/userportal/documents-settings.php index a7aae62..c0e9175 100644 --- a/public/userportal/documents-settings.php +++ b/public/userportal/documents-settings.php @@ -22,6 +22,13 @@ $documents = []; while ($row = $queryDocuments->fetch_assoc()) { $documents[] = $row; } + +// Recupera l'elenco dei tag +$queryTags = $conn->query("SELECT tag_id, tag_name FROM tags ORDER BY tag_name ASC"); +$tags = []; +while ($row = $queryTags->fetch_assoc()) { + $tags[$row['tag_id']] = $row['tag_name']; +} ?> @@ -36,8 +43,23 @@ while ($row = $queryDocuments->fetch_assoc()) { + + + @@ -48,7 +70,7 @@ while ($row = $queryDocuments->fetch_assoc()) {
-
+
@@ -61,7 +83,6 @@ while ($row = $queryDocuments->fetch_assoc()) { -
@@ -79,11 +100,25 @@ while ($row = $queryDocuments->fetch_assoc()) { Sezione Max Documenti Obbligatorio + Tag Azioni - + prepare("SELECT t.tag_id, t.tag_name FROM tags t + JOIN document_tags dt ON t.tag_id = dt.tag_id + WHERE dt.document_id = ?"); + $tagStmt->bind_param("i", $document['document_id']); + $tagStmt->execute(); + $tagResult = $tagStmt->get_result(); + $documentTags = []; + while ($tagRow = $tagResult->fetch_assoc()) { + $documentTags[] = $tagRow['tag_name']; + } + $tagStmt->close(); + ?> @@ -91,6 +126,7 @@ while ($row = $queryDocuments->fetch_assoc()) { + - - @@ -120,10 +155,11 @@ while ($row = $queryDocuments->fetch_assoc()) {
- + +