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 * FROM dramas WHERE id = ?"); $stmt->execute([$drama_id]); $drama = $stmt->fetch(); if (!$drama) { die("Teledrama not found."); } // 2. Mandrill Notification Function (Replaced old Mailchimp logic) function notifyEpMandrill($pdo, $dName, $epNo) { $mandrill_key = 'md-Vjza4GhgRIEoal3e-KKkmw'; // Your verified key $url = "https://mandrillapp.com/api/1.0/messages/send.json"; $members = $pdo->query("SELECT email FROM users WHERE role = 'member' AND email IS NOT NULL")->fetchAll(PDO::FETCH_COLUMN); if (empty($members)) return; $recipients = array_map(function($email) { return ["email" => $email, "type" => "bcc"]; }, $members); $html = "

New Episode Available

Episode $epNo of $dName has been uploaded to the portal for evaluation.

Please log in to the dashboard to submit your ratings.

"; $data = [ "key" => $mandrill_key, "message" => [ "html" => $html, "subject" => "New Episode Alert: $dName - Ep $epNo", "from_email" => "teldramaratings@test.athavaneng.com", "from_name" => "Swarnavahini Admin", "to" => [["email" => "admin@test.athavaneng.com", "type" => "to"]], // Main 'to' "bcc" => $recipients // All members in BCC ] ]; $options = [ 'http' => [ 'header' => "Content-type: application/json\r\n", 'method' => 'POST', 'content' => json_encode($data), 'ignore_errors' => true ], 'ssl' => ['verify_peer' => false, 'verify_peer_name' => false] ]; $context = stream_context_create($options); @file_get_contents($url, false, $context); } // 3. Handle Add Episode if (isset($_POST['add_episode'])) { $ep_number = $_POST['ep_number']; $iframe = $_POST['iframe_code']; $insert = $pdo->prepare("INSERT INTO episodes (drama_id, ep_number, iframe_code) VALUES (?, ?, ?)"); if ($insert->execute([$drama_id, $ep_number, $iframe])) { notifyEpMandrill($pdo, $drama['title'], $ep_number); header("Location: view_episodes.php?id=$drama_id&success=1"); exit(); } } // 4. Fetch Episode List $episodes = $pdo->prepare("SELECT * FROM episodes WHERE drama_id = ? ORDER BY ep_number ASC"); $episodes->execute([$drama_id]); $epList = $episodes->fetchAll(); include '../includes/header.php'; ?>

New episode added and committee notified.
Episode details updated successfully.

No episodes found for this teledrama.