
{% extends '@ajax-layout/layout.twig' %}

{% block body %}
<div id="genetableau">
	<center>
	<div>
		<form method="POST" id='formulaireliste'>
			<input type="hidden" name="divCode" value="{{ post.divCode }}" />
			<input type="hidden" name="divLibelle" value="{{ post.divLibelle }}" />
			
			<table class="table" id="tableau">
				<thead class="thead-dark">
    				<tr>
    					<th>{{ triTable('CODE_PER',  infoPagination.filter.tri_CODE_PER, 'Code Période' | trad, 'genetableau', path('Ajax.liste.periodes'), 'formulaireliste') }}</th>
    					<th>{{ triTable('LIBELLE',  infoPagination.filter.tri_LIBELLE, 'Nom' | trad,'genetableau', path('Ajax.liste.periodes'), 'formulaireliste') }}</th>
						<th>{{ triTable('DATE_DEB',  infoPagination.filter.tri_DATE_DEB, 'Date Début' | trad,'genetableau', path('Ajax.liste.periodes'), 'formulaireliste') }}</th>
						<th>{{ triTable('DATE_FIN',  infoPagination.filter.tri_DATE_FIN, 'Date Fin' | trad,'genetableau', path('Ajax.liste.periodes'), 'formulaireliste') }}</th>
    				</tr>
    			</thead>
    			<tbody>
    				<tr>
    					<th>{{ filterTable('CODE_PER', infoPagination.filter.filter_CODE_PER, '', 'genetableau', path('Ajax.liste.periodes'), 'formulaireliste') }}</th>
    					<th>{{ filterTable('LIBELLE', infoPagination.filter.filter_LIBELLE, '', 'genetableau', path('Ajax.liste.periodes'), 'formulaireliste') }}</th>
						<th>{{ filterTable('DATE_DEB', infoPagination.filter.filter_DATE_DEB, '', 'genetableau', path('Ajax.liste.periodes'), 'formulaireliste') }}</th>
						<th>{{ filterTable('DATE_FIN', infoPagination.filter.filter_DATE_FIN, '', 'genetableau', path('Ajax.liste.periodes'), 'formulaireliste') }}</th>
    				</tr>
    				{% for periode in entity %}

    				<tr onclick='changeCodeLibelle("{{ post.divCode }}","{{ periode.CODE_PER | convert_encoding('UTF-8', 'ISO-8859-1')  }}", "{{ post.divLibelle }}", "{{ periode.LIBELLE~' ('~periode.CODE_PER~')'  | convert_encoding('UTF-8', 'ISO-8859-1') }}");desactivePopup ()'>
    					<td id ="{{periode.CODE_PER}}">{{ periode.CODE_PER | convert_encoding('UTF-8', 'ISO-8859-1')  }}</td>
    					<td>{{ periode.LIBELLE | convert_encoding('UTF-8', 'ISO-8859-1') }}</td>
						<td>{{ periode.DATE_DEB | dateTrad  }}</td>
    					<td>{{ periode.DATE_FIN | dateTrad }}</td>
    				</tr>
    				{% endfor %}
    			</tbody>
			</table>
			
		</form>
		
	{{ paginations(path('Ajax.liste.periodes'),infoPagination.nombreDePage, infoPagination.page, infoPagination.post, 'modal-body') }}
	</div>

	</center>
	</div>
{% endblock %}