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

{% block body %}
<div id="genetableau">
	<center>
	<div>
		<form method="POST" id='formulaireListeAO'>
			<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="code_ste" value="{{ post.code_ste }}" />	
			<input type="hidden" name="filter_egal_VALCHXFOU" value="{{ post.filter_egal_VALCHXFOU }}" />	
			<input type="hidden" name="filter_egal_DTE_VALID_AO" value="{{ post.filter_egal_DTE_VALID_AO }}" />	
					
    			<table class="table" id="tableau">
    				<thead class="thead-dark">
        				<tr>
        					<th>{{ triTable('NO_AO',  infoPagination.filter.tri_NO_AO, 'Référence' | trad, 'genetableau', path(path), 'formulaireListeAO') }}</th>
        					<th>{{ triTable('DTE_AO',  infoPagination.filter.tri_DTE_AO, 'Date de création' | trad, 'genetableau', path(path), 'formulaireListeAO') }}</th>
        					<th>{{ triTable('ACH',  infoPagination.filter.tri_ACH, 'Acheteur' | trad, 'genetableau', path(path), 'formulaireListeAO') }}</th>
        					<th>{{ triTable('OBJET_AO',  infoPagination.filter.tri_ACH, 'Objet Consultation' | trad, 'genetableau', path(path), 'formulaireListeAO') }}</th>
        					<th>{{ triTable('EMETTEUR',  infoPagination.filter.tri_EMETTEUR, 'Ctr. Emetteur' | trad, 'genetableau', path(path), 'formulaireListeAO') }}</th>
        					<th>{{ triTable('DEL_REP',  infoPagination.filter.tri_DEL_REP, 'Délai' | trad, 'genetableau', path(path), 'formulaireListeAO') }}</th>
        				</tr>
        			</thead>
        			<tbody>
        				<tr>
        					<th>{{ filterTable('NO_AO', infoPagination.filter.filter_NO_AO, '', 'genetableau', path(path), 'formulaireListeAO') }}</th>
        					<th>{{ filterTable('date_DTE_AO', infoPagination.filter.filter_date_DTE_AO, '', 'genetableau', path(path), 'formulaireListeAO') }}</th>
        					<th>{{ filterTable('ACH', infoPagination.filter.filter_ACH, '', 'genetableau', path(path), 'formulaireListeAO') }}</th>
        					<th>{{ filterTable('OBJET_AO', infoPagination.filter.filter_OBJET_AO, '', 'genetableau', path(path), 'formulaireListeAO') }}</th>
        					<th>{{ filterTable('EMETTEUR', infoPagination.filter.filter_EMETTEUR, '', 'genetableau', path(path), 'formulaireListeAO') }}</th>
        					<th>{{ filterTable('date_DEL_REP', infoPagination.filter.filter_date_DEL_REP, '', 'genetableau', path(path), 'formulaireListeAO') }}</th>
        				</tr>
        				{% for AO in entity %}
        				
        				<tr onclick='changeCodeLibelle("{{ post.divCode }}","{{ AO.NO_AO }}", "{{ post.divLibelle }}", "{{ AO.NO_AO | convert_encoding('UTF-8', 'ISO-8859-1') }}");desactivePopup ()'>
        					<td>{% if AO.RFI_Q =='Q' %} {{ 'RFQ' | trad }} {% else %} {{ 'RFI' | trad }} {% endif %} : {{ AO.NO_AO   | convert_encoding('UTF-8', 'ISO-8859-1') }}</td>
        					<td>{{ AO.DTE_AO  | dateTrad }}</td>
        					<td>{{ AO.NOM }} ({{ AO.ACH }})</td>
        					<td>{{ AO.OBJET_AO }}</td>
        					<td>{{ convertLibelleGlobal('CENTRE', '', AO.EMETTEUR, true) }}</td>
        					<td>{{ AO.DEL_REP  | dateTrad }}</td>
        				</tr>
        				{% endfor %}
        			</tbody>
    			</table>
			
		</form>
		
	    {{ paginations(path(path),infoPagination.nombreDePage, infoPagination.page, infoPagination.post, 'modal-body') }}
	</div>

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