{% extends 'layout/backEndLayout.html.twig' %}
{% form_theme searchForm 'bootstrap_4_layout.html.twig' %}
{% block content %}
<div class="row mt-4">
<div class="col-1">
<a class="btn btn-info" href="{{ path('admin_abscence_sheet_new') }}">
<i class="fa fa-plus"></i>
</a>
</div>
<div class="col-11 jumbotron" >
{{form_start(searchForm)}}
<div class="form-row row">
<div class="col-md-3">
{{form_row(searchForm.room)}}
</div>
<div class="col-md-3">
{{form_row(searchForm.sequence)}}
</div>
<div class="col-md-3">
{{form_row(searchForm.quater)}}
</div>
<div class="col-md-3">
<button class="btn btn-primary" type="submit">
<b>Rechercher</b>
</button>
</div>
</div>
{{form_end(searchForm)}}
</div>
<table class="table">
<thead>
<tr>
<th>Id</th>
<th>Session</th>
<th>StartDate</th>
<th>EndDate</th>
<th>Classe</th>
<th>actions</th>
</tr>
</thead>
<tbody>
{% for abscence_sheet in pagination %}
<tr>
<td>{{ abscence_sheet.id }}</td>
<td>{{ abscence_sheet.sequence.code }}</td>
<td>{{ abscence_sheet.startDate ? abscence_sheet.startDate|date('Y-m-d') : '' }}</td>
<td>{{ abscence_sheet.endDate ? abscence_sheet.endDate|date('Y-m-d') : '' }}</td>
<td>{{ abscence_sheet.classRoom.name }}</td>
<td>
<a class="btn btn-outline-info " href="{{ path('admin_abscence_sheet_pdf', {id: abscence_sheet.id}) }}">
<i class="fa fa-cloud-download">
</i>
</a>
<a class="btn btn-outline-warning " href="{{ path('admin_abscence_sheet_edit', {'id': abscence_sheet.id}) }}"><i class="fa fa-edit">
</i>
</a>
<a class="btn btn-outline-danger" href="#" onclick= "event.preventDefault() ; confirm('Are you sure ?') && document.getElementById('js-abscence-sheet-form-{{abscence_sheet.id}}').submit();"> <i class="fa fa-trash"></i> </a>
<form id="js-abscence-sheet-form-{{abscence_sheet.id}}" action="{{path('admin_abscences_sheet_delete', {id: abscence_sheet.id})}}" method="post" style="display: none;">
<input type="hidden" name="csrf_token" value="{{ csrf_token('abscence_sheet_deletion' ~ abscence_sheet.id ) }}" id="">
<input type="hidden" name="_method" value="DELETE">
</form>
</td>
</tr>
{% else %}
<tr>
<td colspan="4">no records found</td>
</tr>
{% endfor %}
</tbody>
</table>
<div class="navigation text-center">
{{ knp_pagination_render(pagination) }}
</div>
</div>
{% endblock %}