@extends('layouts.admin') @section('page-title') {{__('Manage Appraisal')}} @endsection @section('breadcrumb') @endsection @push('css-page') @endpush @push('script-page') @endpush @section('action-btn')
@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 if(!empty($appraisal->rating)){ $rating = json_decode($appraisal->rating,true); $starsum = !empty($rating)?array_sum($rating):0; $overallrating = ($starsum!=0)? $starsum/count($rating):0; } else{ $overallrating = 0; } @endphp @if( Gate::check('edit appraisal') ||Gate::check('delete appraisal') ||Gate::check('show appraisal')) @endif @endforeach
{{__('Branch')}} {{__('Department')}} {{__('Designation')}} {{__('Employee')}} {{__('Overall Rating')}} {{__('Appraisal Date')}}{{__('Action')}}
{{ !empty($appraisal->branches)?$appraisal->branches->name:'' }} {{ !empty($appraisal->employees)?!empty($appraisal->employees->department)?$appraisal->employees->department->name:'':'' }} {{ !empty($appraisal->employees)?!empty($appraisal->employees->designation)?$appraisal->employees->designation->name:'':'' }} {{!empty($appraisal->employees)?$appraisal->employees->name:'' }} @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}} @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]) !!} {!! Form::close() !!}
@endcan
@endsection