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

{% block title %}Person index{% endblock %}

{% block body %}
    <h1 class="text-center">Liste des utilisateurs pré-enrolés avec succès</h1><hr>

    <table class="table table-bordered text-center">
        <thead>
            <tr>
                <th>#</th>
                <th>Ref.</th>
                <th>First Name</th>
                <th>Last Name</th>
                <!--th>Civility</th-->
                <th>Birth</th>
                <!--th>Place Of Birth</th>
                <th>FatherLastName</th>
                <th>FatherFirstName</th>
                <th>MotherFirstName</th>
                <th>MotherLastName</th-->
                <th>Contact</th>
                <th>Identification</th>
                <th>Date</th>
                <th></th>
            </tr>
        </thead>
        <tbody>
        {% for person in people %}
            <tr>
                <td>{{ loop.index }}</td>
                <td>
                    <small>
                        <span class="badge badge-info">ID :
                            {% if person.enrolmentId is not empty %}
                                {{ person.enrolmentId }}
                            {% else %}
                                {{"N/A"|trans}}
                            {% endif %} 
                        </span><br>
                        <span class="badge badge-info">UID : 
                            {% if person.enrolmentuid is not empty %}
                                {{ person.enrolmentuid }}
                            {% else %}
                                {{"N/A"|trans}}
                            {% endif %}
                        </span><br>
                        <span class="badge badge-success">SQR : 
                            {% if person.checkQr is not empty %}
                                {{ person.checkQr.numero }}
                            {% else %}
                                {{"N/A"|trans}}
                            {% endif %}
                        </span>
                    </small>
                </td>
                <td>{{ person.firstName }}</td>
                <td>{{ person.lastName }}</td>
                <!--td>{{ person.civility }}</td-->
                <td>{{ person.dateOfBirth ? person.dateOfBirth|date('d-m-Y') : '' }}<br>
                    {{ person.placeOfBirth }}
                </td>
                <!--td></td>
                <td>{{ person.fatherLastName }}</td>
                <td>{{ person.fatherFirstName }}</td>
                <td>{{ person.motherFirstName }}</td>
                <td>{{ person.motherLastName }}</td-->
                <td>
                    <small>
                    {{ person.email }}<br>
                    {{ person.phone }}
                    </small>
                </td>
                <td>
                    <small>
                    {{ person.typeOfIdentificationDocument }}<br>
                    {{ person.identificationDocumentNumber }}<br>
                    {{ person.dateOfIssue ? person.dateOfIssue|date('d-m-Y') : '' }}
                    </small>
                </td>
                <td>{{ person.dateCreated ? person.dateCreated|date('d-m-Y') : '' }}<br>
                    {{ person.dateCreated ? person.dateCreated|date('H:i:s') : '' }}
                </td>
                <td>
                    <!--a href="{{ path('app_person_show', {'id': person.id}) }}">show</a> |
                    <a href="{{ path('app_person_edit', {'id': person.id}) }}">edit</a-->
                    <a href="{{ path('app_person_show', {'id': person.id}) }}">voir</a>
                </td>
            </tr>
        {% else %}
            <tr>
                <td colspan="21">no records found</td>
            </tr>
        {% endfor %}
        </tbody>
    </table>
    
    <!--a href="{{ path('app_person_new') }}">Create new</a-->
{% endblock %}
