@extends('yonetim.yonetim_master')

@section('cssler')
    <link rel="stylesheet" href="https://cdn.datatables.net/1.12.1/css/jquery.dataTables.min.css">

@endsection

@section('main')
    <section class="section">
        <div class="section-body">
            <div class="row">
                <div class="col-12">
                    <div class="card">
                        <div class="card-header">
                            <h4>Üye Listesi / Toplam Üye Sayısı : <span style="font-size: 13px;padding: 4px 6px" class="badge badge-secondary">{{$veriler->count()}}</span></h4>


                        </div>
                        <div class="card-body">

                            <div class="table-responsive">
                                <table class="table table-striped" id="table-1">
                                    <thead>
                                    <tr>

                                        <th>Adı</th>
                                        <th>Email</th>
                                        <th>Kullanıcı Adı</th>
                                        <th>Mail Onay</th>

                                        <th>İşlemler</th>
                                    </tr>
                                    </thead>
                                    <tbody>

                                    @foreach($veriler as $veri)
                                        <tr>

                                            <td>{{$veri->name}} {{$veri->surname}}</td>
                                            <td>
                                                {{$veri->email}}
                                            </td>

                                            <td>
                                                {{$veri->username}}
                                            </td>

                                            <td>
                                                @if($veri->mailonay==0)
                                                    <span class="badge badge-primary">Onaylanmadı</span>
                                                @else
                                                    <span class="badge badge-success">Onaylandı</span>

                                                @endif
                                            </td>




                                            <td>
                                                <a href="{{ route('uyeler.uyedetay',$veri->id)}}" class="btn btn-warning"><i class="fa fa-edit"></i> Üye Detay</a>


                                            </td>
                                        </tr>
                                    @endforeach





                                    </tbody>
                                </table>
                            </div>
                        </div>
                    </div>
                </div>
            </div>

        </div>
    </section>
@endsection

@section('datatables')
    <script src="https://cdn.datatables.net/1.12.1/js/jquery.dataTables.min.js"></script>

    <script>
        $(document).ready( function () {
            $('#table-1').DataTable();
        } );


    </script>

    <script>
        $('#table-1').DataTable({
            "order": [[ 0, "desc" ]],

            language: {
                info: "_TOTAL_ kayıttan _START_ - _END_ kayıt gösteriliyor.",
                infoEmpty:      "Gösterilecek hiç kayıt yok.",
                loadingRecords: "Kayıtlar yükleniyor.",
                lengthMenu: "Sayfada _MENU_ kayıt göster",
                zeroRecords: "Tablo boş",
                search: "Arama:",
                infoFiltered:   "(toplam _MAX_ kayıttan filtrelenenler)",
                buttons: {
                    copyTitle: "Panoya kopyalandı.",
                    copySuccess:"Panoya %d satır kopyalandı",
                    copy: "Kopyala",
                    print: "Yazdır",
                },

                paginate: {
                    first: "İlk",
                    previous: "Önceki",
                    next: "Sonraki",
                    last: "Son"
                },
            }
        });
    </script>
@endsection
