@extends('layouts.super-Admin')
@section('acces_policier')
<style>
    .dtHorizontalVerticalExampleWrapper {
  max-width: 600px;
  margin: 0 auto;
}
#dtHorizontalVerticalExample th, td {
  white-space: nowrap;
}
table.dataTable thead .sorting:after,
table.dataTable thead .sorting:before,
table.dataTable thead .sorting_asc:after,
table.dataTable thead .sorting_asc:before,
table.dataTable thead .sorting_asc_disabled:after,
table.dataTable thead .sorting_asc_disabled:before,
table.dataTable thead .sorting_desc:after,
table.dataTable thead .sorting_desc:before,
table.dataTable thead .sorting_desc_disabled:after,
table.dataTable thead .sorting_desc_disabled:before {
  bottom: .5em;
}
</style>
    <div class="pagetitle">
        <div class="row">
            <h1 class="col">Listes des administrateurs enregistrées</h1>
            <div class="col ">
                {{--
                @if (session()->has('info'))
                    <div class="alert alert-warning alert-dismissible fade show" role="alert">
                        {{ session('info') }}
                        <button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
                    </div>
                @elseif(session()->has('modif'))
                    <div class="alert alert-success alert-dismissible fade show" role="alert">
                        {{ session('modif') }}
                        <button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
                    </div>
                @endif

 --}}

 @include('sweetalert::alert')

            </div>
            <nav>
                <ol class="breadcrumb">
                    <li class="breadcrumb-item"><a href="#">Tableau</a></li>
                </ol>
            </nav>
        </div><!-- End Page Title -->
        <div class="mb-5">
            <a href="{{ route('compte_admin.create') }}" class="btn bg-success text-white"> Ajouter un nouveau admin</a>
        </div>

        <section class="section">
            <div class="row">
                <div class="col-lg">
                    <div class="card">
                        <div class="card-body mt-5">



          <table id="dtHorizontalVerticalExample" class="table table-striped table-bordered table-sm "cellspacing="0" width="100%">
                            <thead>
                                <tr>
                                        <th>Nom</th>
                                        <th>email</th>
                                        <th>Password</th>
                                        <th>Actions</th>
                                </tr>
                            </thead>
                            <tbody>

                                    @foreach ($utilisateur_admins as $utilisateur_admin)
                                        <tr>
                                            <td>{{ $utilisateur_admin->name }}</td>
                                            <td>{{ $utilisateur_admin->email }}</td>
                                            <td> <strong>.....................</strong></td>


                                    <td>
                                        <div class="row">
                                                         <div class="col-3">
                                                       <form action="{{ route('compte_admin.destroy', $utilisateur_admin->id) }}" method="post">
                                                    @csrf
                                                    @method('DELETE')
                                                    <button class="btn bg-danger" type="submit" >
                                                    <img src="{{ asset('assets/img/delete.png') }}" alt="" srcset="">

                                                    </button>
                                                </form>
                                            </div>
                                        </div>

                                    </td>

                                </tr>
                            @endforeach

                            </tbody>
                        </table>
                        {{ $utilisateur_admins->links() }}
                        </div>
                    </div>
                </div>
            </div>
        </section>
         <script>
            $(document).ready(function() {
                $('#dtHorizontalVerticalExample').DataTable({
                    "scrollX": true,
                    "scrollY": 200,
                });
                $('.dataTables_length').addClass('bs-select');
            });
        </script>
    @endsection
