
@extends( branchMenu())
@section('content')
    <?php Fun::lang()?>
    <div class="page">
        <div class=container-fluid>
            <div class="top-content">
                <div class="row">
                    <div class="col-sm-12 col-xs-12">
                        <div class="title-add">
                            <div class="pull-left">
                                <h3>{{__('administrator.customer')}}</h3>
                            </div>
                            <div class="pull-right">
                                @if(Auth::user()->can('Customer Create') || Auth::user()->user_type === 'seller')
                                    <a onclick="getHtmlForm('{{route('customer.create')}}','{{__('administrator.create').' '.__('administrator.customer')}}','35%')" class=" button_info"><span class="fa fa-plus"></span> {{__('administrator.create')}}</a>
                                @endif
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <div class="wrapper-table">
                <table id="print_table" width="100%" class="table table-striped table-hover ​​ customize">
                    <thead>
                    <tr>
                        <th>#</th>
                        <th>{{__('administrator.seller')}}</th>
                        <th>{{__('administrator.name')}}</th>
                        <th>{{__('administrator.sex')}}</th>
                        <th>{{__('administrator.contact')}}</th>
                        <th>{{__('administrator.address')}}</th>
                        <th>{{__('administrator.action')}}</th>
                    </tr>
                    </thead>
                    <tbody>

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

@endsection
@section('script')
    <script>
        $table = $('#print_table');
        $(document).ready(function () {
            getTable();
        });
        function getTable() {
            $table.DataTable().destroy();
            $table.DataTable({

                ordering: false,
                serverSide: true,
                lengthMenu: tbLeng,
                ajax: {
                    url: '{{route('customer.index')}}',
                    data: {

                    },
                },
                columns:
                    [
                        {data: 'DT_RowIndex', 'searchable': false},
                        {data: 'user_id', 'searchable': false},
                        {data: 'name', 'name': 'nso007_customers.name'},
                        {data: 'sex', 'name': 'nso007_customers.sex'},
                        {data: 'phone', 'name': 'nso007_customers.phone'},
                        {data: 'address', 'name': 'nso007_customers.address'},
                        {data: 'action', 'searchable': false},
                    ],
            });
        }
    </script>
@endsection






