@extends('backEnd.master') @section('title') @lang('leave.apply_leave') @endsection @section('mainContent')

@lang('leave.my_remaining_leaves')

@foreach($my_leaves as $my_leave) @php $approved_leaves = App\SmLeaveRequest::approvedLeave($my_leave->id); $remaining_days = $my_leave->days - $approved_leaves; $extra_days= $remaining_days < 0? $approved_leaves - $my_leave->days:0; @endphp @endforeach
@lang('common.type') @lang('leave.remaining_days') @lang('leave.extra_taken') @lang('leave.leave_taken') @lang('leave.leave_days')
{{$my_leave->leaveType !=""?$my_leave->leaveType->type:""}} {{$remaining_days >= 0? $remaining_days:0}} {{$remaining_days < 0? $approved_leaves - $my_leave->days:0}} {{$approved_leaves}} {{$my_leave->days}}
@if(isset($apply_leave)) @if(userPermission('student-apply-leave')) @endif @endif
@if(isset($apply_leave)) {{ Form::open(['class' => 'form-horizontal', 'files' => true, 'route' => array('student-leave-update',$apply_leave->id), 'method' => 'PUT', 'enctype' => 'multipart/form-data']) }} @else @if(userPermission('student-leave-store')) {{ Form::open(['class' => 'form-horizontal', 'files' => true, 'route' => 'student-leave-store','method' => 'POST', 'enctype' => 'multipart/form-data']) }} @endif @endif

@if(isset($apply_leave)) @lang('leave.edit_apply_leave') @else @lang('leave.add_apply_leave') @endif

@if ($errors->has('apply_date')) {{ $errors->first('apply_date') }} @endif
@if ($errors->has('leave_type')) {{ $errors->first('leave_type') }} @endif
@if ($errors->has('leave_from')) {{ $errors->first('leave_from') }} @endif
@if ($errors->has('leave_to')) {{ $errors->first('leave_to') }} @endif
file):'Attach File'}}" disabled id="placeholderAttachFile"> @if ($errors->has('file')) {{ @$errors->first('file') }} @endif
@php $tooltip = ""; if(userPermission('student-leave-store')){ $tooltip = ""; }else{ $tooltip = "You have no permission to add"; } @endphp
{{ Form::close() }}

@lang('leave.leave_list')

@foreach($apply_leaves as $apply_leave) @endforeach
@lang('common.type') @lang('common.from') @lang('common.to') @lang('leave.apply_date') @lang('common.status') @lang('common.action')
@if($apply_leave->leaveDefine != "" && $apply_leave->leaveDefine->leaveType !="") {{$apply_leave->leaveDefine->leaveType->type}} @endif {{$apply_leave->leave_from != ""? dateConvert($apply_leave->leave_from):''}} {{$apply_leave->leave_to != ""? dateConvert($apply_leave->leave_to):''}} {{$apply_leave->apply_date != ""? dateConvert($apply_leave->apply_date):''}} @if($apply_leave->approve_status == 'P') @endif @if($apply_leave->approve_status == 'A') @endif @if($apply_leave->approve_status == 'C') @endif
@endsection @include('backEnd.partials.data_table_js') @include('backEnd.partials.date_picker_css_js')