@extends('layouts.app', ['class' => 'g-sidenav-show bg-gray-100']) {{-- section content --}} @section('content') @include('layouts.navbars.auth.topnav', ['title' => ''])
| No | Kategori | @foreach ($bulanList as $bulan){{ $bulan }} | @endforeachTotal |
|---|---|---|---|
| {{ $kategoriIndex + 1 }} | + {{ $row['kategori'] }} | @foreach ($bulanList as $bulan)Rp {{ number_format($row[$bulan], 0, ',', '.') }} | @endforeachRp {{ number_format(array_sum(array_slice($row, 1, count($bulanList))), 0, ',', '.') }} |
| – {{ $sub['nama'] }} | @foreach ($bulanList as $bulan)Rp {{ number_format($sub[$bulan], 0, ',', '.') }} | @endforeachRp {{ number_format(array_sum(array_slice($sub, 1)), 0, ',', '.') }} | |
| Jumlah | @foreach ($bulanList as $bulan)Rp {{ number_format($table_result[count($table_result) - 1][$bulan], 0, ',', '.') }} | @endforeach@php $jumlahRow = end($table_result); $grandTotal = 0; foreach ($bulanList as $bulan) { $grandTotal += $jumlahRow[$bulan]; } @endphp Rp {{ number_format($grandTotal, 0, ',', '.') }} | |
| Kenaikan / Penurunan (%) | @php $jumlahRow = end($table_result); $prevValue = null; @endphp @foreach ($bulanList as $bulan) @php $currentValue = $jumlahRow[$bulan]; if (is_null($prevValue)) { $change = '-'; } else { $change = $prevValue == 0 ? '0' : number_format( (($currentValue - $prevValue) / $prevValue) * 100, 2, ) . '%'; } $prevValue = $currentValue; @endphp{{ $change }} | @endforeach— |