prepare("SELECT video_url, source_type FROM videos WHERE id = ?"); $stmt->execute([$id]); $v = $stmt->fetch(); if ($v && $v['source_type'] === 'upload') { @unlink('../' . $v['video_url']); } $pdo->prepare("DELETE FROM videos WHERE id = ?")->execute([$id]); cleanupTags(); header('Location: index.php?msg=deleted'); exit; } $stmt = $pdo->prepare("SELECT v.*, u.username FROM videos v JOIN users u ON v.uploader_id = u.id ORDER BY v.created_at DESC"); $stmt->execute(); $videos = $stmt->fetchAll(); // Get reported comments count $reported_count = $pdo->query("SELECT COUNT(*) FROM comments WHERE is_reported = TRUE")->fetchColumn(); // Reuse header ob_start(); require_once '../includes/header.php'; $header = ob_get_clean(); echo str_replace(['assets/', 'index.php', 'login.php', 'logout.php', 'admin/'], ['../assets/', '../index.php', '../login.php', '../logout.php', './'], $header); ?>
Branding & Site Manage Users Reports () 0): ?> ! System Logs

Manage Sermons

Add New Video
Video Uploader Date Views Actions
No videos uploaded yet.