@extends('template')

@section('nav')
    <ul id="dropdown1" class="dropdown-content" style="top : 20px">
        <li><a href="/auth/logout" class="logout">Logout</a></li>
    </ul>
    <div class="navbar-fixed">
        <nav>
            <div class="nav-wrapper">
                <div class="col s12">
                    <a href="/session" class="breadcrumb">Session</a>
                    <ul class="right hide-on-med-and-down">
                        <li><a class="dropdown-button" href="#!"
                               data-activates="dropdown1">{{ \Illuminate\Support\Facades\Auth::user()->login  }}<i
                                        class="material-icons right">more_vert</i></a></li>
                    </ul>
                </div>
            </div>
        </nav>
    </div>
@endsection

@section('contenu')

    <table class="striped centered">
        <thead>
        <tr>
		<th></th>
            <th></th>
            <th data-field="id">Identifiant</th>
            <th data-field="date">Nom</th>
            <th data-field="niveau">niveau</th>
            <th data-field="view_examen"></th>
            <th></th>
        </tr>
        </thead>

        <tbody>
        @foreach ($sessions as $session)
            <tr>
		<td> <a href="/session/{{$session->id_Session}}/update" style="color:blue;"><i class="material-icons">mode_edit</i></a></td>
                <td> <a href="#modalDelete{{$session->id_Session}}" class="modal-trigger" style="color:red;"><i class="material-icons">clear</i></a></td>
                <td>{{$session->id_Session}}</td>
                <td>{{$session->nom}}</td>
                <td>{{$session->niveau}}</td>
                <td><a href="/session/{{$session->id_Session}}/examen" class="waves-effect waves-light btn blue">Afficher les examens Associés</a></td>
                
 <td>

  <!-- Modal Delete Structure -->
  <div id="modalDelete{{$session->id_Session}}" class="modal">
    <div class="modal-content">
      <h4>Voulez-Vous supprimer cet element</h4>
    </div>
    <div class="modal-footer">
	<a href="#!" class=" modal-action modal-close waves-effect waves-green btn-flat">Non</a>
      <a href="/session/{{$session->id_Session}}/delete" class=" modal-action modal-close waves-effect waves-green btn-flat">Oui</a>

    </div>
  </div>
</td>
            </tr>

        @endforeach
        </tbody>
    </table>
    <div class="fixed-action-btn" style="bottom: 45px; right: 24px;">
        <a href="/session/create" class="btn-floating btn-large waves-effect waves-light red"><i class="material-icons">add</i></a>
    </div>
<script type="text/javascript">
$(document).ready(function(){
    $('.modal-trigger').leanModal();
  });
</script>

@stop
