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

{% block body %}
<div id="genetableau">
	<center>
	<div>
		<form method="POST" id='formulaireTypeDoc'>
			<input type="hidden" name="divCode" value="{{ post.divCode }}" />
			<input type="hidden" name="divLibelle" value="{{ post.divLibelle }}" />
			<input type="hidden" name="oxaproc" value="{{ post.oxaproc }}" />			

				<div class="row">
					{{ inputSwitch('Uniquement les types de documents valides ?' |trad, 'valide', (post.valide==1?'on':post.valide), 'onChange="ajaxRechercheTableau(\''~path('Ajax.liste.typeDoc')~'\', \'genetableau\', \'formulaireTypeDoc\')"') }}
				</div>
    			<table class="table" id="tableau">
    				<thead class="thead-dark">
        				<tr>
        					<th>{{ triTable('TYPE',  infoPagination.filter.tri_TYPE, 'Code' | trad, 'genetableau', path('Ajax.liste.typeDoc'), 'formulaireTypeDoc') }}</th>
        					<th>{{ triTable('LIBELLE',  infoPagination.filter.tri_LIBELLE, 'Libellé' | trad, 'genetableau', path('Ajax.liste.typeDoc'), 'formulaireTypeDoc') }}</th>
        				</tr>
        			</thead>
        			<tbody>
        				<tr>
        					<th>{{ filterTable('TYPE', infoPagination.filter.filter_TYPE, '', 'genetableau', path('Ajax.liste.typeDoc'), 'formulaireTypeDoc') }}</th>
        					<th>{{ filterTable('LIBELLE', infoPagination.filter.filter_LIBELLE, '', 'genetableau', path('Ajax.liste.typeDoc'), 'formulaireTypeDoc') }}</th>
        				</tr>
        				{% for typeDoc in entity %}
        				
        				<tr onclick="{{ attrJs('changeCodeLibelle', [ post.divCode, typeDoc.TYPE, post.divLibelle, typeDoc.LIBELLE ~ ' (' ~ typeDoc.TYPE ~ ')']) }};desactivePopup()">
        					<td>{{ typeDoc.TYPE   | convert_encoding('UTF-8', 'ISO-8859-1') }}</td>
        					<td>{{ typeDoc.LIBELLE  | convert_encoding('UTF-8', 'ISO-8859-1') }}
        				
        					</td>
        
        				</tr>
        				{% endfor %}
        			</tbody>
    			</table>
			
		</form>
		
	{{ paginations(path('Ajax.liste.typeDoc'),infoPagination.nombreDePage, infoPagination.page, infoPagination.post, 'modal-body') }}
	</div>

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