<?php
namespace App\Controllers;

use App\Core\Controller;
use App\Core\Database;

class SuperAdminConferenceController extends Controller
{
    public function index()
    {
        if (!is_super_admin()) exit('Forbidden');

        $db = Database::getInstance();
        $confs = $db->query("
            SELECT c.*, o.name as org_name
            FROM conferences c
            LEFT JOIN organizations o ON c.org_id = o.id
            ORDER BY c.id DESC
        ")->fetchAll();

        $this->view('superadmin/conferences/index', compact('confs'));
    }
}
