@extends('layouts.app')
@section('title', __('medorganization::lang.licenses'))
@section('content')
<section class="content-header"><h1>@lang('medorganization::lang.licenses')
    <small>@lang('medorganization::lang.licenses_help')</small>
</h1></section>
<section class="content">
    @component('components.widget', ['class' => 'box-primary'])
        @can('medorg.license.manage')
            @slot('tool')<div class="box-tools"><button class="btn btn-primary medorg-modal-btn" data-href="{{ route('medorg.licenses.create') }}"><i class="fa fa-plus"></i> @lang('messages.add')</button></div>@endslot
        @endcan
        <table class="table table-bordered table-striped" id="medorg_license_table">
            <thead><tr>
                <th>@lang('medorganization::lang.user')</th>
                <th>@lang('medorganization::lang.license_type')</th>
                <th>@lang('medorganization::lang.license_number')</th>
                <th>@lang('medorganization::lang.issuing_authority')</th>
                <th>@lang('medorganization::lang.specialization')</th>
                <th>@lang('medorganization::lang.expiry_date')</th>
                <th>@lang('medorganization::lang.status')</th>
                <th>@lang('messages.action')</th>
            </tr></thead>
        </table>
    @endcomponent
    <div class="modal fade medorg_modal" tabindex="-1" role="dialog"></div>
</section>
@endsection
@section('javascript')
<script>
$(function () {
    var table = $('#medorg_license_table').DataTable({
        processing: true, serverSide: true, ajax: '{{ route('medorg.licenses.index') }}',
        columns: [
            { data: 'user_name', name: 'user_name', orderable: false },
            { data: 'license_type', name: 'l.license_type' },
            { data: 'license_number', name: 'l.license_number' },
            { data: 'issuing_authority', name: 'l.issuing_authority' },
            { data: 'specialization', name: 'l.specialization' },
            { data: 'expiry_date', name: 'l.expiry_date' },
            { data: 'status', name: 'l.status' },
            { data: 'action', name: 'action', orderable: false, searchable: false },
        ],
    });
    window.__medorgTables = window.__medorgTables || []; window.__medorgTables.push(table);
});
</script>
@include('medorganization::partials.crud_scripts')
@endsection
