<?php
// =====================================================
// POST /update_notice.php
// Params: notice
// Response: { status, message }
// =====================================================
require_once 'config.php';

$conn = getConnection();

$notice = $_POST['notice'] ?? '';

$stmt = $conn->prepare("UPDATE setting SET notice = ? WHERE id = 1");
$stmt->bind_param("s", $notice);

if ($stmt->execute()) {
    echo json_encode(["status" => "success", "message" => "Notice updated"]);
} else {
    echo json_encode(["status" => "error", "message" => "Failed to update notice"]);
}

$stmt->close();
$conn->close();
