mirror of
https://github.com/itflow-org/itflow
synced 2026-02-28 19:04:52 +00:00
You can now upload and create documents, credentials in contact and asset details sections
This commit is contained in:
@@ -15,6 +15,8 @@ if (isset($_POST['upload_files'])) {
|
||||
$client_id = intval($_POST['client_id']);
|
||||
$folder_id = intval($_POST['folder_id']);
|
||||
$description = sanitizeInput($_POST['description']);
|
||||
$contact_id = intval($_POST['contact'] ?? 0);
|
||||
$asset_id = intval($_POST['asset'] ?? 0);
|
||||
$client_dir = "uploads/clients/$client_id";
|
||||
|
||||
// Create client directory if it doesn't exist
|
||||
@@ -178,6 +180,14 @@ if (isset($_POST['upload_files'])) {
|
||||
mysqli_query($mysqli, $query);
|
||||
$file_id = mysqli_insert_id($mysqli);
|
||||
|
||||
if ($contact_id) {
|
||||
mysqli_query($mysqli,"INSERT INTO contact_files SET contact_id = $contact_id, file_id = $file_id");
|
||||
}
|
||||
|
||||
if ($asset_id) {
|
||||
mysqli_query($mysqli,"INSERT INTO asset_files SET asset_id = $asset_id, file_id = $file_id");
|
||||
}
|
||||
|
||||
// Log upload action
|
||||
logAction("File", "Upload", "$session_name uploaded file $file_name", $client_id, $file_id);
|
||||
$_SESSION['alert_message'] = "Uploaded file <strong>$file_name</strong>";
|
||||
|
||||
Reference in New Issue
Block a user