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
query("SELECT setting_value FROM site_settings WHERE setting_key = 'audit_deadline_hours'")->fetchColumn() ?: 24; /** * Helper to fetch all active member emails */ function getMemberEmails($pdo) { $stmt = $pdo->query("SELECT email FROM users WHERE role = 'member' AND email IS NOT NULL"); return $stmt->fetchAll(PDO::FETCH_COLUMN); } // --- 2. HANDLE MANUAL EVALUATION START --- if (isset($_POST['start_evaluation'])) { $drama_id = (int)$_POST['drama_id']; $title = $_POST['drama_title']; // Set the manual start time to NOW $pdo->prepare("UPDATE dramas SET evaluation_start_at = NOW() WHERE id = ?")->execute([$drama_id]); // Notify Members $member_emails = getMemberEmails($pdo); if (!empty($member_emails)) { $subject = "Evaluation Window Opened: $title"; $emailBody = "

Official Evaluation Started

The evaluation window for $title is now open.

You have $deadline_hours hours to submit your final production rating.

Go to Dashboard

"; sendSystemEmail($member_emails, $subject, $emailBody); } $success = "Evaluation window opened and committee notified for $title."; } // --- 3. HANDLE DELETE TELEDRAMA --- if (isset($_GET['delete_drama'])) { $delete_id = (int)$_GET['delete_drama']; try { $pdo->beginTransaction(); $pdo->prepare("DELETE FROM production_rating_values WHERE production_rating_id IN (SELECT id FROM production_ratings WHERE drama_id = ?)")->execute([$delete_id]); $pdo->prepare("DELETE FROM production_ratings WHERE drama_id = ?")->execute([$delete_id]); $pdo->prepare("DELETE FROM episodes WHERE drama_id = ?")->execute([$delete_id]); $pdo->prepare("DELETE FROM watch_logs WHERE drama_id = ?")->execute([$delete_id]); $pdo->prepare("DELETE FROM dramas WHERE id = ?")->execute([$delete_id]); $pdo->commit(); $success = "Teledrama and all related data purged."; } catch (Exception $e) { $pdo->rollBack(); $error = "Delete failed: " . $e->getMessage(); } } // --- 4. HANDLE NEW TELEDRAMA REGISTRATION --- if (isset($_POST['add_drama'])) { $title = htmlspecialchars($_POST['title']); $desc = htmlspecialchars($_POST['description']); $pdo->prepare("INSERT INTO dramas (title, description) VALUES (?, ?)")->execute([$title, $desc]); $success = "Production registered successfully."; } // --- 5. HANDLE EPISODE UPLOAD --- if (isset($_POST['submit_episodes'])) { $drama_id = (int)$_POST['drama_id']; $ep_numbers = $_POST['ep_numbers']; $iframes = $_POST['iframes']; try { $pdo->beginTransaction(); $stmt = $pdo->prepare("INSERT INTO episodes (drama_id, ep_number, iframe_code) VALUES (?, ?, ?)"); foreach ($ep_numbers as $idx => $num) { if (!empty($num) && !empty($iframes[$idx])) { $stmt->execute([$drama_id, (int)$num, $iframes[$idx]]); } } $pdo->commit(); $success = "Episodes uploaded successfully."; } catch (Exception $e) { $pdo->rollBack(); $error = "Upload failed: " . $e->getMessage(); } } $dramas = $pdo->query("SELECT * FROM dramas ORDER BY created_at DESC")->fetchAll(); include '../includes/header.php'; ?>

Production Management

Click to start the hr timer for members.
Evaluation Started

...

Manage Content