<nav class="navbar navbar-default navbar-fixed-top" role="navigation">
    <div class="container">
        <!-- Brand and toggle get grouped for better mobile display -->
        <div class="navbar-header">
            <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
                <span class="sr-only">Toggle navigation</span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
            </button>
            <a class="navbar-brand" href="/"><strong>{{$settings->site_name}}</strong></a>
        </div>
        <!-- Collect the nav links, forms, and other content for toggling -->
        <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
            <ul class="nav navbar-nav">
                <li>
                    <a href="/polls"> Polls </a>
                </li>
                @if(isset($settings->guess_number_status) && $settings->guess_number_status==1)
                @endif
                @if(isset(Auth::user()->id))
                <li class="hide">
                    <a href="#" class="dropdown-toggle" data-toggle="dropdown"> Quizzes <b class="caret"></b></a>
                    <ul class="dropdown-menu">
                        @foreach($quiz_group as $gp)
                        <li class="hide">
                            <a href="/user/user?quiz_group={{$gp->group_id}}">  {{$gp->group_name}} </a>
                        </li>
                        @endforeach
                    </ul>
                </li>
                @endif
                <?php $pages = Common::allActiveNavbarPages(); ?>
                @foreach($pages as $p)
                <?php $sub_pages = Common::allActiveChildPages($p->page_id); ?>
                <li class="hide">
                    <a href="/page/{{isset($p->slug)?$p->slug:''}}" title="{{isset($p->page_name)?$p->page_name:''}}" {{(!empty($sub_pages))?'class="dropdown-toggle" data-toggle="dropdown"':''}}>{{isset($p->page_name)?$p->page_name:''}}@if(!empty($sub_pages)) <b class="caret"></b>@endif</a>
                    @if(!empty($sub_pages))
                    <ul class="dropdown-menu">
                        @foreach($sub_pages as $subp)
                        <li>
                            <a href="/page/{{$subp->slug}}"> {{$subp->page_name}} </a>
                        </li>
                        @endforeach
                    </ul>
                    @endif
                </li>
                @endforeach
            </ul>
            <ul class="nav navbar-nav navbar-right">
               <!-- <li><a class="dropdown-toggle animated tada vr-text-color infinite" href="http://codecanyon.net/item/vinnorokom-facebook-quiz-viral-app/10869572"><b>Buy Now Only $ 13</b></a> </li> -->
                @if(isset(Auth::user()->id))
                <li class="hidden-md hidden-sm"><a href="#" style="padding-top:3px ; padding-bottom: 3px;">
                        <img class="img-thumbnail" width="90%" src="https://graph.facebook.com/{{(!isset(Auth::user()->id))?2:Auth::user()->fbid}}/picture"></a>
                </li>
                @endif
                <li class="dropdown">
                    @if(isset(Auth::user()->id))
                    <a href="#" class="dropdown-toggle" data-toggle="dropdown"> {{Auth::user()->name}} <b class="caret"></b></a>
                    <ul class="dropdown-menu">
                        <li>
                            <a href="/user/user"><i class="fa fa-user"></i> My Profile </a>
                        </li>
                        <li>
                            <a href="{{url('/logout')}}"><i class="fa fa-sign-out"></i> Logout  </a>
                        </li>
                    </ul>
                    @else
                    <a href="javascript:void(0)" class="dropdown-toggle facebook-connection facebook-btn">
                        <i class="fa fa-facebook"></i> Login with <strong> Facebook </strong>
                    </a>
                    @endif
                </li>
            </ul>
        </div>
        <!-- /.navbar-collapse -->
    </div>
    <!-- /.container -->
</nav>
