Month Wise Blood Bank‐ Code Wise No of Team of different Blood Bank work with Association during financial Year : {{ str_replace('-', ' - ', $data['report_financial_year']) }}
@php
// ✅ STEP 1: Extract ALL UNIQUE BB codes dynamically
$bbCodes = [];
foreach ($data['list'] as $monthData) {
foreach ($monthData['MonthWisedata'] as $bb => $val) {
if (!empty($bb)) { // ❌ skip empty key
$bbCodes[$bb] = $bb;
}
}
}
ksort($bbCodes); // optional sorting
// ✅ Initialize totals
$grandTotals = [];
foreach ($bbCodes as $bb) {
$grandTotals[$bb] = 0;
}
$grandTotalAll = 0;
@endphp
| Month |
@foreach ($bbCodes as $bb)
{{ $bb }}
|
@endforeach
Tot Camp Dt |
@foreach ($data['list'] as $month => $monthData)
@php $rowTotal = 0; @endphp
| {{ date('M-Y', strtotime($monthData['MonthName'])) }} |
@foreach ($bbCodes as $bb)
@php
$value = $monthData['MonthWisedata'][$bb] ?? 0;
$rowTotal += $value;
$grandTotals[$bb] += $value;
$grandTotalAll += $value;
@endphp
{{ $value }} |
@endforeach
{{ $rowTotal }} |
@endforeach
| Grand Total |
@foreach ($bbCodes as $bb)
{{ $grandTotals[$bb] }} |
@endforeach
{{ $grandTotalAll }} |