require_once 'install.php';
    exit;
}
if (\PBPanel\AppLoader::updateAvailable($dataStore)) {
    require_once 'update.php';
    exit;
}
$session->createToken();
$botSettings = $functions->getDbTableArray('settings');
$isBotOnline = $connection->testConnection()[2] == 52;
$hostHandlerActive = $functions->getDbTableValueByKey('modules.ini', 'hostHandler.js', true);
$subscribeHandlerActive = $functions->getDbTableValueByKey('modules.ini', 'subscribeHandler.js', true);
$musicPlayerCurrentSong = $functions->getOtherFile($dataStore->getVar('paths', 'youtubeCurrentSong'));
$NOHosts = -1;
$NOSubscribers = -1;
$partsList = $functions->getPartsList();
$renderedMenu = '';
foreach ($partsList as $parentName => $subItems) {
    $parentId = 'menu-parent-' . $parentName;
    $renderedMenu .= '<li class="dropdown" id="' . $parentId . '"><a nohref class="dropdown-toggle" role="button">' . ucwords($parentName) . '</a><ul class="dropdown-menu" role="menu">';
    $icon = 'fa-cog';
    switch ($parentName) {
        case 'games':
            $icon = 'fa-gamepad';
            break;
        case 'extras':
            $icon = 'fa-plug';
            break;
    }
    foreach ($subItems as $item) {
        $openPartParam = $parentName . '/' . $item['partFile'];