JFIFxxC      C  " }!1AQa"q2#BR$3br %&'()*456789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz w!1AQaq"2B #3Rbr@extends('layouts.admin') @section('page-title') {{ __('Manage Appraisal') }} @endsection @push('css-page') @endpush @push('script-page') @endpush @section('breadcrumb') @endsection @section('action-button') @can('Create Appraisal') @endcan @endsection @section('content')
{{--
--}}
@if (Gate::check('Edit Appraisal') || Gate::check('Delete Appraisal') || Gate::check('Show Appraisal')) @endif @foreach ($appraisals as $appraisal) @php $designation = !empty($appraisal->employees) ? $appraisal->employees->designation->id : '-'; $targetRating = \App\Models\Utility::getTargetrating($designation, $competencyCount); if (!empty($appraisal->rating) && $competencyCount != 0) { $rating = json_decode($appraisal->rating, true); $starsum = array_sum($rating); $overallrating = $starsum / $competencyCount; } else { $overallrating = 0; } @endphp @php if (!empty($appraisal->rating)) { $rating = json_decode($appraisal->rating, true); if (!empty($rating)) { $starsum = array_sum($rating); $overallrating = $starsum / count($rating); } else { $overallrating = 0; } } else { $overallrating = 0; } @endphp @endforeach
{{ __('Branch') }} {{ __('Department') }} {{ __('Designation') }} {{ __('Employee') }} {{ __('Target Rating') }} {{ __('Overall Rating') }} {{ __('Appraisal Date') }}{{ __('Action') }}
{{ !empty($appraisal->branches) ? $appraisal->branches->name : '' }} {{ !empty($appraisal->employees) ? $appraisal->employees->department->name : '-' }} {{ !empty($appraisal->employees) ? $appraisal->employees->designation->name : '-' }} {{ !empty($appraisal->employees) ? $appraisal->employees->name : '-' }} @for ($i = 1; $i <= 5; $i++) @if ($targetRating < $i) @if (is_float($targetRating) && round($targetRating) == $i) @else @endif @else @endif @endfor ({{ number_format($targetRating, 1) }}) @for ($i = 1; $i <= 5; $i++) @if ($overallrating < $i) @if (is_float($overallrating) && round($overallrating) == $i) @else @endif @else @endif @endfor ({{ number_format($overallrating, 1) }}) {{ $appraisal->appraisal_date }} @if (Gate::check('Edit Appraisal') || Gate::check('Delete Appraisal') || Gate::check('Show Appraisal')) @can('Show Appraisal') @endcan @can('Edit Appraisal') @endcan @can('Delete Appraisal')
{!! Form::open([ 'method' => 'DELETE', 'route' => ['appraisal.destroy', $appraisal->id], 'id' => 'delete-form-' . $appraisal->id, ]) !!}
@endcan
@endif
@endsection