<?php
declare(strict_types=1);

namespace App\Controllers;

require_once BASE_PATH . '/app/helpers/permissions.php';

use App\Core\Controller;

final class AdminPlaceholderController extends Controller
{
    public function page(): void
    {
        require_login();
        if (!can_admin() && !can_chair() && !can_trackchair()) { http_response_code(403); echo "Forbidden"; return; }

        $key = (string)($_GET['k'] ?? '');
        $titles = [
          'reviewers' => ['ar'=>'المحكمون','en'=>'Reviewers'],
          'committees' => ['ar'=>'اللجان','en'=>'Committees'],
          'chairs' => ['ar'=>'الرؤساء و TPC','en'=>'Chairs & TPC'],
          'production' => ['ar'=>'الإنتاج (Camera-ready)','en'=>'Production'],
          'galley' => ['ar'=>'النسخة النهائية (Galley)','en'=>'Galley'],
          'proceedings' => ['ar'=>'وقائع المؤتمر','en'=>'Proceedings'],
          'jobs' => ['ar'=>'مراقبة المهام','en'=>'Jobs Monitor'],
          'roles' => ['ar'=>'إدارة الصلاحيات','en'=>'Roles & Permissions'],
          'audit' => ['ar'=>'سجل التدقيق','en'=>'Audit Log'],
        ];
        $lang = function_exists('current_lang') ? current_lang() : 'ar';
        $t = $titles[$key] ?? ['ar'=>'صفحة','en'=>'Page'];

        $this->view('admin/placeholder', ['title'=>($lang==='ar'?$t['ar']:$t['en']), 'key'=>$key]);
    }
}
