@extends('layouts.app', ['class' => 'g-sidenav-show bg-gray-100']) {{-- section content --}} @section('content') @include('layouts.navbars.auth.topnav', ['title' => ''])
Result {{ $title_menu }}

@if ($table_result)
@csrf @foreach ((array) $kategoriFilter as $kat) @endforeach {{-- NEW: apa saja kategori yang lagi “expanded” (JSON array of names) --}} {{-- NEW (opsional): mode export --}} {{-- visible/all dsb --}}
@csrf @foreach ((array) $kategoriFilter as $kat) @endforeach
@endif
@foreach ($bulanList as $bulan) @endforeach @php $kategoriIndex = 0; @endphp @foreach ($table_result as $row) @php $isJumlah = $row['kategori'] === 'Jumlah'; $hasSub = isset($row['subkategori']) && is_array($row['subkategori']) && count($row['subkategori']) > 0; $kategoriId = 'kategori_' . $kategoriIndex; @endphp @if (!$isJumlah) {{-- ROW KATEGORI --}} @foreach ($bulanList as $bulan) @endforeach {{-- ROW SUBKATEGORI --}} @if ($hasSub) @foreach ($row['subkategori'] as $sub) @foreach ($bulanList as $bulan) @endforeach @endforeach @endif @php $kategoriIndex++; @endphp @endif @endforeach @foreach ($bulanList as $bulan) @endforeach @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 @endforeach
No Kategori{{ $bulan }}Total
{{ $kategoriIndex + 1 }} + {{ $row['kategori'] }}Rp {{ number_format($row[$bulan], 0, ',', '.') }}Rp {{ number_format(array_sum(array_slice($row, 1, count($bulanList))), 0, ',', '.') }}
– {{ $sub['nama'] }}Rp {{ number_format($sub[$bulan], 0, ',', '.') }}Rp {{ number_format(array_sum(array_slice($sub, 1)), 0, ',', '.') }}
Jumlah Rp {{ number_format($table_result[count($table_result) - 1][$bulan], 0, ',', '.') }} @php $jumlahRow = end($table_result); $grandTotal = 0; foreach ($bulanList as $bulan) { $grandTotal += $jumlahRow[$bulan]; } @endphp Rp {{ number_format($grandTotal, 0, ',', '.') }}
Kenaikan / Penurunan (%) {{ $change }} —
@if (!$table_result) @endif
{{-- end card --}}
Grafik Batang {{ $title_menu }} Tahun {{ $tahun }}
{{-- check flag js on dmenu --}} @if ($jsmenu == '1') @if (view()->exists("js.{$dmenu}")) @push('addjs') {{-- file js in folder (resources/views/js) --}} @include('js.' . $dmenu); @endpush @else @push('addjs') @endpush @endif @endif @endsection @push('js') {{-- --}} {{-- --}} @endpush