<?php
$pdo = require __DIR__ . '/../config/db.php';
$site_id = $_POST['site_id'] ?? null;
$score = $_POST['score'] ?? null;
if ($site_id && $score !== null) {
    $stmt = $pdo->prepare("UPDATE sites SET evaluate_score = :score WHERE id = :id");
    $stmt->execute([':score' => $score, ':id' => $site_id]);
    echo 'success';
} else {
    echo 'error';
}