<?php
include 'shikanisha.kts.php';

$sql = "SELECT DISTINCT YEAR(seller_date) AS year FROM transaction_receipts ORDER BY year DESC";
$result = $conn->query($sql);

$years = [];
if ($result->num_rows > 0) {
    while ($row = $result->fetch_assoc()) {
        $years[] = $row["year"];
    }
}

echo json_encode($years);
?>
