
<aside class="main-sidebar">

    <section class="sidebar">

        <!-- Sidebar user panel -->
        <div class="user-panel">
            <div class="pull-left image">
                <img src="<?= $directoryAsset ?>/img/fbt3.jpg" class="img-circle" alt="User Image"/>
            </div>
            <div class="pull-left info">
                <p>Federación Boliviana <br>de Tenis (FBT)</p>

                <!-- <a href="#"><i class="fa fa-circle text-success"></i> FBT</a> -->
            </div>
        </div>

        <!-- search form -->
        <!-- <form action="#" method="get" class="sidebar-form">
            <div class="input-group">
                <input type="text" name="q" class="form-control" placeholder="Search..."/>
              <span class="input-group-btn">
                <button type='submit' name='search' id='search-btn' class="btn btn-flat"><i class="fa fa-search"></i>
                </button>
              </span>
            </div>
        </form> -->
        <!-- /.search form -->

        <?php
            $vecAsociaciones = array();
            foreach ($modelAsociaciones as $asoc) {
                $vecAsociaciones[]= ['label' => $asoc->departamento, 'icon' => 'fa fa-home', 'url' => ['cat-club/index','id_asociacion'=>$asoc->id_asociacion],];
            }

            //$opcionesPerfil=['label' => 'Solicitar BPIN', 'icon' => 'fa fa-address-card-o','url' => ['bpin-solicitud/create']];

            $opcionesPerfil=[
                ['label' => 'Solicitar BPIN', 'icon' => 'fa fa-address-card-o', 'url' => ['bpin-solicitud/create']],
                ['label' => 'Consultar BPIN', 'icon' => 'fa fa-question-circle-o', 'url' => ['cat-jugador/consultabpin']
                ],
            
                /*['label' => 'Credenciales Entrenadores', 'icon' => 'fa fa-graduation-cap', 'url' => ['cap-entrenador/solicitud']]*/
            ];


            if (!Yii::$app->user->isGuest)
            {
                $idSolo = Yii::$app->generales->getIdSolo(Yii::$app->user->identity->id);
                if (!Yii::$app->user->isGuest&&Yii::$app->user->identity->esJugador)
                {
                    $opcionesPerfil=[['label' => 'Opciones Jugador', 'icon' => 'fa fa-user-o', 'options' => ['class' => 'jugador'], 'url' => ['#'],
                                'items' => [
                                    ['label' => 'Ver ficha', 'icon' => 'fa fa-address-card-o', 'options' => ['class' => 'jugador'], 'url' => ['cat-jugador/view', 'id' => $idSolo]],
                                    ['label' => 'Editar Información', 'icon' => 'fa fa-cog', 'options' => ['class' => 'jugador'], 'url' => ['cat-jugador/update']],
                                    ['label' => 'Cambiar contraseña', 'icon' => 'fa fa-lock', 'options' => ['class' => 'jugador'], 'url' => ['site/changepassword']],
                                    ['label' => 'Cambiar fotografia', 'icon' => 'fa fa-meh-o', 'options' => ['class' => 'jugador'], 'url' => ['cat-jugador/upload']],
                                    ['label' => 'Solicitar cambio de club', 'icon' => 'fa fa-random', 'options' => ['class' => 'jugador'], 'url' => ['cat-jugador-solicitud-cambio-club/create']],
                                    ['label' => 'Ver penalizaciones', 'icon' => 'fa fa-flag', 'options' => ['class' => 'jugador'], 'url' => ['pen-penalizacion/index'],],
                                    ['label' => 'Tor. internacional', 'icon' => 'fa fa-plane', 'options' => ['class' => 'jugador'], 'url' => ['tor-internacional-solicitud/index'],],
                                    ['label' => 'Incribirse', 'icon' => 'fa fa-user-plus', 'options' => ['class' => 'jugador'], 'url' => ['cat-jugador/torneosparainscribirse'],],
                                    ['label' => 'Retirarse', 'icon' => 'fa fa-user-times', 'options' => ['class' => 'jugador'], 'url' => ['cat-jugador/torneosparainscribirse'],],
                                    ['label' => 'Publicar Anuncios', 'icon' => 'fa fa-shopping-cart', 'options' => ['class' => 'jugador'], 'url' => ['pub-anuncios/index'],],
                                ],
                            ]];
                }
                if (Yii::$app->user->identity->esAdministrador)
                {
                    $opcionesPerfil=[['label' => 'Opciones Administrador', 'icon' => 'fa fa-user-o', 'options' => ['class' => 'jugador'], 'url' => ['#'],
                            'items' =>  [
                                ['label' => 'Cambiar contraseña', 'icon' => 'fa fa-lock', 'options' => ['class' => 'jugador'], 'url' => ['site/changepassword']],
                                /*['label' => 'SIMULACIÓN Ranking', 'icon' => 'fa fa-signal', 'options' => ['class' => 'jugador'], 'url' => ['#'],
                                    'items' =>  [['label' => 'Menores y Seniors', 'icon' => 'fa fa-cog', 'options' => ['class' => 'jugador'], 'url' => ['rank-tor-ranking/index']],]
                                ],
                                ['label' => 'Puntajes', 'icon' => 'fa fa-cog', 'options' => ['class' => 'jugador'], 'url' => ['#'], 
                                    'items' =>  [['label' => 'Puntajes Menores', 'icon' => 'fa fa-cog', 'options' => ['class' => 'jugador'], 'url' => ['rank-cat-puntaje/index', 'tipo' => 'JUNIOR']],
                                ['label' => 'Puntajes Senior', 'icon' => 'fa fa-cog', 'options' => ['class' => 'jugador'], 'url' => ['rank-cat-puntaje/index', 'tipo' => 'SENIOR']],
                                ['label' => 'Puntajes Tenis 10', 'icon' => 'fa fa-cog', 'options' => ['class' => 'jugador'], 'url' => ['rank-cat-puntaje/index', 'tipo' => 'TENIS10']],]
                                ],
                                */
                            ],
                        ],
                        // Gmurillo: Menu de acceso a funciones de Capacitacion
                                ['label' => 'Capacitacion Entrenadores', 'icon' => 'fa fa-university','url' => ['#'],
                                    'items' => [
                                    ['label' => 'Curso', 'icon' => 'fa fa-book', 'options' => ['class' => 'jugador'], 'url' => ['cap-curso/index']],
                                    ['label' => 'Entrenador', 'icon' => 'fa fa-user-plus', 'options' => ['class' => 'jugador'], 'url' => ['cap-entrenador/index']],
                                    ['label' => 'Noticias/Informacion', 'icon' => 'fa fa-bullhorn', 'options' => ['class' => 'jugador'], 'url' => ['cap-noticia/index']],
                                    ['label' => 'Tipo Curso', 'icon' => 'fa fa-bookmark', 'options' => ['class' => 'jugador'], 'url' => ['cap-tipo-curso/index']],
                                    ['label' => 'Nivel Entrenador', 'icon' => 'fa fa-user-circle', 'options' => ['class' => 'jugador'], 'url' => ['cap-nivel-entrenador/index']],
                                                ],
                                ]
                    ];
                }
                if (Yii::$app->user->identity->esArbitro)
                {
                    $opcionesPerfil=[['label' => 'Opciones Arbitro', 'icon' => 'fa fa-user-o', 'options' => ['class' => 'jugador'], 'url' => ['#'],
                                'items' => [
                                    ['label' => 'Cambiar contraseña', 'icon' => 'fa fa-lock', 'options' => ['class' => 'jugador'], 'url' => ['site/changepassword']],
                                     ['label' => 'Ingreso Resultados', 'icon' => 'fa fa-circle', 'options' => ['class' => 'jugador'], 'url' => ['cat-torneo/index_arbitro']],
                                ],
                            ]];
                }
                if (Yii::$app->user->identity->esContador)
                {
                    $opcionesPerfil=[['label' => 'Opciones Contador', 'icon' => 'fa fa-user-o', 'options' => ['class' => 'jugador'], 'url' => ['#'],
                                'items' => [
                                    ['label' => 'Consolidación AUTOMÁTICA', 'icon' => 'fa fa-usd', 'options' => ['class' => 'jugador'], 'url' => ['bpin-pago-banco-excel/index']],
                                    ['label' => 'Consolidación MANUAL', 'icon' => 'fa fa-usd', 'options' => ['class' => 'jugador'], 'url' => ['con-concepto/index']],
                                    ['label' => 'Exportar a Excel', 'icon' => 'fa fa-usd', 'options' => ['class' => 'jugador'], 'url' => ['exportar-a-excel-form/index']],
                                    ['label' => 'Reporte programado', 'icon' => 'fa fa-usd', 'options' => ['class' => 'jugador'], 'url' => ['reporte-programado/index']],
                                    ['label' => 'Cambiar contraseña', 'icon' => 'fa fa-lock', 'options' => ['class' => 'jugador'], 'url' => ['site/changepassword']],
                
                                ],
                            ],
                            // Gmurillo: Menu de acceso a funciones de Capacitacion
                                ['label' => 'Capacitacion Entrenadores', 'icon' => 'fa fa-university','url' => ['#'],
                                    'items' => [
                                    ['label' => 'Curso', 'icon' => 'fa fa-book', 'options' => ['class' => 'jugador'], 'url' => ['cap-curso/index']],
                                    ['label' => 'Entrenador', 'icon' => 'fa fa-user-plus', 'options' => ['class' => 'jugador'], 'url' => ['cap-entrenador/index']],
                                    ['label' => 'Noticias/Informacion', 'icon' => 'fa fa-bullhorn', 'options' => ['class' => 'jugador'], 'url' => ['cap-noticia/index']],
                                    ['label' => 'Tipo Curso', 'icon' => 'fa fa-bookmark', 'options' => ['class' => 'jugador'], 'url' => ['cap-tipo-curso/index']],
                                    ['label' => 'Nivel Entrenador', 'icon' => 'fa fa-user-circle', 'options' => ['class' => 'jugador'], 'url' => ['cap-nivel-entrenador/index']],
                                                ],
                                ]
                        ];
                    
                }
                if (Yii::$app->user->identity->esAsociacion)
                {
                    $opcionesPerfil=[['label' => 'Opciones Asociación', 'icon' => 'fa fa-user-o', 'options' => ['class' => 'jugador'], 'url' => ['#'],
                                'items' => [
                                    ['label' => 'Gestión de delegados', 'icon' => 'fa fa-circle-o', 'options' => ['class' => 'jugador'], 'url' => ['cat-delegado/index']],
                                    ['label' => 'Asignar delegados a torneos', 'icon' => 'fa fa-circle-o', 'options' => ['class' => 'jugador'], 'url' => ['cat-torneo/index_asociacion']],
                                    ['label' => 'Cambiar contraseña', 'icon' => 'fa fa-lock', 'options' => ['class' => 'jugador'], 'url' => ['site/changepassword']],
                                ],
                            ]];
                }
                // Agregado GMURILLO para perfil ENTRENADOR
                if (Yii::$app->user->identity->esEntrenador)
                {
                    $opcionesPerfil=[['label' => 'Opciones Entrenador', 'icon' => 'fa fa-graduation-cap', 'options' => ['class' => 'jugador'], 'url' => ['#'],
                                'items' => [
                                    ['label' => 'Mi Perfil', 'icon' => 'fa fa-edit', 'options' => ['class' => 'jugador'], 'url' => ['cap-entrenador/perfil']],
                                    ['label' => 'Cursos', 'icon' => 'fa fa-book', 'options' => ['class' => 'jugador'], 'url' => ['cap-inscripcion-curso/listadocursos']],
                                    ['label' => 'Mis Cursos', 'icon' => 'fa fa-bookmark', 'options' => ['class' => 'jugador'], 'url' => ['cap-inscripcion-curso/miscursos']],
                                    ['label' => 'Entrenadores', 'icon' => 'fa fa-user-plus', 'options' => ['class' => 'jugador'], 'url' => ['cap-entrenador/listado']],
                                    ['label' => 'Cambiar contraseña', 'icon' => 'fa fa-lock', 'options' => ['class' => 'jugador'], 'url' => ['site/changepassword']],
                                ],
                            ]];
                }
            }
            
        ?>
        <?php 
            $items = [
                ['label' => 'FBT', 'options' => ['class' => 'header']],
                ['label' => 'Inicio', 'icon' => 'fa fa-home','url' => ['site/index']],
                
            ];

            $items1 =[
                [
                    'label' => 'Ranking Singles historicos',
                    'icon' => 'fa fa-image',
                    'url' => '#',
                    'items' => [
                        ['label' => 'Junior', 'icon' => 'fa fa-sort-amount-asc', 'url' => ['tor-ranking/index', 'tipo' => 'JUNIOR'],],
                        ['label' => 'Absoluto', 'icon' => 'fa fa-sort-amount-asc', 'url' => ['tor-ranking/index', 'tipo' => 'ABSOLUTO'],],
                        ['label' => 'Senior', 'icon' => 'fa fa-sort-amount-asc', 'url' => ['tor-ranking/index', 'tipo' => 'SENIOR'],],
                        ['label' => 'Tenis 10', 'icon' => 'fa fa-sort-amount-asc', 'url' => ['tor-ranking-iniciacion/index'],],
                    ],
                ],
                [
                    'label' => 'Ranking Dobles historicos',
                    'icon' => 'fa fa-image',
                    'url' => '#',
                    'items' => [
                        ['label' => 'Junior', 'icon' => 'fa fa-sort-amount-asc', 'url' => ['tor-ranking-dobles/index', 'tipo' => 'JUNIOR'],],
                        ['label' => 'Absoluto', 'icon' => 'fa fa-sort-amount-asc', 'url' => ['tor-ranking-dobles/index', 'tipo' => 'ABSOLUTO'],],
                    ],
                ],
                [
                    'label' => 'Ranking de Clubes',
                    'icon' => 'fa fa-image',
                    'url' => '#',
                    'items' => [
                        ['label' => 'Junior', 'icon' => 'fa fa-sort-amount-asc', 'url' => ['tor-ranking-clubes-form/index', 'tipo' => 'JUNIOR'],],
                         ['label' => 'Absoluto', 'icon' => 'fa fa-sort-amount-asc', 'url' => ['tor-ranking/index', 'tipo' => 'ABSOLUTO'],],
                        ['label' => 'Senior', 'icon' => 'fa fa-sort-amount-asc', 'url' => ['tor-ranking-clubes-form/index', 'tipo' => 'SENIOR'],],
                        ['label' => 'Tenis 10', 'icon' => 'fa fa-sort-amount-asc', 'url' => ['tor-ranking-clubes-form/indextenis10'],],
                    ],
                ],
                ['label' => 'Torneos', 'icon' => 'fa fa-calendar', 'url' => ['cat-torneo/index']], 
                ['label' => 'Jugadores', 'icon' => 'fa fa-group', 'url' => ['cat-jugador/index']], 
                [
                    'label' => 'Clubs de Tenis',
                    'icon' => 'fa fa-image',
                    'url' => '#',
                    'items' => $vecAsociaciones,
                ],
                ['label' => 'Reglamentos y puntajes FBT', 'icon' => 'fa fa-file-text-o','url' => ['inf-general-form/reglamentos']], 
                ['label' => 'Asociaciones y arbitros', 'icon' => 'fa fa-address-book-o','url' => ['inf-general-form/contacto']], 
                ['label' => 'Contacto', 'icon' => 'fa fa-address-book-o','url' => ['/site/contact']], 
                ['label' => 'Estadisticas Generales', 'icon' => 'fa fa-address-book-o','url' => ['/site/estadisticasgenerales']], 
                [
                    'label' => 'Estadisticas',
                    'icon' => 'fa fa-image',
                    'url' => '#',
                    'items' => [
                        ['label' => 'Tenis 10', 'icon' => 'fa fa-line-chart','url' => ['/site/estadisticasdetalletenis10']],
                        ['label' => 'Menores G1', 'icon' => 'fa fa-line-chart','url' => ['/site/estadisticasdetalleg1']],
                        ['label' => 'Menores G2', 'icon' => 'fa fa-line-chart','url' => ['/site/estadisticasdetalleg2']],
                        ['label' => 'Menores G3', 'icon' => 'fa fa-line-chart','url' => ['/site/estadisticasdetalleg3']],
                        ['label' => 'Menores G4', 'icon' => 'fa fa-line-chart','url' => ['/site/estadisticasdetalleg4']],
                        ['label' => 'Menores G5', 'icon' => 'fa fa-line-chart','url' => ['/site/estadisticasdetalleg5']],
                        ['label' => 'Menores GA', 'icon' => 'fa fa-line-chart','url' => ['/site/estadisticasdetallega']],
                        ['label' => 'Absoluto', 'icon' => 'fa fa-line-chart','url' => ['/site/estadisticasdetalleabsoluto']],
                        ['label' => 'Senior', 'icon' => 'fa fa-line-chart','url' => ['/site/estadisticasdetallesenior']],
                        ['label' => 'Internacional', 'icon' => 'fa fa-line-chart','url' => ['/site/estadisticasdetalleinternacional']]
                    ],
                ],
                 
            ];
            $items2 = array_merge($items, $opcionesPerfil);
            $items3 = array_merge($items2, $items1);
        ?>
        <?= dmstr\widgets\Menu::widget(
            [
                'options' => ['class' => 'sidebar-menu'],
                'items' => $items3,
            ]
        ) ?>

        <?php
            
        ?>
    </section>

</aside>
