1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70
   | 
<table class="table table-bordered table-striped table-hover js-basic-example dataTable">
                        <thead>
                        <tr>
                            <th>#</th>
                            <th>Nom d'utilisateur</th>
                            <th>Email</th>
                            <th>Nom</th>
                            <th>Prénom</th>
                            <th>Organisation</th>
                            <th>Adresse</th>
                            <th>Code postal</th>
                            <th>Ville</th>
                            <th>Supprimer</th>
                        </tr>
                        </thead>
                        <tbody>
                        {% for user in users %}
                            <tr>
                                <td>{{ user.id }}</td>
                                <td>{{ user.username }}</td>
                                <td>{{ user.email }}</td>
                                <td>{{ user.lastName }}</td>
                                <td>{{ user.firstName }}</td>
                                <td>{{ user.company }}</td>
                                <td>{{ user.address }}</td>
                                <td>{{ user.cp }}</td>
                                <td>{{ user.city }}</td>
                                <td>
                                    <a href="#" id="{{ user.id }}"><i class="material-icons">delete_forever</i></a>
                                    <script>
                                        $('a').click(function () {
                                            var btnId = $(this).attr("id");
                                            warning(btnId);
                                        });
                                        function warning(btnId) {
                                            swal({
                                                title: "Êtes-vous sûr ?",
                                                text: "Le compte utilisateur de Mr {{ user.username }} {{ user.id }} sera définitivement supprimé",
                                                type: "warning",
                                                showCancelButton: true,
                                                confirmButtonColor: "#DD6B55",
                                                confirmButtonText: "Oui, je souhaite supprimé !",
                                                cancelButtonText: "Non, je souhaite annulé !",
                                                closeOnConfirm: false,
                                                closeOnCancel: false
                                            }, function (isConfirm) {
                                                if (isConfirm) {
                                                    swal("Supprimé !", "Le compte à bien été supprimé", "success");
                                                    $.ajax({
//                                                        method: "POST",
                                                        {#url: "{{ path('deleteUsersAdmin', {'id':  user.id  }  ) }}",#}
//                                                        data: {},
                                                        success: function (data) {
                                                            window.location = '{{ path('deleteUsersAdmin', {'id':  user.id  }) }}';
                                                        }
                                                    })
                                                } else {
                                                    swal("Annulation", "Aucun compte n'a été supprimé", "error");
                                                }
                                            });
                                        }
                                    </script>
                                </td>
                            </tr>
                        {% endfor %}
                        </tbody>
                    </table> | 
Partager