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

$sql = "SELECT id, status_name FROM tbldeleveryassignstatus ORDER BY id ASC";
$result = $conn->query($sql);

$statuses = [];

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

echo json_encode(['status' => 'success', 'data' => $statuses]);
$conn->close();
?>
