<div class="modal-body">

    <form method="post" name="popupConfirm" id="popupConfirm">
        <input type="hidden" name="etape" value="confirm">

        <h4>{{ 'Association des pièces jointes aux fournisseurs' | trad }}</h4>

        {% if listePj %}
        <table class="table" id="tableau">
            <thead class="thead-dark">
                <tr>
                    <th>{{ 'Titre' | trad }}</th>
                    <th>{{ 'Type' | trad }}</th>
                    <th width="140px">{{ 'Fournisseur' | trad }}</th>
                </tr>
            </thead>
            <tbody>
                {% for pj in listePj %}
                    <tr>
                        <td>{{ pj['TITRE'] }}</td>
                        <td>{{ pj['TYPE_PJ'] }}</td>
                        <td>
                            {{ inputAdvance('SELECT', {
                                'name': 'PJ_FRS_'~pj['NO_ORDRE'],
                                'listeValue' : listeFrs,
                                'value' : 'NON_DEFINI',
                            }) }}
                        </td>
                    </tr>
                {% endfor %}
            </tbody>
        </table>
        {% endif %}

        {% if listeClause %}
            <h4>{{ 'Association des clauses aux fournisseurs' | trad }}</h4>

            <table class="table" id="tableau">
                <thead class="thead-dark">
                    <tr>
                        <th>{{ 'Texte' | trad }}</th>
                        <th width="140px">{{ 'Fournisseur' | trad }}</th>
                    </tr>
                </thead>
                <tbody>
                
                    {% for clause in listeClause %}
                        <tr>
                            <td>{{ clause['CONTMEMO'] }}</td>
                            <td>
                                {{ inputAdvance('SELECT', {
                                    'name': 'CLAUSE_FRS_'~clause['NO_ORDRE'],
                                    'listeValue' : listeFrs,
                                    'value' : 'NON_DEFINI',
                                }) }}
                            </td>
                        </tr>
                    {% endfor %}
                </tbody>
            </table>
        {% endif %}

    </form>

    <div class="modal-footer">
        <button type="button" class="button principal" onclick="ajaxPopupV2('{{ path }}', 'popupConfirm');">{{ 'Enregistrer' | trad }}</button>
        <button type="button" id="btn_close" class="button secondaire" data-dismiss="modal" onclick="desactivePopup();">{{ 'Fermer' | trad }}</button>
    </div>
</div>

<script>
	
    $( document ).ready(function() {
        $("#modal-title").html('{{ 'Associations Fournisseurs' | trad }}');
        $('.modal-header').addClass('popup_informative');
    });
</script>