@extends(branchMenu())
@section('content')

    <div class="container-fluid">
        <div class="row">
            <div class="col-xs-12 col-sm-12 col-md-12 col-lg-12">
                <div class="row">
                    <div class="col-xs-6 col-sm-6 col-md-6 col-lg-6">
                        <h3 class="set_menu_name"></h3>
                    </div>
                    <div class="col-xs-6 col-sm-6 col-md-6 col-lg-6 text-right">
                        <button type="button" data-href="{{route('member-type.create')}}" class="getHtmlForm button_primary fa fa-plus">  <span class="set_menu_name"></span></button>
                        <a type="button" data-name="Import" data-href="{{route('member-type-import-excel')}}" data-width="800px" class="getHtmlForm button_success fa fa-upload"> <span>Import</span></a>
                    </div>
                </div>
                <div class="container-fluid" style="background: white; padding:10px">
                    <div class="table-responsive">
                        <table id="dataTable" class="table table-hover">
                            <thead>
                            <tr>
                                <th>N°</th>
                                <th>{{__('administrator.name')}}</th>
                                <th>{{__('administrator.created_at')}}</th>
                                <th width="10%">{{__('administrator.action')}}</th>
                            </tr>
                            </thead>
                            <tbody>

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

            </div>
        </div>
    </div>
@endsection
@section('script')
    <script type="text/javascript">
        let tb = $('#dataTable');
        $(document).ready(function () {
            getTable();
        });
        function getTable() {
            tb.DataTable().destroy();
            tb.DataTable({
                serverSide: true,
                ordering: false,
                ajax: {
                    url: "{{ route('member-type.index') }}",
                },
                columns:
                    [
                        {data: 'DT_RowIndex','searchable':false},
                        {data: 'name'},
                        {data: 'created_at'},
                        {data: 'action','searchable':false},
                    ]
            });
        }
    </script>
@endsection
