@extends('layouts.app-hr')

@section('content')
    <?php Fun::lang()?>
    <div class="top-header">
        <ol class="breadcrumb">
            <li><a href="#">{{__('administrator.Dashboard')}}</a></li>
            <li><a href="{{route('hr-leave-request.index')}}">{{__('administrator.leave_list')}}</a></li>
        </ol>
    </div>
    <div class="page">
<div class=container-fluid>
        <div class="top-content">
            <div class="row">
                <div class="col-sm-6 col-xs-12">
                    <div class="title-add">
                        <div class="pull-left">
                            <h3>{{__('administrator.leave_list')}} </h3>
                        </div>
                    </div>
                </div>
                <div class="col-sm-6 col-xs-12">
                    <div class="title-add">
                        <div class="pull-right">
                            <a href="{{route('hr-leave-request.create')}}"
                               class="button_primary">{{__('administrator.add_new')}}</a>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <div class="box-body">
            <table id="datatable_products" width="100%" class="table table-striped">
                <thead>
                <tr>
                    <th>#</th>
                    <th>{{ __('administrator.employee') }}</th>
                    <th>{{__('administrator.leave_type')}}</th>
                    <th>{{__('administrator.from_date')}}</th>
                    <th>{{__('administrator.to_date')}}</th>
                    <th>{{__('administrator.reason')}}</th>
                    <th>{{__('administrator.status')}}</th>
                    <th>{{ __('administrator.action') }}</th>
                </tr>
                </thead>
                <tbody>

                </tbody>
            </table>
        </div>
        </div>
    </div>
@endsection
@section('script')
    <script type="text/javascript">
        $(document).ready(function () {
            $('#datatable_products').DataTable({
                ordering: false,
                serverSide: true,
                ajax: "{{ route('datatable.hr-get-leave-staff') }}",
                columns:
                    [
                        {data: 'DT_RowIndex'},
                        {data: 'emp_id'},
                        {data: 'leave_type'},
                        {data: 'from_date'},
                        {data: 'to_date'},
                        {data: 'reason'},
                        {data: 'status'},
                        {data: 'action'},
                    ],
                "initComplete": function (settings, json) {
                }
            });
            $.fn.dataTable.ext.errMode = 'throw';
        });
    </script>
@endsection
