@extends('adminlte::page')

@section('content')
    <?php Fun::lang()?>
    <div class="top-header">
        <ol class="breadcrumb">
            <li><a href="#">{{__('administrator.dashboard')}}</a></li>
            <li><a href="{{route('hr-holiday.index')}}">{{__('administrator.holiday')}}</a></li>
        </ol>
    </div>
    <div class="page">
        <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.holiday')}} </h3>
                        </div>
                    </div>
                </div>
                <div class="col-sm-6 col-xs-12">
                    <div class="title-add">
                        <div class="pull-right">
                            @can('Holiday-Create')<a href="{{route('hr-holiday.create')}}" class="button_primary">{{__('administrator.add_new')}}</a>@endcan
                        </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.holiday')}}</th>
                    <th>{{__('administrator.from_date')}}</th>
                    <th>{{__('administrator.to_date')}}</th>
                    <th>{{__('administrator.note')}}</th>
                    <th>{{__('administrator.action') }}</th>
                </tr>
                </thead>
                <tbody>
                    @foreach($hol as $key => $row)
                        <tr>
                            <td>{{$key+1}}</td>
                            <td>{{$row->name}}</td>
                            <td>{{$row->from_date = date('Y-m-d',strtotime($row->from_date))}}</td>
                            <td>{{$row->to_date = date('Y-m-d',strtotime($row->to_date))}}</td>
                            <td>{{$row->note}}</td>
                            <td>@can('Holiday-Edit')<a href="{{route('hr-holiday.edit',$row->id)}}" class="button_warning"><span class="fa fa-pencil-square-o"></span></a>@endcan</td>
                        </tr>
                    @endforeach
                </tbody>
            </table>
        </div>
    </div>
@endsection
@section('js')
    <script type="text/javascript">
        $(document).ready(function () {
            $('#datatable_products').DataTable();
        });
    </script>
@endsection
