@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-external-lecturer.index')}}">{{__('administrator.external_lecturer')}}</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.external_lecturer')}} </h3>
                        </div>
                    </div>
                </div>
                <div class="col-sm-6 col-xs-12">
                    <div class="title-add">
                        <div class="pull-right">
                            @if(Gate::check('External Lecture Create'))
                            <a href="{{route('hr-external-lecturer.create')}}"
                               class="button_primary">{{__('administrator.add_new')}}</a>
                                @endif
                        </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.english_name')}}</th>
                    <th>{{__('administrator.khmer_name')}}</th>
                    <th>{{__('administrator.training_type')}}</th>
                    <th>{{__('administrator.phone')}}</th>
                    <th>{{__('administrator.email')}}</th>
                    <th>{{__('administrator.address')}}</th>
                    <th>{{__('administrator.experties')}}</th>
                    <th>{{__('administrator.action')}}</th>
                </tr>
                </thead>
                <tbody>
                @foreach($external_lecturer as $key => $row)
                    <tr>
                        <td>{{$key+1}}</td>
                        <td>{{$row->full_name_en}}</td>
                        <td>{{$row->full_name_kh}}</td>
                        <td>{{$row->trainer_type}}</td>
                        <td>{{$row->phone}}</td>
                        <td>{{$row->email}}</td>
                        <td>{{$row->address}}</td>
                        <td>{{$row->expertise}}</td>
                        <td>
                            {{--<a href="#" class="button_warning">--}}
                                {{--<span class="fa fa-eye"></span>--}}
                            {{--</a>--}}
                            @if(Gate::check('External Lecture Edit'))
                            <a href="{{route('hr-external-lecturer.edit', $row->id)}}" class="button_warning">
                                <span class="fa fa-pencil-square-o"></span>
                            </a>
                                @endif
                        </td>
                    </tr>
                @endforeach
                </tbody>
            </table>
        </div>
    </div>
@endsection
@section('script')
    <script type="text/javascript">
        $(document).ready(function () {
            $('#datatable_products').DataTable();
        });
    </script>
@endsection
