<?php
require_once '../config/database.php';
secureSessionStart();
requireLogin();

$conn = getConnection();

$query = "SELECT * FROM support_templates ORDER BY title ASC";
$result = mysqli_query($conn, $query);

$templates = [];
while ($row = mysqli_fetch_assoc($result)) {
    $templates[] = $row;
}

echo json_encode($templates);
?>