Quality List Quality
@if (is_null($qualities) || empty($qualities))

Currently No Information Available!

@else @if (session('message'))
× {{ session('message') }}.
@endif
{{-- division Table goes here --}} {{-- @foreach ($months as $month) @endforeach @foreach ($months as $month) @endforeach @foreach ($qualities as $ie) @endforeach
Company Department KRA KPI Buyers @if ($month->month == 1) January @elseif ($month->month == 2) February @elseif ($month->month == 3) March @elseif ($month->month == 4) April @elseif ($month->month == 5) May @elseif ($month->month == 6) June @elseif ($month->month == 7) July @elseif ($month->month == 8) August @elseif ($month->month == 9) September @elseif ($month->month == 10) October @elseif ($month->month == 11) November @elseif ($month->month == 12) December @endif , {{ $month->year }} Action
Values %
    {{ $ie->company->name }}
    {{ $ie->department_id }}
    {{ $ie->kra->name }}
    {{ $ie->kpi->name }}
    {{ $ie->buyer->name }}
{{ $ie->value }} {{ $ie->percentage }}
--}} {{-- @php $maxCount = max( $companies->count(), $departments->count(), $kras->count(), $kpis->count(), $buyers->count(), ); @endphp @foreach ($months as $month) @endforeach @foreach ($months as $month) @endforeach @for ($i = 0; $i < $maxCount; $i++) @foreach ($companies as $key => $company) @if ($key == $i) @endif @endforeach @foreach ($departments as $key => $department) @if ($key == $i) @endif @endforeach @foreach ($kras as $key => $kra) @if ($key == $i) @endif @endforeach @foreach ($kpis as $key => $kpi) @if ($key == $i) @endif @endforeach @foreach ($months as $month) @php $cost_control_value = App\Models\CostControl::where('month', $month->month) ->where('year', $month->year) ->where('company_id', $company->id) ->where('department_id', $department->id) ->where('kra_id', $kra->id) ->where('kpi_id', $kpi->id) ->where('buyer_id', $buyer->id) ->first(); @endphp @endforeach @endfor
Action Company Department KRA KPI Buyers @php $monthName = date('F', mktime(0, 0, 0, $month->month, 1)); @endphp {{ $monthName }}, {{ $month->year }}
Values %
{{ $company->name }}{{ $department->name }}{{ $kra->name }}{{ $kpi->name }} @php $buyers_list = App\Models\CostControl::where('company_id', $company->id) ->where('department_id', $department->id) ->where('kra_id', $kra->id) ->where('kpi_id', $kpi->id) ->get(); @endphp @foreach ($buyers_list as $key => $buyer) @if ($key == $i) {{ $buyer->buyer->name }} @endif @endforeach {{ $cost_control_value ? $cost_control_value->value : '' }} {{ $cost_control_value ? $cost_control_value->percentage : '' }}
--}} @foreach ($months as $month)

{{ date('F, Y', strtotime($month->year . '-' . $month->month . '-01')) }}

{{-- Edit and Delete button here --}} Edit
@csrf @method('DELETE')
{{-- --}} @php $distinct_companies = collect(); $distinct_departments = collect(); @endphp @foreach ($qualities as $ie) @if ($ie->year == $month->year && $ie->month == $month->month) @if (!$distinct_companies->contains($ie->company->name)) @endif @if (!$distinct_departments->contains($ie->department->name)) @endif {{-- --}} @endif @endforeach
Company Department KRA KPI BuyerValuePercentage
{{ $ie->company->name }} @php $distinct_companies->push($ie->company->name); @endphp {{ $ie->department->name }} @php $distinct_departments->push($ie->department->name); @endphp {{ $ie->kra->name }} {{ $ie->kpi->name }} {{ $ie->buyer->name }}{{ $ie->value }}{{ $ie->percentage }}
@endforeach
@endif