prepare("UPDATE todos SET status = IF(status = 'completed', 'pending', 'completed') WHERE id = ?"); $stmt->execute([$_POST['id']]); } break; case 'delete': if (isset($_POST['id'])) { $stmt = $pdo->prepare("DELETE FROM todos WHERE id = ?"); $stmt->execute([$_POST['id']]); } break; } } catch (PDOException $e) { die("Database error: " . $e->getMessage()); } header("Location: " . $_SERVER['HTTP_REFERER'] ?? 'completed.php'); exit; } // Fetch completed todos try { $todos = $pdo->query("SELECT * FROM todos WHERE status = 'completed' ORDER BY created_at DESC")->fetchAll(PDO::FETCH_ASSOC); } catch (PDOException $e) { die("Не удалось загрузить задачи: " . $e->getMessage()); } ?> Выполненные задачи // Super Todo List 2056

Super Todo List // 2056