<?php

use SCF\Core\DI;
use SCF\Core\Database;

$acl = DI::getInstance()->get('acl');

if($acl->acl('see_SKS') == 1) {
    $db_slave = new Database($config['dbext'], $config['dbhost'], $config['dbuser'], $config['dbpass'], 'sks_gametracking');
    $sksSettings = [];

    $db_slave->query("SELECT * FROM sks_core_settings");
    $set = $db_slave->fetchArray();

    foreach ($set as $key => $value) {
        $sksSettings[$value['setting']] = $value['value'];
    }

    //var_dump($sksSettings);
    $tpl->assign('sksSettings', $sksSettings);
    $tpl->display('Data/PageAdmin/sternenkindsaga.tpl');
} else {
    $tpl->display('errorpages/AclError.tpl');
}