<?php

use yii\helpers\Html;

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

<header class="main-header">

    <?= Html::a('<span class="logo-mini"></span><span class="logo-lg">' . Yii::$app->name . '</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-custom-menu">

            <ul class="nav navbar-nav">
                <li class="dropdown notifications-menu">
                    <a href="#" class="dropdown-toggle" data-toggle="dropdown">
                        <i class="fa fa-bell-o"></i>
                        <span class="label label-warning"><?php echo (\Yii::$app->params['reingresados']) ?></span>
                    </a>
                    <ul class="dropdown-menu">
                        <li class="header">Tienes <?php echo (\Yii::$app->params['notificaciones']) ?> notificaciones</li>
                        <li>
                            <!-- inner menu: contains the actual data -->
                            <div class="slimScrollDiv" style="position: relative; overflow: hidden; width: auto; height: 200px;"><ul class="menu" style="overflow: hidden; width: 100%; height: 200px;">
                                    <li>
                                        <?php echo Html::a('<i class="fa fa-bullhorn text-red"></i>' . \Yii::$app->params['reingresados'] . ' Registros han sido reingresados.', ['/registros/reingresados'])?>
                                    </li>
                                </ul><div class="slimScrollBar" style="background: rgb(0, 0, 0); width: 3px; position: absolute; top: 0px; opacity: 0.4; display: block; border-radius: 7px; z-index: 99; right: 1px;"></div><div class="slimScrollRail" style="width: 3px; height: 100%; position: absolute; top: 0px; display: none; border-radius: 7px; background: rgb(51, 51, 51); opacity: 0.2; z-index: 90; right: 1px;"></div></div>
                        </li>
                    </ul>
                </li>
                <li class="dropdown user user-menu">
                    <a href="#" class="dropdown-toggle" data-toggle="dropdown">
                        <img src="<?php //echo Yii::$app->user->identity->foto ? 'uploaded/perfil/' . Yii::$app->user->identity->foto : 'uploaded/perfil/default.jpg'; ?>" class="img-circle" alt="" alt="" width="17" height="17"/>
                        <span class="hidden-xs"><?php echo Yii::$app->user->identity->username; ?></span>
                    </a>
                    <ul class="dropdown-menu">
                        <!-- User image -->
                        <li class="user-header">
                            <img src="<?php //decho $perfil->foto ? 'uploaded/perfil/' . $perfil->foto : '/uploaded/perfil/default.png';        ?>" class="img-circle" alt="" alt="" width="90" height="90"/>

                            <p>
                                <?php echo "| " . Yii::$app->user->identity->username; ?> - 
                                <?php
                                foreach (Yii::$app->authManager->getRolesByUser(Yii::$app->user->getId()) as $roles):
                                    echo $roles->name . " | ";
                                endforeach;
                                ?>
                                <small>Miembro desde < date('M, Y', Yii::$app->user->identity->created_at) ?></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(
                                        'Cerrar Sesion', ['/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>
            </ul>
        </div>
    </nav>
</header>
