<?php
// Simple test script to check tatkal API
header('Content-Type: text/html; charset=utf-8');

echo "<h2>🔥 Tatkal API Test</h2>";

// Test the API
$url = 'http://localhost/astro_admin/api/get_tatkal_settings.php';
$response = file_get_contents($url);

echo "<h3>Raw Response:</h3>";
echo "<pre>" . htmlspecialchars($response) . "</pre>";

echo "<h3>JSON Decode Test:</h3>";
$data = json_decode($response, true);
if ($data) {
    echo "<pre>" . print_r($data, true) . "</pre>";
} else {
    echo "<p style='color: red;'>❌ JSON decode failed: " . json_last_error_msg() . "</p>";
}

echo "<h3>Response Headers:</h3>";
$headers = get_headers($url, 1);
echo "<pre>" . print_r($headers, true) . "</pre>";
?>