@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-development-plan.index')}}">{{__('administrator.development_plan')}}</a></li>
        </ol>
    </div>
    <div class="container">
        <div class="top-content">
            <div class="row">
                <div class="col-sm-12 col-xs-12">
                    <div class="title-add">
                        <div class="pull-left">
                            <h3>{{__('administrator.development_plan')}}</h3>
                        </div>

                    </div>
                </div>
            </div>
        </div>
        {!! Form::model($dev, ['method' => 'PATCH','route' => ['hr-development-plan.update', $dev->id]]) !!}
        <div class="row">
            <div class="col-sm-12">
                <div class="master-form">
                    <div class="title-note">
                        <h3><span class="fa fa-exclamation-triangle"></span> {{__('administrator.development_plan')}}
                            <i>({{__('administrator.fields_in_red_are_required')}})</i></h3>
                    </div>

                    <div class="form-group col-sm-12 col-xs-12">
                        <div class="col-sm-3 col-xs-12 ">
                            <label class="required"  for="name">{{__('administrator.employee')}}</label>
                        </div>
                        <div class="col-sm-8">
                            {!! Form::select('emp_id', $emp ,null, array('placeholder' => __('administrator.please_select'),'class' => 'form-control select2','autocomplete'=>'off','required')) !!}
                        </div>
                    </div>
                    <div class="form-group col-sm-12 col-xs-12">
                        <div class="col-sm-3 col-xs-12 ">
                            <label class="required"  for="name">{{__('administrator.request_to')}}</label>
                        </div>
                        <div class="col-sm-8">
                            {!! Form::select('request_to', $emp ,null, array('placeholder' => __('administrator.please_select'),'class' => 'form-control select2','autocomplete'=>'off','required')) !!}
                        </div>
                    </div>
                    <div class="form-group col-sm-12 col-xs-12">
                        <div class="col-sm-3 col-xs-12 ">
                            <label class=""  for="name">Area an need of Department</label>
                        </div>
                        <div class="col-sm-8">
                            {!! Form::textarea('description_department' ,null, array('placeholder' => __('administrator.department'),'class' => 'form-control ','autocomplete'=>'off')) !!}
                        </div>
                    </div>
                    <div class="form-group col-sm-12 col-xs-12">
                        <div class="col-sm-3 col-xs-12 ">
                            <label class=""  for="name">{{__('administrator.suggestion')}}</label>
                        </div>
                        <div class="col-sm-8 table-responsive table-responsive-ss">
                            <table class="table table-bordered" width="100%;">
                                <thead>
                                <tr style="text-align: center;">
                                    <th>1. Training</th>
                                    <th>2. Hard Skill</th>
                                    <th>3. Soft Skill</th>
                                </tr>
                                </thead>
                                <tbody>
                                <tr>
                                    <td>
                                        @php
                                            $training = \App\HrTraining::get();
                                            $hard_skill = \App\HrHardSkill::get();
                                            $soft_skill = \App\HrSoftSkill::get();
                                            $suggestion_training = $dev->suggestion_training;
                                            $suggestion_hard_skill = $dev->suggestion_hard_skill;
                                            $suggestion_soft_skill = $dev->suggestion_soft_skill;
                                        @endphp
                                        @foreach($training as $key => $value)
                                            <input class="" type="checkbox" value="1" {{@$suggestion_training[$value->name]?'checked=true':''}} name="training[{{ $value->name }}]" >
                                            <label>{{$value->name}}</label><br>
                                        @endforeach
                                    </td>
                                    <td>
                                        @foreach($hard_skill as $key => $value)
                                            <input class="" type="checkbox" value="1" {{@$suggestion_hard_skill[$value->name]?'checked=true':''}} name="hard_skill[{{ $value->name }}]" >
                                            <label>{{$value->name}}</label><br>
                                        @endforeach
                                    </td>
                                    <td>
                                        @foreach($soft_skill as $key => $value)
                                            <input class="" type="checkbox" value="1"  {{@$suggestion_soft_skill[$value->name]?'checked=true':''}}  name="soft_skill[{{ $value->name }}]" >
                                            <label>{{$value->name}}</label><br>
                                        @endforeach
                                    </td>
                                </tr>
                                </tbody>
                            </table>
                        </div>
                    </div>
                    <div class="form-group col-sm-12 col-xs-12">
                        <div class="col-sm-3 col-xs-12 ">
                            <label class=""  for="name">{{__('administrator.description')}}</label>
                        </div>
                        <div class="col-sm-8">
                            {!! Form::textarea('description' ,null, array('placeholder' => __('administrator.department'),'class' => 'form-control ','autocomplete'=>'off')) !!}
                        </div>
                    </div>


                    <div class="col-sm-11 col-xs-12">
                        <div class="form-group footer-save">
                            <button type="submit" class=" button_primary pull-right"><span
                                        class="fa fa-save"></span> {{__('administrator.save')}}</button>
                            <button type="button" onClick="history.go(-1)"
                                    class=" button_warning pull-right">
                                <span class=" fa fa-arrow-circle-left"></span> {{__('administrator.back')}}</button>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        {!! Form::close() !!}
    </div>
@endsection




