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

@if(!request()->routeIs('users_kpis.report_show')) {{ __('KPIS') }} / {{ __('Users KPIS') }} / {{ (isset($users_kpi))?__('Edit :type',['type'=>$users_kpi->name]):__('Create') }} @else {{ __('KPIS') }} / {{ __('User KPIS Report') }} / {{ \Carbon\Carbon::create()->month($users_kpi->month)->translatedFormat('F') }} - {{ $users_kpi->year }}/score:{{ $users_kpi->total_employee_score }}% - {{ \App\Models\UsersKPISQuestion::where('users_kpi_id', $users_kpi->id) ->selectRaw(' ROUND( SUM( CASE WHEN kpi_question_section = "kpis" THEN (((employee_actual / employee_target) * 100) * kpi_question_weight) / 100 ELSE 0 END ) / 0.5 ) + ROUND( SUM( CASE WHEN kpi_question_section = "added_value" THEN (((employee_actual / employee_target) * 100) * kpi_question_weight) / 100 ELSE 0 END ) ) AS score ') ->value('score') }}% @endif

@if(!request()->routeIs('users_kpis.report_show'))
@if(isset($users_kpi)) @method('PUT') @endif @csrf @endif
{{ (isset($users_kpi))?__('Edit :type',['type'=>$users_kpi->name]):__('Create') }}
@error('year') {{ $message }} @enderror @error('month') {{ $message }} @enderror
@error('user_id') {{ $message }} @enderror
@foreach(config('app.kpiSections') as $section)
{{ __('Create Questions for :section',['section'=>__(ucwords(str_replace('_',' ',$section)))]) }}
@if(!request()->routeIs('users_kpis.report_show'))
@endif
0%
@if(isset($users_kpi)) @include('dashboard.users_kpis.show_questions',['userKPIQuestions'=>$users_kpi->Questions()->where('kpi_question_section',$section)->get()]) @elseif(old('questionsIDS')) @include('dashboard.users_kpis.show_questions',['questions'=>\App\Models\KPISQuestion::where('section',$section)->whereIn('id',old('questionsIDS'))->get()]) @endif @endforeach
@if(!request()->routeIs('users_kpis.report_show'))
@endif
@endsection @push('footerScripts') @endpush