@extends('layouts.layout-2')

@section('content')


    <h4 class="font-weight-bold py-2 mb-2">
        {{ __('Bestellungen Vertriebspartner') }}
    </h4>


    <div class="card">
        <div class="card-datatable table-responsive">
            <table class="datatable-users table table-striped table-bordered">

                <thead>
                <tr>
                    <th>#</th>
                    <th>{{__('Datum')}}</th>
                    <th>{{__('Betrag')}}</th>
                    <th>{{__('Zahlung')}}</th>
                    <th>{{__('Status')}}</th>
                    <th>{{__('Versand')}}</th>
                    <th>{{__('Art')}}</th>
                    <th>{{__('First name')}}</th>
                    <th>{{__('Last name')}}</th>
                    <th>{{__('E-Mail')}}</th>
                    <th>B.{{__('First name')}}</th>
                    <th>B.{{__('Last name')}}</th>
                    <th>B.{{__('E-Mail')}}</th>

                    <th>{{__('Rf-Nr.')}}</th>
                    <th>{{__('Käufe')}}</th>
                </tr>
                </thead>
            </table>
        </div>
    </div>
    <script>
        $( document ).ready(function() {
            $('.datatable-users').dataTable({
                "processing": true,
                "serverSide": true,
                "ajax": '{!! route('admin_sales_users_datatable') !!}',
                "order": [[0, "desc" ]],
                "columns": [
                    { data: 'id', searchable: false },
                    { data: 'created_at', name: 'shopping_orders.created_at' },
                    { data: 'total_shipping', name: 'total_shipping' },
                    { data: 'payment', name: 'payment', orderable: false },
                    { data: 'txaction', name: 'txaction' },
                    { data: 'shipped', name: 'shipped' },
                    { data: 'is_for', name: 'is_for', orderable: false  },
                    { data: 'shopping_user.shipping_firstname', name: 'shopping_user.shipping_firstname', orderable: false  },
                    { data: 'shopping_user.shipping_lastname', name: 'shopping_user.shipping_lastname', orderable: false  },
                    { data: 'shopping_user.shipping_email', name: 'shopping_user.shipping_email', orderable: false   },
                    { data: 'shopping_user.billing_firstname', name: 'shopping_user.billing_firstname', orderable: false  },
                    { data: 'shopping_user.billing_lastname', name: 'shopping_user.billing_lastname', orderable: false  },
                    { data: 'shopping_user.billing_email', name: 'shopping_user.billing_email', orderable: false   },
                    { data: 'reference', name: 'reference' },
                    { data: 'shopping_user.orders', name: 'shopping_user.orders' },
                ],
                "bLengthChange": false,
                "iDisplayLength": 100,
                "language": {
                    "url": "/js/German.json"
                }
            });

        });
    </script>
@endsection