@extends('layouts.app')
@section('title', __('medorganization::lang.facilities'))
@section('content')
<section class="content-header"><h1>@lang('medorganization::lang.facilities')
    <small>@lang('medorganization::lang.facilities_help')</small>
</h1></section>
<section class="content">
    @component('components.widget', ['class' => 'box-primary'])
        <table class="table table-bordered table-striped" id="medorg_facility_table">
            <thead><tr>
                <th>@lang('medorganization::lang.location')</th>
                <th>@lang('medorganization::lang.code')</th>
                <th>@lang('medorganization::lang.facility_type')</th>
                <th>@lang('medorganization::lang.parent_facility')</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_facility_table').DataTable({
        processing: true, serverSide: true, ajax: '{{ route('medorg.facilities.index') }}',
        columns: [
            { data: 'name', name: 'bl.name' },
            { data: 'code', name: 'fp.code' },
            { data: 'facility_type', name: 'fp.facility_type' },
            { data: 'parent_name', name: 'parent.name' },
            { data: 'status', name: 'fp.status' },
            { data: 'action', name: 'action', orderable: false, searchable: false },
        ],
    });
    window.__medorgTables = window.__medorgTables || []; window.__medorgTables.push(table);
});
</script>
@include('medorganization::partials.crud_scripts')
@endsection
