<?php
require_once __DIR__ . '/../config/config_enhanced.php';
require_once __DIR__ . '/../classes/Database.php';
try {
    $db = Database::getInstance();
    echo "Connected DB\n";
    $rows = $db->fetchAll("SELECT id, name, template_name, status, created_at FROM message_templates ORDER BY created_at DESC LIMIT 10");
    echo json_encode($rows, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE) . PHP_EOL;
} catch (Exception $e) {
    echo 'ERROR: ' . $e->getMessage() . PHP_EOL;
}
