<?php
session_start();
require_once __DIR__ . '/../config.php';

if (!isset($_SESSION['token'])) {
    header('Location: login.php');
    exit;
}

$token = $_SESSION['token'];
$profile_result = api_get_profil($token);

echo "<h1>Debug Profil - Simple</h1>";
echo "<p><strong>Success:</strong> " . ($profile_result['success'] ? 'YES' : 'NO') . "</p>";
echo "<p><strong>HTTP Code:</strong> " . $profile_result['http_code'] . "</p>";

echo "<h2>Full Response:</h2>";
echo "<pre style='background: #f0f0f0; padding: 10px; white-space: pre-wrap;'>";
print_r($profile_result);
echo "</pre>";

echo "<h2>JSON Response:</h2>";
echo "<pre style='background: #f0f0f0; padding: 10px; white-space: pre-wrap;'>";
echo json_encode($profile_result, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE);
echo "</pre>";

echo "<hr>";
echo "<p><a href='rekam.php'>← Kembali ke Rekam Presensi</a></p>";
