<?php

require_once __DIR__ . '/../core/functions.php';

$symbols = get_all_symbols();

?>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Trading Decision Assistant</title>
    <link rel="stylesheet" href="assets/style.css">
</head>
<body>

<div class="header">
    <h1>Trading Decision Assistant</h1>
</div>

<div class="container">

    <div class="card">
        <h2>Forex + Gold Analysis Platform</h2>
        <p>
            Select a symbol to start building SMC-based technical analysis,
            fundamental confirmation, news filter, confluence score, trade plan,
            alerts, and risk calculator.
        </p>
    </div>

    <div class="card">
        <h2>Supported Symbols</h2>

        <?php if (!$symbols): ?>
            <p>No symbols found. Please run install.sql first.</p>
        <?php else: ?>
            <div class="grid">
                <?php foreach ($symbols as $symbol): ?>
                    <div class="symbol-card">
                        <h3><?= e($symbol['symbol']) ?></h3>
                        <p><?= e($symbol['display_name']) ?></p>
                        <span class="badge"><?= e($symbol['asset_type']) ?></span>
                        <br>
                        <a class="button" href="../admin/dashboard.php?symbol=<?= urlencode($symbol['symbol']) ?>">
                            Analyze
                        </a>
                    </div>
                <?php endforeach; ?>
            </div>
        <?php endif; ?>

    </div>

</div>

</body>
</html>