<!DOCTYPE html>
<html lang="fr">
<head>

    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>ECOS</title>

    {!! Html::style('https://cdnjs.cloudflare.com/ajax/libs/materialize/0.97.5/css/materialize.min.css') !!}
    {!! Html::style('https://fonts.googleapis.com/icon?family=Material+Icons') !!}
    {!! Html::style('css/style.css') !!}
    {!! Html::style('css/nanoscroller.css') !!}
    {!! Html::style('css/materialize.css') !!}

    {!! Html::script('https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js') !!}
    {!! Html::script('http://malsup.github.com/min/jquery.form.min.js') !!}
    {!! Html::script('js/materialize.js') !!}
    {!! Html::script('js/jquery.nanoscroller.min.js') !!}

    @yield('script')

</head>
<body>

@yield('nav')

@yield('contenu')

@if(\Illuminate\Support\Facades\Auth::user()!=null)
    
<div class="fixed-action-btn " style="bottom: 38px; right: 91%;">
    <a class="btn-floating btn-large red">
      <i class="large material-icons">dashboard</i>
    </a>
    <ul>
        @if (count(\App\Models\Enseignant_Privilege::where(function ($query) {
                $query->where('id_Enseignant', '=', Auth::user()->id_Enseignant)->where('id_Privilege', '=', '1');
            })->get()) > 0
        )
            <li><a class="btn-floating  tooltipped red" data-position="right" data-tooltip="Privileges" href="/privileges"><i class="material-icons">vpn_key</i></a></li>

            <li><a class="btn-floating  tooltipped orange" data-position="right" data-tooltip="Sessions" href="/session"><i class="material-icons">view_headline</i></a></li>
            <li><a class="btn-floating tooltipped yellow darken-1" data-position="right" data-tooltip="Stages" href="/encadrant/create"><i class="material-icons">face</i></a></li>
        @endif
        <!--encadrant-->
        @if (count(\App\Models\Enseignant_Privilege::where(function ($query) {
                $query->where('id_Enseignant', '=', Auth::user()->id_Enseignant)->where('id_Privilege', '=', '3');
            })->get()) > 0
        )
            <li><a class="btn-floating tooltipped yellow darken-1" data-position="right" data-tooltip="Stages" href="/encadrant/{{\Illuminate\Support\Facades\Auth::user()->id_Enseignant}}/stage/show"><i class="material-icons">face</i></a></li>
        @endif

        <!--jury-->
        @if (count(\App\Models\Enseignant_Privilege::where(function ($query) {
                $query->where('id_Enseignant', '=', Auth::user()->id_Enseignant)->where('id_Privilege', '=', '2');
            })->get()) > 0
        )
            <li><a class="btn-floating tooltipped orange" data-position="right" data-tooltip="add Stations" href="/jury/{{\Illuminate\Support\Facades\Auth::user()->id_Enseignant}}"><i class="material-icons">view_headline</i></a></li>
        @endif

        <!--representant Ecos-->
        @if (count(\App\Models\Enseignant_Privilege::where(function ($query) {
                $query->where('id_Enseignant', '=', Auth::user()->id_Enseignant)->where('id_Privilege', '=', '1');
            })->orWhere(function ($query) {
                $query->where('id_Enseignant', '=', Auth::user()->id_Enseignant)->where('id_Privilege', '=', '5');
            })->get()) > 0
        )
            <li><a class="btn-floating tooltipped blue" data-position="right" data-tooltip="Banques" href="/banque"><i class="material-icons">library_add</i></a></li>
        @endif
        <li><a class="btn-floating tooltipped green accent-4" data-position="right" data-tooltip="home" href="/"><i class="material-icons">home</i></a></li>
    </ul>
  </div>

<script type="text/javascript">
    $(document).ready(function(){
    $('.tooltipped').tooltip( );
    }); 
</script>

@endif


</body>
</html>
