diff --git a/client_document_move_modal.php b/client_document_move_modal.php
new file mode 100644
index 00000000..98fbedad
--- /dev/null
+++ b/client_document_move_modal.php
@@ -0,0 +1,45 @@
+
diff --git a/client_documents.php b/client_documents.php
index 1b752a66..6b9960ef 100644
--- a/client_documents.php
+++ b/client_documents.php
@@ -195,6 +195,10 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
)">
Share
+
+
+ Move
+
@@ -208,6 +212,8 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
diff --git a/post/document.php b/post/document.php
index 73eaa14d..6156ace3 100644
--- a/post/document.php
+++ b/post/document.php
@@ -111,6 +111,27 @@ if (isset($_POST['edit_document'])) {
}
+if (isset($_POST['move_document'])) {
+
+ validateTechRole();
+
+ $document_id = intval($_POST['document_id']);
+ $client_id = intval($_POST['client_id']);
+ $folder = intval($_POST['folder']);
+
+ // Document edit query
+ mysqli_query($mysqli,"UPDATE documents SET document_folder_id = $folder WHERE document_id = $document_id");
+
+ //Logging
+ mysqli_query($mysqli,"INSERT INTO logs SET log_type = 'Document', log_action = 'Modify', log_description = '$session_name moved document', log_ip = '$session_ip', log_user_agent = '$session_user_agent', log_client_id = $client_id, log_user_id = $session_user_id, log_entity_id = $document_id");
+
+
+ $_SESSION['alert_message'] = "Document moved";
+
+ header("Location: " . $_SERVER["HTTP_REFERER"]);
+
+}
+
if (isset($_POST['edit_document_template'])) {
validateTechRole();