@extends('layouts.app')

@section('title', __('bms::lang.transfers'))

@section('content')

<section class="content-header">
    <h1>@lang('bms::lang.transfers')
        <small>@lang('bms::lang.transfers_help')</small>
    </h1>
</section>

<section class="content">
    @component('components.widget', ['class' => 'box-primary', 'title' => __('bms::lang.transfers')])
        <div class="table-responsive">
            <table class="table table-bordered table-striped" id="bms_transfers_table">
                <thead>
                    <tr>
                        <th>#</th>
                        <th>@lang('bms::lang.transfer_type')</th>
                        <th>@lang('bms::lang.to_hall')</th>
                        <th>@lang('bms::lang.items')</th>
                        <th>@lang('messages.status')</th>
                        <th>@lang('bms::lang.acceptance')</th>
                    </tr>
                </thead>
            </table>
        </div>
        <p class="text-muted" style="margin-top:12px;">@lang('bms::lang.transfers_note')</p>
    @endcomponent
</section>

@endsection

@section('javascript')
<script>
$(function () {
    $('#bms_transfers_table').DataTable({
        processing: true, serverSide: true, order: [[0, 'desc']],
        ajax: '{{ route('bms.transfers.index') }}',
        columns: [
            { data: 'id', name: 'bms_transfer_requests.id' },
            { data: 'type', name: 'bms_transfer_requests.type' },
            { data: 'to_hall', name: 'bms_halls.name' },
            { data: 'items_count', name: 'items_count', orderable: false, searchable: false },
            { data: 'status', name: 'bms_transfer_requests.status' },
            { data: 'acceptance', name: 'acceptance', orderable: false, searchable: false },
        ],
    });
});
</script>
@endsection
