@foreach ($row as $game_name => $game_data) @php $total_converted_bet = $total_converted_win = $total_converted_avg_bet = $total_converted_bonus = $total_converted_real_bonus = $total_converted_ggr = $total_players = $total_rounds = $total_rtp = 0; $partners = $skins = $game_categories = []; @endphp @foreach ($game_data as $row2) @php $converted_bet = convertAmountToEur($row2['total_bet'], $row2['currency_id'], $break_by ? $row2['session_start'] : $date_range); $converted_win = convertAmountToEur($row2['total_win'], $row2['currency_id'], $break_by ? $row2['session_start'] : $date_range); $converted_avg_bet = convertAmountToEur($row2['avg_bet'], $row2['currency_id'], $break_by ? $row2['session_start'] : $date_range); $converted_ggr = convertAmountToEur($row2['GGR'], $row2['currency_id'], $break_by ? $row2['session_start'] : $date_range); $converted_bonus = convertAmountToEur($row2['bonus_cost'], $row2['currency_id'], $break_by ? $row2['session_start'] : $date_range); if (Auth::user()->hasRole('SuperAdmin')) { $converted_real_bonus = convertAmountToEur($row2['bonus'], $row2['currency_id'], $break_by ? $row2['session_start'] : $date_range); $total_converted_real_bonus += filter_var(strip_tags($converted_real_bonus), FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION); } $total_converted_bet += filter_var(strip_tags($converted_bet), FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION); $total_converted_win += filter_var(strip_tags($converted_win), FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION); $total_converted_avg_bet += filter_var(strip_tags($converted_avg_bet), FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION); $total_converted_ggr += filter_var(strip_tags($converted_ggr), FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION); $total_converted_bonus += filter_var(strip_tags($converted_bonus), FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION); foreach ($row2['partner_count'] as $partner) { $partners[] = $partner; } foreach ($row2['skin_count'] as $skin) { $skins[] = $skin; } if (isset($row2['category_name_array'])) { foreach ($row2['category_name_array'] as $category) { $game_categories[] = $category; } } elseif (isset($row2['category_name'])) { $game_categories[] = $row2['category_name']; } $total_players += $row2['total_players']; $total_rounds += $row2['total_rounds']; $total_rtp += $row2['rtp']; @endphp @endforeach