<?php
header('Content-Type: application/json; charset=utf-8');
include('../connection.php');

$result = $conn->query('SELECT notice, version, url_lineman, video_url, image_url, isVideo, isImage FROM user_setting ORDER BY id ASC LIMIT 1');

if ($result && $row = $result->fetch_assoc()) {
    echo json_encode([
        'status' => 'success',
        'notice' => $row['notice'],
        'version' => (int) $row['version'],
        'video_url' => $row['video_url'],
        'image_url' => $row['image_url'],
        'isVideo' => (int) $row['isVideo'],
        'isImage' => (int) $row['isImage'],
        'url_lineman' => $row['url_lineman']
    ], JSON_UNESCAPED_UNICODE);
    exit;
}

echo json_encode([
    'status' => 'error',
    'message' => 'User setting not found'
], JSON_UNESCAPED_UNICODE);