<?php
include '../db.php';

// Get active void reasons
$query = "SELECT id, reason_name, description FROM void_reasons WHERE is_active = 1 ORDER BY reason_name";
$result = $conn->query($query);

$void_reasons = [];
while ($row = $result->fetch_assoc()) {
    $void_reasons[] = $row;
}

// Return JSON response
header('Content-Type: application/json');
echo json_encode($void_reasons);
?>
