<?php
use yii\helpers\Html;
use common\components\Helper;

/* @var $this \yii\web\View */
/* @var $content string */
?>

<header class="main-header">

    <?= Html::a('<span class="logo-mini">A</span><span class="logo-lg">Fitness Admin</span>', Yii::$app->homeUrl, ['class' => 'logo']) ?>

    <nav class="navbar navbar-static-top" role="navigation">

        <a href="#" class="sidebar-toggle" data-toggle="offcanvas" role="button">
            <span class="sr-only">Toggle navigation</span>
        </a>

		<div class="navbar-header">
			 <a class="navbar-brand" href="#"> <?php echo Helper::getCompanyName() ?> Adminisztráció</a>
		</div>

        <div class="navbar-custom-menu">

        	<?php if (  !Yii::$app->user->isGuest  ){?>
            <ul class="nav navbar-nav">

                <!-- User Account: style can be found in dropdown.less -->
				
                <li class="dropdown user user-menu">
                    <a href="#" class="dropdown-toggle" data-toggle="dropdown">
                    	<span class='glyphicon glyphicon-user'></span>
                        <span class="hidden-xs"><?php echo Yii::$app->user->identity->username?></span>
                    </a>
                    <ul class="dropdown-menu">
                        <!-- User image -->
                        <li class="user-header">

                            <p>
                                <?php echo Yii::$app->user->identity->username?>
                                <small>Felhasználó</small>
                            </p>
                        </li>
                        <!-- Menu Footer-->
                        <li class="user-footer">
                            <div class="pull-left">
                            	<!-- 
                                <a href="#" class="btn btn-default btn-flat">Profile</a>
                            	 -->
                            </div>
                            <div class="pull-right">
                                <?= Html::a(
                                    Yii::t('common/site','Logout'),
                                    ['/site/logout'],
                                    ['data-method' => 'post', 'class' => 'btn btn-default btn-flat']
                                ) ?>
                            </div>
                        </li>
                    </ul>
                </li>

                <!-- User Account: style can be found in dropdown.less -->
                <!--  
                <li>
                    <a href="#" data-toggle="control-sidebar"><i class="fa fa-gears"></i></a>
                </li>
                -->
              	<?php 
                }
                ?>
            </ul>
        </div>
    </nav>
</header>
