<?php require_once __DIR__ . '/includes/bootstrap.php';
$pageTitle = 'Charts | Underground FX Radio';
$currentPage = basename(__FILE__);
include __DIR__ . '/includes/header.php';
?>
<section class="ugfx-page-hero">
  <div class="container-xxl">
    <div class="ugfx-kicker"><i class="bi bi-lightning-charge-fill"></i> Premium launch build</div>
    <h1 class="page-title">Top chart rotation</h1>
    <p class="page-copy">Top 50/chart-ready layout using imported count data from the Hometime package.</p>
  </div>
</section>

<section class="section-pad pt-3">
  <div class="container-xxl">
    <div class="ugfx-card p-4">
      <div class="table-responsive">
        <table class="table ugfx-table align-middle">
          <thead><tr><th>#</th><th>Track</th><th>Plays</th><th>Last seen</th></tr></thead>
          <tbody>
            <?php $i = 1; foreach (ugfx_get_top50(25) as $track): ?>
            <tr>
              <td><?= $i++ ?></td>
              <td><?= htmlspecialchars($track['title'] ?? 'Track') ?></td>
              <td><?= (int) ($track['count'] ?? 0) ?></td>
              <td><?= htmlspecialchars($track['last_seen'] ?? '') ?></td>
            </tr>
            <?php endforeach; ?>
          </tbody>
        </table>
      </div>
    </div>
  </div>
</section>

<?php include __DIR__ . '/includes/footer.php'; ?>
