-
+
Will not show as an option at Checkout if invoice amount is above this number, 0 disables the threshold check.
@@ -79,7 +79,7 @@ ob_start();
-
+
See here for the latest Stripe Fees.
@@ -90,7 +90,7 @@ ob_start();
-
+
See here for the latest Stripe Fees.
diff --git a/admin/modals/payment_provider/payment_provider_edit.php b/admin/modals/payment_provider/payment_provider_edit.php
index f5e65cb6..154a6074 100644
--- a/admin/modals/payment_provider/payment_provider_edit.php
+++ b/admin/modals/payment_provider/payment_provider_edit.php
@@ -58,7 +58,7 @@ ob_start();
-
+
Will not show as an option at Checkout if above this number
@@ -79,7 +79,7 @@ ob_start();
-
+
See here for the latest Stripe Fees.
@@ -90,7 +90,7 @@ ob_start();
-
+
See here for the latest Stripe Fees.
diff --git a/admin/settings_default.php b/admin/settings_default.php
index 505b1e6f..9348925f 100644
--- a/admin/settings_default.php
+++ b/admin/settings_default.php
@@ -214,7 +214,7 @@ require_once "includes/inc_all_admin.php";
-
+
diff --git a/agent/files.php b/agent/files.php
index 4387c524..cd41ea8c 100644
--- a/agent/files.php
+++ b/agent/files.php
@@ -1,12 +1,11 @@
0) {
- $sql_folder = mysqli_query($mysqli, "SELECT folder_name, parent_folder FROM folders WHERE folder_id = $folder_id");
+while ($breadcrumb_folder_id > 0) {
+ $sql_folder = mysqli_query($mysqli, "SELECT folder_name, parent_folder FROM folders WHERE folder_id = $breadcrumb_folder_id AND folder_client_id = $client_id");
if ($row_folder = mysqli_fetch_assoc($sql_folder)) {
$folder_name = nullable_htmlentities($row_folder['folder_name']);
$parent_folder = intval($row_folder['parent_folder']);
- // Prepend the folder to the beginning of the array
- array_unshift($folder_path, array('folder_id' => $folder_id, 'folder_name' => $folder_name));
+ array_unshift($folder_path, [
+ 'folder_id' => $breadcrumb_folder_id,
+ 'folder_name' => $folder_name
+ ]);
- // Move up to the parent folder
- $folder_id = $parent_folder;
+ $breadcrumb_folder_id = $parent_folder;
} else {
- // If the folder is not found, break the loop
break;
}
}
+// ---------------------------------------------
+// Helper: unified folder tree (no folder_location)
+// ---------------------------------------------
+function is_ancestor_folder($folder_id, $current_folder_id, $client_id) {
+ global $mysqli;
+
+ if ($current_folder_id == 0) {
+ return false;
+ }
+ if ($current_folder_id == $folder_id) {
+ return true;
+ }
+
+ $result = mysqli_query($mysqli, "SELECT parent_folder FROM folders WHERE folder_id = $current_folder_id AND folder_client_id = $client_id");
+ if ($row = mysqli_fetch_assoc($result)) {
+ $parent_folder_id = intval($row['parent_folder']);
+ return is_ancestor_folder($folder_id, $parent_folder_id, $client_id);
+ } else {
+ return false;
+ }
+}
+
+function display_folders($parent_folder_id, $client_id, $indent = 0) {
+ global $mysqli, $get_folder_id, $session_user_role;
+
+ $sql_folders = mysqli_query($mysqli, "SELECT * FROM folders WHERE parent_folder = $parent_folder_id AND folder_client_id = $client_id ORDER BY folder_name ASC");
+ while ($row = mysqli_fetch_array($sql_folders)) {
+ $folder_id = intval($row['folder_id']);
+ $folder_name = nullable_htmlentities($row['folder_name']);
+
+ // Count files in folder
+ $row_files = mysqli_fetch_assoc(mysqli_query($mysqli, "SELECT COUNT('file_id') AS num FROM files WHERE file_folder_id = $folder_id AND file_client_id = $client_id AND file_archived_at IS NULL"));
+ $num_files = intval($row_files['num']);
+
+ // Count documents in folder
+ $row_docs = mysqli_fetch_assoc(mysqli_query($mysqli, "SELECT COUNT('document_id') AS num FROM documents WHERE document_folder_id = $folder_id AND document_client_id = $client_id AND document_archived_at IS NULL"));
+ $num_docs = intval($row_docs['num']);
+
+ $num_total = $num_files + $num_docs;
+
+ // Count subfolders
+ $subfolder_result = mysqli_query($mysqli, "SELECT COUNT(*) AS count FROM folders WHERE parent_folder = $folder_id AND folder_client_id = $client_id");
+ $subfolder_count = intval(mysqli_fetch_assoc($subfolder_result)['count']);
+
+ echo '