<?php
require_once __DIR__ . '/config/database.php';

$stmt = $pdo->prepare("SELECT setting_key, setting_value FROM settings WHERE setting_key LIKE 'non_musking_tpl_%'");
$stmt->execute();
$results = $stmt->fetchAll();

echo "Non-musking templates in database:\n";
foreach ($results as $row) {
    echo $row['setting_key'] . " = " . $row['setting_value'] . "\n";
}

// Check if fee payment template exists specifically
$stmt = $pdo->prepare("SELECT setting_value FROM settings WHERE setting_key = 'non_musking_tpl_fee_payment'");
$stmt->execute();
$template = $stmt->fetch();

if ($template) {
    echo "\n✅ Fee payment template found: " . $template['setting_value'] . "\n";
} else {
    echo "\n❌ Fee payment template NOT found\n";
}

// Check API key
$stmt = $pdo->prepare("SELECT setting_value FROM settings WHERE setting_key = 'non_musking_api_key'");
$stmt->execute();
$api_key = $stmt->fetch();

if ($api_key && $api_key['setting_value']) {
    echo "✅ API key is set\n";
} else {
    echo "❌ API key is NOT set\n";
}
?>