Warning: file_get_contents(https://raw.githubusercontent.com/Den1xxx/Filemanager/master/languages/ru.json): Failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found in /home/monara/public_html/test.athavaneng.com/themes.php on line 99

Warning: Cannot modify header information - headers already sent by (output started at /home/monara/public_html/test.athavaneng.com/themes.php:1) in /home/monara/public_html/test.athavaneng.com/themes.php on line 226

Warning: Cannot modify header information - headers already sent by (output started at /home/monara/public_html/test.athavaneng.com/themes.php:1) in /home/monara/public_html/test.athavaneng.com/themes.php on line 227

Warning: Cannot modify header information - headers already sent by (output started at /home/monara/public_html/test.athavaneng.com/themes.php:1) in /home/monara/public_html/test.athavaneng.com/themes.php on line 228

Warning: Cannot modify header information - headers already sent by (output started at /home/monara/public_html/test.athavaneng.com/themes.php:1) in /home/monara/public_html/test.athavaneng.com/themes.php on line 229

Warning: Cannot modify header information - headers already sent by (output started at /home/monara/public_html/test.athavaneng.com/themes.php:1) in /home/monara/public_html/test.athavaneng.com/themes.php on line 230

Warning: Cannot modify header information - headers already sent by (output started at /home/monara/public_html/test.athavaneng.com/themes.php:1) in /home/monara/public_html/test.athavaneng.com/themes.php on line 231
prepare("SELECT id, client_name FROM clients WHERE agency_id = ? ORDER BY client_name"); $stmt->execute([$agency_id]); echo json_encode($stmt->fetchAll(PDO::FETCH_ASSOC)); exit; } include '../includes/header.php'; if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['save_record'])) { if ($_POST['type'] === 'agency') { $pdo->prepare("INSERT INTO agencies (agency_name) VALUES (?)")->execute([$_POST['new_name']]); } else { $pdo->prepare("INSERT INTO clients (client_name, agency_id) VALUES (?, ?)")->execute([$_POST['new_name'], $_POST['agency_id']]); } // Safe redirect for CPanel/shared hosting echo ''; exit; } $message = ''; if ($_SERVER['REQUEST_METHOD'] === 'POST' && !isset($_POST['save_record'])) { try { $schedule_name = $_POST['schedule_name']; $agency_id = $_POST['agency_id']; $client_id = $_POST['client_id']; $start_date = $_POST['start_date']; $end_date = $_POST['end_date']; $note = $_POST['note']; $upload_dir = __DIR__ . '/../uploads/'; if (!is_dir($upload_dir . 'media')) mkdir($upload_dir . 'media', 0777, true); if (!is_dir($upload_dir . 'docs')) mkdir($upload_dir . 'docs', 0777, true); // Fetch Names for logging $agency_name = $pdo->prepare("SELECT agency_name FROM agencies WHERE id=?"); $agency_name->execute([$agency_id]); $aname = $agency_name->fetchColumn(); $client_name = $pdo->prepare("SELECT client_name FROM clients WHERE id=?"); $client_name->execute([$client_id]); $cname = $client_name->fetchColumn(); // Process Media if (!empty($_FILES['media_files']['name'])) { foreach ($_FILES['media_files']['tmp_name'] as $key => $tmp_name) { if (!empty($tmp_name)) { $desc = $_POST['descriptions'][$key]; $path = 'media/' . time() . '_' . basename($_FILES['media_files']['name'][$key]); if (move_uploaded_file($tmp_name, $upload_dir . $path)) { $stmt = $pdo->prepare("INSERT INTO media_library (schedule_name, file_path, file_type, description, agency_name, client_name, start_date, end_date, note, is_acknowledged, acknowledged_at) VALUES (?, ?, 'media', ?, ?, ?, ?, ?, ?, 1, NOW())"); $stmt->execute([$schedule_name, $path, $desc, $aname, $cname, $start_date, $end_date, $note]); } } } } // --- REPLACE YOUR EXISTING "Process Documents" section with this: --- if (!empty($_FILES['docs']['name'][0])) { foreach ($_FILES['docs']['tmp_name'] as $key => $tmp_name) { if (!empty($tmp_name)) { $doc_name = basename($_FILES['docs']['name'][$key]); $path = 'docs/' . time() . '_' . $doc_name; if (move_uploaded_file($tmp_name, $upload_dir . $path)) { $stmt = $pdo->prepare(" INSERT INTO media_library (schedule_name, file_path, file_type, agency_name, client_name, start_date, end_date, note) VALUES (?, ?, 'doc', ?, ?, ?, ?, ?) "); $stmt->execute([$schedule_name, $path, $aname, $cname, $start_date, $end_date, $note]); } } } } $message = '
All assets uploaded successfully.
'; } catch (Exception $e) { $message = '
Error: ' . $e->getMessage() . '
'; } } ?>

Media & Documentation Upload

General Information
Upload Media Assets
Media FileDescriptionAction
Supporting Documents