{% extends 'layout.twig' %}

{% block body %}

    <div class="contenu clearfix"  id="demandeAchats">
    
        <h1>
        	{{ 'Liste DA' | trad }}
    	</h1>
    	
    	{{ ariane() }}
    	<form method="post" name="filtre_demandeAchat" id="filtre_demandeAchat">
            <table class="table" style="margin-top:20px;">
            	<thead class="thead-dark">
                	<tr>
                    	<th scope="col" width="5%">{{ triTable('NO_DA',  infoPagination.filter.tri_NO_DA, 'DA' | trad, '', '', 'filtre_demandeAchat') }}</th>
                    	<th scope="col" width="10%">{{ triTable('DATE',  infoPagination.filter.tri_DATE, 'Date' | trad, '', '', 'filtre_demandeAchat') }}</th>
                    	<th scope="col" width="10%">{{ triTable('HEURE',  infoPagination.filter.tri_HEURE, 'Heure' | trad, '', '', 'filtre_demandeAchat') }}</th>
                        <th scope="col">{{ triTable('CODE',  infoPagination.filter.tri_CODE, 'Evènement' | trad, '', '', 'filtre_demandeAchat') }}</th>
                        {# AJOUTER TRI TABLE #}
                        <th scope="col" width="20%">{{ 'Utilisateur' | trad }}</th> 
                        <th scope="col" width="10%">{{ 'Signataire' | trad }}</th>                                  
                        <th scope="col" width="10%">{{ 'Société' | trad }}</th>
                        {#  #}                                
                		<input type="hidden" name="tri_NUM_ORD" value={{ infoPagination.filter.tri_NUM_ORD }} />
                    </tr>
                 </thead>
                <tbody>
                    <tr class="recherche">
                    	<td>{{ filterTable('NO_DA', infoPagination.filter.filter_NO_DA, '', '', '', 'filtre_demandeAchat', '', '') }}</td>
                    	<td>{{ filterTable('DATE', infoPagination.filter.filter_DATE, '', '', '', 'filtre_demandeAchat', 'date', '') }}</td>
                    	<td>{{ filterTable('HEURE', infoPagination.filter_HEURE, '', 'filtre_demandeAchat', '', '') }}</td>
                    	<td>{{ zoomFilter('CODE', infoPagination.filter['filter_CODE'], '', 'filtre_demandeAchat', path('Ajax.liste.suiCaDat'),'suidadat', '','','suidadat','','','suidadat') }}</td>
						<td>{{ zoomFilter('UTIL', infoPagination.filter['filter_UTIL'], '', 'filtre_demandeAchat', path('Ajax.liste.utilisateur'),'Liste des utilisateurs' | trad, '','','','','','Hastutil') }}</td>
                    	<td>{{ zoomFilter('SIGNAT', infoPagination.filter['filter_SIGNAT'], '', 'filtre_demandeAchat', path('Ajax.liste.utilisateur'),'Liste des signataires' | trad, '','','','','','Hastutil', null, null, null, "{'filter_egal_SIG_DA': 'T' }") }}</td>
                    	<td>{{ zoomFilter('CODE_STE', infoPagination.filter['filter_CODE_STE'], '', 'filtre_demandeAchat', path('Ajax.liste.societe'),'Liste des sociétés' | trad, '','','','','','Societe') }}</td>
                    </tr>
                 	{% for event in listeEvent %}
                        <tr id="evenement{{ loop.index }}">
                        	<td>{{ event.NO_DA }}</td>
                            <td class="loupe">{{ event.DTE | dateTrad }}</td>
                            <td>{{ event.HEURE | heureTrad }}</td>
                            <td>{{ event.LIBELLE }} ({{ event.CODE }})</td>
                            <td>{{ event.NOM }} {% if event.UTIL | trim and event.UTIL != 'BATCH' %}({{ event.UTIL }}){% endif %}</td>
                            <!-- Ne s'affiche que dans certains cas -->
                            <td>{{ event.Signataire_NOM }}</td>
                            <!--  -->
                            <td>{{ event.CODE_STE | societeTrad }} {% if event.CODE_STE | trim %}({{ event.CODE_STE }}){% endif %}</td>
                        </tr>
                        <tr class="detail_ligne hide_detail" id="evenement{{ loop.index }}detail" >
                        	<td colspan="6">
                            	<div class="single row">
                                    <div class="informations">
                                    	<p class="gras">{{ 'Commentaire' | trad ~ colon() }}</p>
                                    	<p>{{ event.CONTMEMO | nl2br }}</p>
                                    </div>
                                </div>
                             </td>
                         </tr>
                     {% endfor %}			
                 </tbody>
            </table>     
            {{ paginations(path('DemandeAchat.Liste.listeEvenement'),infoPagination.nombreDePage, infoPagination.page, infoPagination.post, '') }}
        </form>
	</div>
{% endblock %}