{% extends 'layout.twig' %}

{% block body %}

    <div id="refreshUser" class="contenu clearfix">
    
        {% include '@Utilisateur/Common/Component/SubNavbar.twig' 
            with {
                hasBackup: hasBackup,
                current_route: 'backup',
            } only
        %}
		
		<h2>
            {{ 'Mes backups' | trad }}
            <a class="ajouter_blanc_v2 button_v2 white-tooltip" style="float: right;" id="btnAddCompany" href="{{ path('Utilisateur.MesBackup.addBackup') }}">
                <span class="infos_tooltip left">
                    {{ 'Ajouter un backup' | trad }}
                </span>
            </a>    
        </h2>

        <form method="post" name="mesBackup" id="mesBackup">

    
            <table class="table table-hover tableV2" id="table2">
                <thead class="thead-dark" style="display: none;">
                    <th scope="col" colspan="5"></th>
                </thead>
                <tbody>
                    {% for backup in listeBackup %}
                    <tr id="backup_{{loop.index}}">
                        <td>{{ backup.NOM }} ({{ backup.COD_BAC }})</td>
                        <td>{{ backup.RAIS_SOC }} ({{ backup.CODE_STE }})</td>
                        <td>{{ 'Fonctions générales' | trad }} : {{ (backup.ACHAT | boolSql)? 'Oui' | trad:'Non' | trad }}</td>
                        <td>{{ 'Resp. Hiér.' | trad }} : {{ (backup.SUPHIER | boolSql)? 'Oui' | trad:'Non' | trad }}</td>
                        <td>{{ hover_action('backup_'~loop.index, 'Supprimer_v2' , "popupConfirmation(\'"~path('Ajax.Erreur.popupConfirmationSuppresion')~"\', \'\', \'"~path('Utilisateur.MesBackup.deleteBackup', {idBackup: backup.COD_BAC})~"\', \'"~('Etes-vous sûr de vouloir supprimer le backup' | trad |e('js')|raw)~" ?\', \'refreshUser\')", 'float: right;margin-right:5px;') }}</td>
                    </tr>
                    {% endfor %}
                </tbody>
            </table>

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