<?php
/**
 * cek_model.php — Dilindungi: Admin Only
 */
session_start();
include 'config/database.php';

if (!isset($_SESSION['user_id']) || !isset($_SESSION['role']) || $_SESSION['role'] !== 'admin') {
    http_response_code(403);
    header('Location: auth/login_page.php');
    exit;
}

// Ambil cfg dari DB
$cfg = mysqli_fetch_assoc(mysqli_query($conn, "SELECT * FROM settings WHERE id = 1"));
$model = $cfg['gemini_model'] ?? '(belum dikonfigurasi)';

echo "<b>Model LLM Aktif:</b> " . htmlspecialchars($model) . "<br>";
echo "<b>Status:</b> Dikonfigurasi via panel Admin Xieqa<br>";
?>