@extends('layouts.app-hr')

@section('content')
    <?php Fun::lang() ?>
    <?php
    $rand_id = rand(1, 1000) . time() . rand(1, 1000);

    ?>
    <div class="top-header">
        <ol class="breadcrumb">
            <li><a href="#">{{__('administrator.dashboard')}}</a></li>
            <li><a href="#">{{__('administrator.take_leave_authorize')}}</a></li>
        </ol>
    </div>
    <div id="page" class="page">
        {!! Form::model($emp_leave, ['method' => 'PATCH','route' => ['take-leave-authorize.update', $emp_leave->id]]) !!}
        <div class="row">
            <div class="master-form">
                <div class="title-note">
                    <h3><span class="fa fa-exclamation-triangle"></span>
                        {{__('administrator.take_leave')}}
                        <i>({{__('administrator.fields_in_red_are_required')}})</i>
                    </h3>
                </div>
                <div class="form-group col-sm-4 col-md-4 ">
                    <div class="">
                        <strong class="required"  for="name">{{__('administrator.employee')}}</strong>
                        {!! Form::select('emp_id',$emp ,null, array('placeholder' => __('administrator.please_select'),'class' => 'form-control select2','required')) !!}
                    </div>
                </div>
                <div class="form-group col-sm-4 col-md-4 ">
                    @php
                        $m = \App\Models\LeaveType::getUpperCaseFullName($leave_type);
                        //dd($m,$leave_type);
                    @endphp
                    <div class="">
                        <strong class="required">Leave Type</strong>
                        {!! Form::select('leave_type', $m,null, array('placeholder' => __('administrator.please_select'),'class' => 'form-control select2','required')) !!}
                    </div>
                </div>
                <div class="form-group col-sm-4 col-md-4 ">
                    <div class="">
                        <strong class="required">Request To</strong>
                        {!! Form::select('request_to', $emp,null, array('placeholder' => __('administrator.please_select'),'class' => 'form-control select2','required')) !!}
                    </div>
                </div>

                <div class="form-group col-sm-4 col-md-4 ">
                    <div class="">
                        <strong class="required">Form date</strong>
                        {!! Form::text('from_date', date('d-m-Y',strtotime($emp_leave->from_date)), array('placeholder' => __('administrator.to_date'),'class' => 'form-control date_picker','autocomplete'=>'off')) !!}
                    </div>
                </div>
                <div class="form-group col-sm-4 col-md-4 ">
                    <div class="">
                        <strong class="required">To date</strong>
                        {!! Form::text('to_date', date('d-m-Y',strtotime($emp_leave->to_date)), array('placeholder' => __('administrator.to_date'),'class' => 'form-control date_picker','autocomplete'=>'off')) !!}
                    </div>
                </div>
                <div class="form-group col-sm-4 col-md-4">
                    <div class="">
                        <strong>Request date</strong>
                        {!! Form::text('request_date',date('d-m-Y',strtotime($emp_leave->request_date)), array('placeholder' => __('administrator.request_date'),'class' => 'form-control date_picker','autocomplete'=>'off')) !!}
                    </div>
                </div>
                <div class="form-group col-sm-4 col-md-4">
                    <div class="">
                        <strong class="">Reason</strong>
                        {!! Form::text('reason', null, array('placeholder' => __('administrator.reason'),'class' => 'form-control','autocomplete'=>'off')) !!}
                    </div>
                </div>

                <div class="form-group col-sm-12 col-xs-12">
                    <div class="form-group footer-save">
                        <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>
        {!! Form::close() !!}
    </div>

@endsection



@section('js')

@endsection

