{% extends 'base.html.twig' %}

{% block title %}Enquête{% endblock %}

{% set navbarTitle = "Enquête" %}
{% set navbarPages = [{'page':"Gestion", 'url':null }] %}

{% block content %}
    
<!-- Page Content  -->
<div id="content-page" class="content-page">
    <div class="container-fluid">
        <div class="iq-card">
            <div class="iq-card-header d-flex justify-content-between">
                <div class="iq-header-title">
                    <h4 class="card-title">Liste des enquêtes à activer</h4>
                </div>
            </div>
            <div class="iq-card-body">
                <div class="table-responsive">
                    <table id="user-list-table" class="table table-striped table-bordered" role="grid" aria-describedby="user-list-page-info">
                        <thead>
                            <tr>
                                <th>Id</th>
                                <th>Name</th>
                                <th>Date Create</th>
                                <th>Questions</th>
                                <th>Status</th>
                                <th>Action</th>
                            </tr>
                        </thead>
                        <tbody>
                            {% for investigation in investigations %}
                                <tr>
                                    <td>{{ investigation.getId() }}</td>
                                    <td>{{ investigation.getNameEn() }}</td>
                                    <td>{{ investigation.getDateCreate()|date("d/m/Y H:i") }}</td>
                                    <td>{{ investigation.getNbrQuestions() }}</td>
                                    <td>
                                        {% if investigation.getLastState() == 10 %}
                                            <div class="badge  badge-info">Création Terminer </div>
                                        {% elseif investigation.getLastState() == 11 %}
                                            <div class="badge  badge-light">Encour de Création</div>
                                        {% elseif investigation.getLastState() == 12 %}
                                            <div class="badge  badge-dark">Dupliquer</div>
                                        {% elseif investigation.getLastState() == 20 %}
                                            <div class="badge  badge-success">Demande Valider</div>
                                        {% elseif investigation.getLastState() == 21 %}
                                            <div class="badge  badge-warning text-white">Demande Envoyer</div>
                                        {% elseif investigation.getLastState() == 22 %}
                                            <div class="badge  badge-danger text-white">Demande Rejeter</div>
                                        {% else %}
                                            --
                                        {% endif %}
                                    </td>
                                    <td>
                                        <a href="{{ path('app_investigation_admin_active', {id:investigation.getId()}) }}" class="">activer</a>
                                        
                                    </td>
                                </tr>
                            {% endfor %}
                        </tbody>
                    </table>
                </div>
            </div>
        </div>
        
    </div>
</div>

<!-- Wrapper END -->



{% endblock %}