@extends('dashboard.layouts.app') @push('headScripts') @endpush @section('content')

{{ __('Dashboard') }} / {{ __('Users Kpis') }} / {{ $users_kpi->id }}

{{ __('Users Kpis') }}/{{ $users_kpi->id }}
@php($totalWeight100=0) @php($totalScore100=0) @foreach(config('app.kpiSections100') as $section) @php($totalKpis=0) @php($percentage=($users_kpi->Questions()->where('kpi_question_section',$section)->sum('kpi_question_weight')/100)) @foreach($users_kpi->Questions()->where('kpi_question_section',$section)->get() as $question) @php($score=((($question->employee_actual/$question->employee_target)*100)*$question->kpi_question_weight)/100) @php($totalWeight100+=$question->kpi_question_weight) @php($totalScore100+=$score) {{-- @if($section=='kpis'&&$loop->last)--}} @if($loop->last) @endif @endforeach @endforeach @foreach(config('app.kpiSections30') as $section) @php($totalScore30=0) @foreach($users_kpi->Questions()->where('kpi_question_section',$section)->get() as $question) @php($score30=((($question->employee_actual/$question->employee_target)*100)*$question->kpi_question_weight)/100) @php($totalScore30+=$score30) @endforeach @endforeach {{-- --}}
Weight
{{ __(ucwords(str_replace('_',' ',$section))) }} {{ $users_kpi->Questions()->where('kpi_question_section',$section)->sum('kpi_question_weight') }}% @if($loop->first){{ \Carbon\Carbon::create()->month($users_kpi->month)->translatedFormat('F') }} - {{ $users_kpi->year }}@endif
{{ $question->kpi_question_question }} {{ $question->kpi_question_weight }}% {{ $question->employee_target }} {{ $question->employee_actual }} {{ $score }}% {{-- @if($section=='kpis')--}} @php($totalKpis+=$score/.5) {{ $score/$percentage }}% {{-- @endif--}}
{{ $totalKpis }}%
{{ $totalWeight100 }}% {{ $totalScore100 }}%
{{ __(ucwords(str_replace('_',' ',$section))) }} {{ $users_kpi->Questions()->where('kpi_question_section',$section)->sum('kpi_question_weight') }}%
{{ $question->kpi_question_question }} {{ $question->kpi_question_weight }}% {{ $score30 }}%
Total {{ $users_kpi->Questions()->sum('kpi_question_weight') }}% {{ $totalKpis+$totalScore30 }}%{{ $totalScore100+$totalScore30 }}%
@endsection @push('footerScripts') @endpush