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

{% block title %} Utilisateur {% endblock %}

{% block content %}
<!-- Page Heading -->
<div class="d-sm-flex align-items-center justify-content-between mb-4">
    <h1 class="h3 mb-0 text-gray-800">Utilisateurs</h1>
    <ol class="breadcrumb float-sm-right">
        <li class="breadcrumb-item">Utilisateurs</li>
        <li class="breadcrumb-item active">Lister</li>
    </ol>
</div>




<!-- Begin Page Content -->
<div class="container-fluid">
    
    {% include 'backend_admin/basic/notice.html.twig' %}

    <!-- DataTales Example -->
    <div class="card shadow mb-4">
        <div class="card-header py-3">
            <h6 class="m-0 font-weight-bold text-primary">Liste des Utilisateurs</h6>
        </div>
        <div class="card-body">
            <div class="table-responsive">
                <table class="table table-bordered" id="dataTable" width="100%" cellspacing="0">
                    <thead>
                        <tr>
                            <th>#</th>
                            <th>Prénom</th>
                            <th>Nom</th>
                            <th>Sexe</th>
                            <th>Email</th>
                            <th>Téléphone</th>
                            <th>Naissance</th>
                            <th>Inscription</th>
                            <th>Action</th>
                        </tr>
                    </thead>
                    <tfoot>
                        <tr>
                            <th>#</th>
                            <th>Prénom</th>
                            <th>Nom</th>
                            <th>Gender</th>
                            <th>Email</th>
                            <th>Téléphone</th>
                            <th>Naissance</th>
                            <th>Inscription</th>
                            <th>Action</th>
                        </tr>
                    </tfoot>
                    <tbody>
                        {% for user in users %}
                            <tr>
                                <td>{{ user.id }}</td>
                                <td>{{ user.firstname }}</td>
                                <td>{{ user.lastname }}</td>
                                <td>
                                    {% if user.gender == 0 %}
                                        <i class="fa fa-venus" style="color: #e75fa6"></i>
                                    {% else %}
                                        <i class="fa fa-mars" style="color: #318CE7"></i>
                                    {% endif %}
                                </td>
                                <td>{{ user.email }}</td>
                                <td>{{ user.phoneNumber }}</td>
                                <td>{{ user.birthdate|date('d/m/Y') }}</td>
                                <td>{{ user.dateAdd|date('d/m/Y H:i:s') }}</td>
                                
                                <td>    
                                    <a href="/admin/user/154714" title="Editer" class="btn btn-info btn-action"><i class="fa fa-edit"></i></a>
                                    <a href="/?_switch_user=mfrancoisechapeau@gmail.com" title="Se connecter en tant que" class="btn btn-warning"><i class="fa-solid fa-user-secret"></i></a>
                                    
                                    <a href="{{ path('backend_admin_user_update_delete', {id:user.id, delete:true}) }}" title="déactiver ce utilisateur" class="btn btn-danger"><i class="fa fa-times"></i></a>
                                </td>
                            </tr>
                        {% endfor %}
                    </tbody>
                </table>
            </div>
        </div>
    </div>
</div>
                

{% endblock %}
