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
0 && $episode_id > 0 && $seconds_to_add > 0) { try { /** * We use ON DUPLICATE KEY UPDATE so that: * 1. If it's the first time watching this episode, it creates a row. * 2. If the row exists, it ADDS the new seconds to the old total. */ $sql = "INSERT INTO watch_logs (user_id, drama_id, episode_id, watch_time_seconds, last_updated) VALUES (?, ?, ?, ?, CURRENT_TIMESTAMP) ON DUPLICATE KEY UPDATE watch_time_seconds = watch_time_seconds + VALUES(watch_time_seconds), last_updated = CURRENT_TIMESTAMP"; $stmt = $pdo->prepare($sql); $stmt->execute([$user_id, $drama_id, $episode_id, $seconds_to_add]); // Return JSON so the JavaScript 'fetch' knows it worked echo json_encode(['status' => 'success', 'added' => $seconds_to_add]); } catch (PDOException $e) { header('HTTP/1.1 500 Internal Server Error'); echo json_encode(['status' => 'error', 'message' => $e->getMessage()]); } } else { echo json_encode(['status' => 'ignored', 'message' => 'Invalid data provided']); } }