<?php
// Site evaluation handler
require_once __DIR__ . '/../config/db.php';

if ($_SERVER['REQUEST_METHOD'] === 'POST') {
    $format_id = $_POST['format_id'] ?? null;
    $score = $_POST['evaluate_score'] ?? null;
    if ($format_id && $score) {
        $stmt = $pdo->prepare('UPDATE formats SET evaluate_score = ? WHERE id = ?');
        $stmt->execute([$score, $format_id]);
        echo 'success';
    } else {
        echo 'error';
    }
}
?>
