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

{% block body %}
	<center>
	<div id="genetableau">
	<div>
		<form method="POST" id='formulaireListeCentre' name='formulaireListeCentre'>
			<input type="hidden" name="divCode" value="{{ post.divCode }}" />
			<input type="hidden" name="divLibelle" value="{{ post.divLibelle }}" />
			<input type="hidden" name="code_ste" value="{{ post.code_ste }}" />
			
    			<table class="table" id="tableau">
    				<thead class="thead-dark">
        				<tr>
        					<th>{{ triTable('CODE_CTR',  infoPagination.filter.tri_CODE_CTR, 'Code' | trad, 'genetableau', path(path), 'formulaireListeCentre') }}</th>
        					<th>{{ triTable('RAIS_SOC',  infoPagination.filter.tri_RAIS_SOC, 'Libellé' | trad, 'genetableau', path(path), 'formulaireListeCentre') }}</th>
							<th>{{ triTable('ADRESSE',  infoPagination.filter.tri_ADRESSE, 'Adresse' | trad, 'genetableau', path(path), 'formulaireListeCentre') }}</th>
							<th>{{ triTable('CPOSTAL',  infoPagination.filter.tri_CPOSTAL, 'Code postal' | trad, 'genetableau', path(path), 'formulaireListeCentre') }}</th>
							<th>{{ triTable('VILLE1',  infoPagination.filter.tri_VILLE1, 'Ville' | trad, 'genetableau', path(path), 'formulaireListeCentre') }}</th>
							<th scope="col" width="75px">
								{% if hasRight('HA_CTR_CM') %}
									<a class="ajouter_blanc_v2  white-tooltip" style="float: right;" onClick="ajaxDynamiqueTab('{{ path('Tables.Centre.Create', {mode:'ajax'}) }}', '{{ 'Nouveau centre' | trad }}', {'CODE_STE' : '{{ post.code_ste }}'});">
										<span class="infos_tooltip left">
											{{ 'Ajouter un centre' | trad }}
										</span>
									</a>
								{% endif %}
                    		</th>
						</tr>
        			</thead>
        			<tbody>
        				<tr>
        					<th>{{ filterTable('CODE_CTR', infoPagination.filter.filter_CODE_CTR, '', 'genetableau', path(path), 'formulaireListeCentre') }}</th>
        					<th>{{ filterTable('RAIS_SOC', infoPagination.filter.filter_RAIS_SOC, '', 'genetableau', path(path), 'formulaireListeCentre') }}</th>
							<th>{{ filterTable('ADRESSE', infoPagination.filter.filter_ADRESSE, '', 'genetableau', path(path), 'formulaireListeCentre') }}</th>
							<th>{{ filterTable('CPOSTAL', infoPagination.filter.filter_CPOSTAL, '', 'genetableau', path(path), 'formulaireListeCentre') }}</th>
							<th>{{ filterTable('VILLE1', infoPagination.filter.filter_VILLE1, '', 'genetableau', path(path), 'formulaireListeCentre') }}</th>
							<th></th>
						</tr>
        				{% for centre in centres %}
        				

        				<tr id="centrePopup{{loop.index}}">
        					<td id ="{{accadre.CODE_CTR}}" onclick='changeCodeLibelle("{{ post.divCode }}","{{ centre.CODE_CTR }}", "{{ post.divLibelle }}", "{{ centre.RAIS_SOC~' ('~centre.CODE_CTR~')' | convert_encoding('UTF-8', 'ISO-8859-1') }}");desactivePopup ()'>{{ centre.CODE_CTR   | convert_encoding('UTF-8', 'ISO-8859-1') }}</td>
        					<td onclick='changeCodeLibelle("{{ post.divCode }}","{{ centre.CODE_CTR }}", "{{ post.divLibelle }}", "{{ centre.RAIS_SOC~' ('~centre.CODE_CTR~')' | convert_encoding('UTF-8', 'ISO-8859-1') }}");desactivePopup ()' >{{ centre.RAIS_SOC  | convert_encoding('UTF-8', 'ISO-8859-1') }}</td>
							<td>{{ centre.ADRESSE }}</td>
							<td>{{ centre.CPOSTAL }}</td>
							<td>{{ centre.VILLE1 }}</td>
							<td class="parametrage">
								{{ menuContextuel('centrePopup' ~ loop.index, false, centre.menuContextuel, 6) }}
							</td>
        				</tr>
        				{% endfor %}
        			</tbody>
    			</table>
			
		</form>
		
	{{ paginations(path(path),infoPagination.nombreDePage, infoPagination.page, infoPagination.post, 'genetableau') }}
	</div>
	</div>

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