<?php
include_once('../../includes/db.php');

header('Content-Type: application/json');

$query = "SELECT id, title, description FROM offers ORDER BY id DESC";
$result = fetchAll($query);

if ($result) {
    echo json_encode(["status" => true, "data" => $result]);
} else {
    echo json_encode(["status" => false, "message" => "No offers found."]);
}
?>
