@extends('layouts.vertical', ['page_title' => 'Datatables']) @section('css') @endsection @section('content')
| {{ $col['name'] }} | @endforeach|
|---|---|
| @php if (is_numeric($val)) { if (floor($val) == $val) { echo number_format($val); } else { echo number_format($val, 2); } } else { echo $val; } @endphp | @endforeach|
| Total | @foreach (array_slice($monthsummary, 1) as $col) @php $key = $col['key']; @endphp@if ($key === 'percent_ach') {{ $monthTotals['units_plan'] > 0 ? round(($monthTotals['units_ach'] / $monthTotals['units_plan']) * 100) : 0 }}% @else @php $totalVal = $monthTotals[$key] ?? 0; if (floor($totalVal) == $totalVal) { echo number_format($totalVal); } else { echo number_format($totalVal, 2); } @endphp @endif | @endforeach
| {{ $col['label'] }} | @endforeach||
|---|---|---|
| @if (is_numeric($val)) {{ number_format($val) }} @else {{ $val }} @endif | @endforeach||
| Total | @foreach ($weeklysummary as $col) @if ($col['key'] === 'product_name') @continue @elseif ($col['key'] === 'percent_ach'){{ $weeklyTotals['month_plan'] > 0 ? number_format(($weeklyTotals['units_ach'] / $weeklyTotals['month_plan']) * 100) : 0 }}% | @else{{ number_format($weeklyTotals[$col['key']] ?? 0) }} | @endif @endforeach
| {{ $col['name'] }} | @endforeach||
|---|---|---|
| @if ($col['key'] === 'percent_ach') {{ round($val) }} @elseif (is_numeric($val)) {{ number_format($val) }} @else {{ $val }} @endif | @endforeach||
| Total | @foreach ($centersummary as $index => $col) @if ($index === 0) {{-- Skip the first column since "Total" text already there --}} @continue @endif @php $key = $col['key']; $val = $centerTotals->{$key} ?? 0; @endphp @if ($key === 'percent_ach') @php $plan = $centerTotals->centers_plan ?? 0; $ach = $centerTotals->centers_ach ?? 0; $percent = $plan > 0 ? number_format(($ach / $plan) * 100) : 0; @endphp{{ $percent }}% | @else{{ number_format($val) }} | @endif @endforeach
| {{ $col['name'] }} | @endforeach|
|---|---|
| {{ is_numeric($val) ? number_format($val) : $val }} | @endforeach|
| Total | @foreach (array_slice($centertrendsummary, 1) as $col) @php $val = $centerTrendTotals[$col['key']] ?? 0; @endphp{{ number_format($val) }} | @endforeach
| {{ $col['name'] }} | @endforeach|
|---|---|
| {{ is_numeric($val) ? number_format($val) : $val }} | @endforeach|
| Total | @foreach (array_slice($unittrendsummary, 1) as $col){{ number_format($unitTrendTotals[$col['key']] ?? 0) }} | @endforeach