<!-- Navbar -->
<header class="container header">
        <div class="header__hamburger"><i class="ham fas fa-bars"></i><i class="arr fas fa-angle-double-left"></i></div>
        <a class="header__left" href="<?= \PHPView\getControllerURL("izon.admin.controller.dashboardController") ?>"><?=__('Administrace')?></a>
        <?php
            $adminLoggedUser = \PHPView\getParameter("adminLoggedAdminUser");
            if ($adminLoggedUser) {
                $countries = \PHPView\getParameter("adminSupportedCountries");
                $selectedCountry = \PHPView\getParameter("adminSelectedCountry");
                echo '
                    <div class="header__userbox">
                        <div class="header__userbox__img">
                            <i class="fas fa-user-circle"></i>
                        </div>
                        <div class="header__userbox__name">'.$adminLoggedUser->getFirstName() ." ". $adminLoggedUser->getLastName().'</div>
                        <div class="header__userbox__popup">
                            <a href="/admin/logout">'.__('Odhlášení').'</a>
                        </div>
                    </div>
                    <div class="header__countries">'.
                        '<div class="header__country--active" style="background-image: url(/admin/default/static/css/flags/'.strtolower($selectedCountry->getLocaleCode()).'.png)">'.$selectedCountry->getLocaleCode().
                        '</div>'.
                        '<div class="header__countries__popup">';
                    if( count($countries) > 1 ) {
                        $flags = [
                            'CZE' => 'cz',
                            'BGR' => 'bg',
                            'DE' => 'de'
                        ];
                        foreach($countries as $country) {
                            if($country->getId() != $selectedCountry->getId()) {
                                echo '<a class="header__country '. $country->getCode() .'" href="'. PHPView\getControllerURL('izon.admin.controller.switchCountryController', ["countryCode" => $country->getCode()]) .'"';
                                echo ' title="'. $country->getName() .'" style="background-image: url(/admin/default/static/css/flags/'.strtolower($country->getLocaleCode()).'.png)">'. $country->getLocaleCode() .'</a>';
                            }
                            
                        }
                    }
                echo '</div></div>';
            }
        ?>
</header>
<!-- /navbar -->