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

{% block body %}
<div id="genetableau">
	<center>
	<div>
		<form method="POST" id='formulaireAccadre'>
			<input type="hidden" name="divCode" value="{{ post.divCode }}" />
			<input type="hidden" name="divLibelle" value="{{ post.divLibelle }}" />
			<input type="hidden" name="filter_egal_CODE_STE" value="{{ post.filter_egal_CODE_STE }}" />
			<input type="hidden" name="filter_egal_CODE_CTA" value="{{ post.filter_egal_CODE_CTA }}" />
			
			<table class="table" id="tableau">
				<thead class="thead-dark">
    				<tr>
						{% if scaSecto %}
        					<th>{{ triTable('CODE_STE',  infoPagination.filter.tri_CODE_STE, 'Code société' | trad, 'genetableau', path('Ajax.liste.sscptana'), 'formulaireAccadre') }}</th>
						{% endif %}
						<th>{{ triTable('CODE_SCA',  infoPagination.filter.tri_CODE_SCA, 'Code SCA' | trad, 'genetableau', path('Ajax.liste.sscptana'), 'formulaireAccadre') }}</th>
    					<th>{{ triTable('LIBELLE',  infoPagination.filter.tri_LIBELLE, 'Libellé SCA' | trad,'genetableau', path('Ajax.liste.sscptana'), 'formulaireAccadre') }}</th>
    				</tr>
    			</thead>
    			<tbody>
    				<tr>
						{% if scaSecto %}
    						<th>{{ filterTable('egal_CODE_STE', infoPagination.filter.filter_egal_CODE_STE, '', 'genetableau', path('Ajax.liste.sscptana'), 'formulaireAccadre') }}</th>
						{% endif %}
						<th>{{ filterTable('CODE_SCA', infoPagination.filter.filter_CODE_SCA, '', 'genetableau', path('Ajax.liste.sscptana'), 'formulaireAccadre') }}</th>
    					<th>{{ filterTable('LIBELLE', infoPagination.filter.filter_LIBELLE, '', 'genetableau', path('Ajax.liste.sscptana'), 'formulaireAccadre') }}</th>
    				</tr>
    				{% for ana in entity %}
    				
    				<tr onclick="{{ attrJs('changeCodeLibelle', [ post.divCode, ana.CODE_SCA, post.divLibelle, ana.LIBELLE ~ ' (' ~ ana.CODE_SCA ~ ')']) }};desactivePopup()">
						{% if scaSecto %}
							<td>{{ ana.CODE_STE | convert_encoding('UTF-8', 'ISO-8859-1')  }}</td>	
						{% endif %}
						<td>{{ ana.CODE_SCA | convert_encoding('UTF-8', 'ISO-8859-1')  }}</td>
    					<td>{{ ana.LIBELLE | convert_encoding('UTF-8', 'ISO-8859-1') }}</td>
    				</tr>
    				{% endfor %}
    			</tbody>
			</table>
			
			{{ paginations(path('Ajax.liste.sscptana'),infoPagination.nombreDePage, infoPagination.page, infoPagination.post, 'genetableau') }}
		</form>
		
	
	</div>

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