diff --git a/resources/views/form/rapport-team4/1774506455-f48ce0eb-680e-4855-b4fd-4472099dfcd9.blade.php b/resources/views/form/rapport-team4/1774506455-f48ce0eb-680e-4855-b4fd-4472099dfcd9.blade.php
index 2e597f63..41234132 100644
--- a/resources/views/form/rapport-team4/1774506455-f48ce0eb-680e-4855-b4fd-4472099dfcd9.blade.php
+++ b/resources/views/form/rapport-team4/1774506455-f48ce0eb-680e-4855-b4fd-4472099dfcd9.blade.php
@@ -23,8 +23,7 @@
@endif
"; + print_r($submissions); + echo ""; */ + + $brands = [ + 'montair_lc_adult', + 'montair_lc_kid', + 'erdostyne', + 'nicogum_2_and_4', + 'furamist_range', + 'levolinplus_range' +]; + +$brandTotals = []; + +foreach ($brands as $brand) { + + $totalRx = 0; + + foreach ($submissions as $submission) { + + if ( + isset($submission->formdata) && + isset($submission->formdata->record_date) && + $submission->formdata->record_date == date('Y-m-d') + ) { + + $totalRx += (int)($submission->formdata->$brand ?? 0); + } + } + + $brandTotals[$brand] = $totalRx; +} + + + + + @endphp +