@extends('template')

@section('nav')
    <div class="navbar-fixed">
        <ul id="dropdown1" class="dropdown-content" style="top : 20px">
            <li><a href="/auth/logout" class="logout">Logout</a></li>
        </ul>
        <nav>
            <div class="nav-wrapper">
                <div class="col s12">
                    <a href="/session" class="breadcrumb">Session</a>
                    <a href="/session/{{$sessionId}}/examen" class="breadcrumb">Examen</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')

    <div id="progress" class="progress" style="display:none">
        <div class="indeterminate"></div>
    </div>
    <table class="striped centered">
        <thead>
        <tr>		
		<th></th>
		<th></th>
            <th data-field="id">Identifiant</th>
            <th data-field="date">date</th>
            <th data-field="type">type</th>
            <th data-field="view_station"></th>
            <th data-field="view_note_examen"></th>
        </tr>
        </thead>

        <tbody>
        @foreach ($examens as $examen)
            <tr>
		<td> <a href="/session/{{$sessionId}}/examen/{{$examen->id_Examen}}/update" style="color:blue;"><i class="material-icons">mode_edit</i></a></td>
                 <td> <a href="#modalDelete{{$examen->id_Examen}}"  class="modal-trigger" style="color:red;"><i class="material-icons">clear</i></a></td>
                <td>{{$examen->id_Examen}}</td>
                <td>{{$examen->date}}</td>
                <td>{{$examen->nom}}</td>
                <td><a href="/session/{{$sessionId}}/examen/{{$examen->id_Examen}}/station"
                       class="waves-effect waves-light btn blue">Afficher les stations</a></td>
                <td><a href="/note/{{$sessionId}}/update/{{$examen->id_Examen}}" class="waves-effect waves-light btn "
                       onclick="show()">Calculer les moys</a></td>
                <td><a href="/session/{{$sessionId}}/examen/{{$examen->id_Examen}}/resultat"
                       class="waves-effect waves-light btn orange darken-4">Afficher les notes</a></td>
                 <td><a href="/session/{{$sessionId}}/examen/{{$examen->id_Examen}}/inscrit"
                       class="waves-effect waves-light btn green darken-2">Afficher liste inscrit</a></td>

                <td>
  <!-- Modal Delete Structure -->
  <div id="modalDelete{{$examen->id_Examen}}" 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/{{$sessionId}}/examen/{{$examen->id_Examen}}/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/{{$sessionId}}/examen/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();
  });
        function show() {
            document.getElementById('progress').style.display = 'block';
        }
    </script>

@stop
