{% set menuActive = 'Fournisseur' %}

{% extends 'layout.twig' %}
{% block body %}
<div class="contenu clearfix"  id="results">
    <h1>{{ 'Fournisseurs' | trad }}</h1>
    {{ ariane() }}
    <div class="tab-content">
        <div id="detail_fournisseur" class="clearfix">
            <h2>{{ 'Fournisseur' | trad }}  : {{ supplier.RS }} ({{ supplier.CODE }})</h2>
            {{ arianeSub() }}
        </div>
        <div class="clearfix" style="margin-top:15px;">
            <div class="colonne2">
                <div id="interactions" style="text-align:center" class="clearfix">
                    <div class="tuilesIndicateur" style="cursor:pointer; width: 48% !important" onclick="{{ menu.lien }}">
                        <div class="titreTuile">{{ 'Nbre d\'évaluations' | trad }}</div>
                        <div class="resultTuile texteTuilebleu">{{ results | length }}</div>
                    </div>
                    <div class="tuilesIndicateur" style="cursor:pointer; width: 48% !important" onclick="{{ menu.lien }}">
                        <div class="titreTuile">{{ 'Note moyenne' | trad }}</div>
                        <div class="resultTuile texteTuile{{ averageNote | colorClass }}">{{ averageNote ~ '/' ~ param.ALPHA5 }}</div>
                    </div>
                </div>
            </div>
            <div class="colonne2 last">
                <div style="margin-top:15px;" class="clearfix">
                    {{ Highcharts(dataHighchart) }}
                </div>
            </div>
            <div class="single">
                <form class="tab-content" method="post" name="filtre_reporting" id="filtre_reporting">
                    <div id="filtre" class="tab-pane active in clearfix bg_form padding_form border_form">
                        <div class="filtre first">
                            <div class="row">
                                {{ inputSelect("Périodes" | trad, "annee", periodes, annee, '','','','','','','',false,'','','true') }}
                            </div>
                        </div>

                        <div class="filtre">
                            <div class="row">
                                {{ inputSelect("Statuts" | trad, "status", statusList, status, '','','','','','','',false,'','','true') }}
                            </div>
                        </div>
                        <button type="submit" class="principal button btn_filtre last button_right">{{ 'Filtrer' | trad }}</button>
                    </div>
                </form>
                <table class="table table-hover noColorLign">
                    <thead class="thead-dark">
                        <tr>
                            <th width="5%">{{ 'Id' | trad }}</th>
                            <th>{{ 'Libellé' | trad }}</th>
                            <th colspan="2" width="10%">{{ 'Statut' | trad }}</th>
                            <th width="5%">{{ 'Note' | trad }}</th>
                            <th width="10%">{{ 'Moyenne campagne' | trad }}</th>
                            <th width="7%">{{ 'Période' | trad }}</th>
                            <th>{{ 'Commentaire' | trad }}</th>
                            <th>{{ 'Appréciation générale' | trad }}</th>
                            <th width="5%"></th>
                        </tr>
                    </thead>
                    <tbody>
                        {% for result in results %}
                            <tr id="result{{ loop.index }}">
                                <td class="montant">{{ result.ID_CAMP }}</td>
                                <td>{{ shortLibelle(result.LIBELLE, 250) }}</td>
                                <td>
                                    <div class="img_cercle {{ result.NOTE | colorClass }}" style="position:absolute;right:10px;top:35%;"></div>
                                </td>
                                <td>
                                    {% if param.ALPHA6 != '' %}
                                        {{ result.NOTE | status }}
                                    {% endif %}
                                </td>
                                <td class="montant">{{ result.NOTE ~ '/' ~ param.ALPHA5 }}</td>
                                <td class="montant">{{ result.NOTE_MOYENNE ~ '/' ~ param.ALPHA5 }}</td>
                                <td>{{ result.LIBELLE_PERIODE }}</td>
                                <td>{{ shortLibelle(result.COMMENTAIRE_FINAL, 250) }}</td>
                                <td>{{ shortLibelle(result.PLAN_ACTION, 250) }}</td>
                                <td>
                                    {{ menuContextuel('result' ~ loop.index, false, result.menuContextuel, 6) }}
                                </td>
                            </tr>
                            <tr id="result{{ loop.index }}detail" class="detail_ligne hide_detail">
                            </tr>
                        {% endfor %}
                    </tbody>
                </table>            
            </div>
        </div>
        
    </div>
</div>

<script type="text/javascript" src="{{ baseUrl('ext/highcharts/highcharts/highcharts.js') }}"></script>
<script type="text/javascript" src="{{ baseUrl('ext/highcharts/highcharts/modules/exporting.js') }}"></script>
<script type="text/javascript" src="{{ baseUrl('ext/highcharts/highcharts/modules/offline-exporting.js') }}"></script>

{% endblock %}