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 s.*, a.agency_name, c.client_name, DATEDIFF(CURRENT_DATE, s.start_date) as days_run FROM schedules s JOIN agencies a ON s.agency_id = a.id JOIN clients c ON s.client_id = c.id WHERE s.id = ? "); $stmt->execute([$id]); $schedule = $stmt->fetch(); $stmt->execute([$id]); $schedule = $stmt->fetch(); if (!$schedule) { header("Location: manage.php"); exit(); } // 2. Pre-calculate Auto-Daily-Rate for Reference $start = new DateTime($schedule['start_date']); $end = new DateTime($schedule['end_date']); $totalDays = max(1, $end->diff($start)->days + 1); $autoDailyRate = $schedule['budget_allocated'] / $totalDays; // UPDATED: Using the correct column name 'changed_at' $audit_stmt = $pdo->prepare(" SELECT al.*, u.email as user_email FROM schedule_audit_log al LEFT JOIN users u ON al.changed_by = u.id WHERE al.schedule_id = ? ORDER BY al.changed_at DESC "); $audit_stmt->execute([$id]); $audit_logs = $audit_stmt->fetchAll(); $items_stmt = $pdo->prepare(" SELECT si.*, ci.name AS content_name, p.platform_name, ap.placement_name, mf.format_name, GROUP_CONCAT(CONCAT(ma.file_path, '||', IFNULL(ma.file_reference, 'N/A')) SEPARATOR '###') as media_data FROM schedule_items si JOIN content_items ci ON si.content_item_id = ci.id JOIN platforms p ON si.platform_id = p.id JOIN ad_placements ap ON si.placement_id = ap.id JOIN rate_cards rc ON si.content_item_id = rc.content_item_id AND si.platform_id = rc.platform_id AND si.placement_id = rc.placement_id JOIN media_formats mf ON rc.media_format_id = mf.id LEFT JOIN media_attachments ma ON si.id = ma.schedule_item_id WHERE si.schedule_id = ? GROUP BY si.id "); $stmt = $pdo->prepare(" SELECT s.budget_allocated, s.final_cost, (SELECT SUM(cost) FROM schedule_items WHERE schedule_id = s.id) as total_item_cost FROM schedules s WHERE s.id = ? "); $stmt->execute([$id]); // Ensure $id is available here $s = $stmt->fetch(); // 2. Determine the safe floor (the minimum) // We use 0 if no costs are found yet to avoid errors $finalCost = (float)($s['final_cost'] ?? 0); $totalItemCost = (float)($s['total_item_cost'] ?? 0); $minAllowed = max($finalCost, $totalItemCost); $items_stmt->execute([$id]); $items = $items_stmt->fetchAll(); $statusClass = ($schedule['status'] == 'Active') ? 'bg-success' : (($schedule['status'] == 'Stopped') ? 'bg-secondary' : 'bg-warning text-dark'); ?>

Ref No:
Download Excel Back to List
Schedule Finalization Summary
Days Run:
0) ? $schedule['days_run'] . ' / ' . $schedule['total_days'] : 'N/A'; } else { $start = new DateTime($schedule['start_date']); $end = new DateTime($schedule['end_date']); $today = new DateTime(); $daysRun = max(1, $today->diff($start)->days + 1); $totalDays = max(1, $end->diff($start)->days + 1); echo $daysRun . ' / ' . $totalDays . ' (Active)'; } ?>
Total Spent:
Rs.
Remaining Budget:
Rs.
Final Status:
Stopped
Agency:
Client:
Period:
Allocated Budget:
Rs.
Detailed Content Breakdown
$item['id'], 'sch_id' => $id, 'c_id' => $item['content_item_id'], 'p_id' => $item['platform_id'], 'pl_id' => $item['placement_id'], 'qty' => $item['quantity'] ]); ?>
ProgramPlatform / PlacementFormatQtyCostMedia Files & ReferencesActions
Rs. None'; endif; ?>
Modification History
prepare($query); $logs->execute([$id]); foreach($logs as $log): ?>
Date Activity Previous New Changed By

System