@if ($break_by) @endif @php $bet_total = $win_total = $avg_bet_total = $real_bonus_cost_total = $bonus_cost_total = $ggr_total = $rake_total = $bonus_win_total = 0; if ($break_by) { $all = $subtotals->groupBy(['break_by', 'game_name'])->toArray(); } else { $all = $subtotals->groupBy('game_name')->toArray(); } @endphp @foreach ($all as $row) @if ($break_by) @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 = $total_converted_bonus_win = 0; $partners = $skins = $game_categories = []; @endphp @foreach ($row as $game_name => $game_data) @foreach ($game_data as $row2) @php $converted_bet = convertAmountToEur($row2['total_bet'], $row2['currency_id'], $row2['session_start']); $converted_win = convertAmountToEur($row2['total_win'], $row2['currency_id'], $row2['session_start']); $converted_avg_bet = convertAmountToEur($row2['avg_bet'], $row2['currency_id'], $row2['session_start']); $converted_ggr = convertAmountToEur($row2['GGR'], $row2['currency_id'], $row2['session_start']); $converted_bonus = convertAmountToEur($row2['bonus_cost'], $row2['currency_id'], $row2['session_start']); $converted_bonus_win = convertAmountToEur($row2['bonus_win'], $row2['currency_id'], $row2['session_start']); $converted_real_bonus = convertAmountToEur($row2['bonus'], $row2['currency_id'], $row2['session_start']); $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); $total_converted_bonus_win += filter_var(strip_tags($converted_bonus_win), 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 @endforeach @else @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 = $total_converted_bonus_win = 0; $partners = $skins = $game_categories = []; @endphp @foreach ($row as $row2) @php $converted_bet = convertAmountToEur($row2['total_bet'], $row2['currency_id'], $date_range, false); $converted_win = convertAmountToEur($row2['total_win'], $row2['currency_id'], $date_range, false); $converted_avg_bet = convertAmountToEur($row2['avg_bet'], $row2['currency_id'], $date_range, false); $converted_ggr = convertAmountToEur($row2['GGR'], $row2['currency_id'], $date_range, false); $converted_bonus = convertAmountToEur($row2['bonus_cost'], $row2['currency_id'], $date_range, false); $converted_bonus_win = convertAmountToEur($row2['bonus_win'], $row2['currency_id'], $date_range, false); $converted_real_bonus = convertAmountToEur($row2['bonus'], $row2['currency_id'], $date_range, false); $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); $total_converted_bonus_win += filter_var(strip_tags($converted_bonus_win), 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 @endif @php $bet_total += $total_converted_bet; $win_total += $total_converted_win; $avg_bet_total += $total_converted_avg_bet; $bonus_cost_total += $total_converted_bonus; $real_bonus_cost_total += $total_converted_real_bonus; $bonus_win_total += $total_converted_bonus_win; $ggr_total += $total_converted_ggr; @endphp @endforeach @if ($break_by) @endif
{{ __('Game name') }} {{ __('Partner Name') }} {{ __('Skin') }} {{ __('Provider') }} {{ __('Slot') }} {{ __('Device') }} {{ __('Total players') }} {{ __('Rounds') }} {{ __('Bet') }} {{ __('Win') }} {{ __('Avg Bet') }} {{ __('Bonus BET') }} {{ __('Bonus WIN') }} {{ __('Bonus Cost') }} {{ __('GGR') }} {{ __('RTP') }} {{ __('Category') }} {{ strtoupper($break_by) }}
{{ $game_name }} @if (count(array_unique($partners)) > 0) @php $partners_count = count(array_unique($partners)); @endphp {{ $partners_count <= 1 ? $partners[0] : $partners_count . ' Partners' }} @else {{ '' }} @endif @if (count(array_unique($skins)) > 0) @php $skins_count = count(array_unique($skins)); @endphp {{ $skins_count <= 1 ? $skins[0] : $skins_count . ' Skins' }} @else {{ '' }} @endif {{ $game_data[0]['provider_name'] }} @if ($game_data[0]['is_slot'] == 1)

{{-- --}} @endif
{{ $game_data[0]['device'] }} {{ $total_players }} {{ $total_rounds }} €{{ $total_converted_bet != 0 ? number_format($total_converted_bet, 2, '.', '') : $total_converted_bet }} €{{ $total_converted_win != 0 ? number_format($total_converted_win, 2, '.', '') : $total_converted_win }} €{{ $total_converted_avg_bet != 0 ? number_format($total_converted_avg_bet, 2, '.', '') : $total_converted_avg_bet }} €{{ $total_converted_real_bonus != 0 ? number_format($total_converted_real_bonus, 2, '.', '') : $total_converted_real_bonus }} €{{ $total_converted_bonus_win != 0 ? number_format($total_converted_bonus_win, 2, '.', '') : $total_converted_bonus_win }} €{{ $total_converted_bonus != 0 ? number_format($total_converted_bonus, 2, '.', '') : $total_converted_bonus }} €{{ $total_converted_ggr != 0 ? number_format($total_converted_ggr, 2, '.', '') : $total_converted_ggr }} {{ $total_rtp }} @if (count(array_unique($game_categories)) > 0) @php $game_categories_count = count(array_unique($game_categories)); @endphp {{ $game_categories_count <= 1 ? $game_categories[0] : $game_categories_count . ' Categories' }} @else {{ '' }} @endif {{ $game_data[0]['break_by'] }}
{{ $row[0]['game_name'] }} @if (count(array_unique($partners)) > 0) @php $partners_count = count(array_unique($partners)); @endphp {{ $partners_count <= 1 ? $partners[0] : $partners_count . ' Partners' }} @else {{ '' }} @endif @if (count(array_unique($skins)) > 0) @php $skins_count = count(array_unique($skins)); @endphp {{ $skins_count <= 1 ? $skins[0] : $skins_count . ' Skins' }} @else {{ '' }} @endif {{ $row[0]['provider_name'] }} @if ($row[0]['is_slot'] == 1)

@endif
{{ $row[0]['device'] }} {{ $total_players }} {{ $total_rounds }} €{{ $total_converted_bet != 0 ? number_format($total_converted_bet, 2, '.', '') : $total_converted_bet }} €{{ $total_converted_win != 0 ? number_format($total_converted_win, 2, '.', '') : $total_converted_win }} €{{ $total_converted_avg_bet != 0 ? number_format($total_converted_avg_bet, 2, '.', '') : $total_converted_avg_bet }} €{{ $total_converted_real_bonus != 0 ? number_format($total_converted_real_bonus, 2, '.', '') : $total_converted_real_bonus }} €{{ $total_converted_bonus_win != 0 ? number_format($total_converted_bonus_win, 2, '.', '') : $total_converted_bonus_win }} €{{ $total_converted_bonus != 0 ? number_format($total_converted_bonus, 2, '.', '') : $total_converted_bonus }} €{{ $total_converted_ggr != 0 ? number_format($total_converted_ggr, 2, '.', '') : $total_converted_ggr }} {{ $total_rtp }} @if (count(array_unique($game_categories)) > 0) @php $game_categories_count = count(array_unique($game_categories)); @endphp {{ $game_categories_count <= 1 ? $game_categories[0] : $game_categories_count . ' Categories' }} @else {{ '' }} @endif
@lang('Subtotal (:currency)', ['currency' => 'EUR']) {{ $subtotals->sum('total_players') }} {{ $subtotals->sum('total_rounds') }} €{{ $bet_total }} €{{ $win_total }} €{{ $avg_bet_total == 0 ? '0' : ($avg_bet_total / count($subtotals->whereNotNull('avg_bet')) >= 0 ? $avg_bet_total / count($subtotals->whereNotNull('avg_bet')) : '0') }} €{{ $real_bonus_cost_total }} €{{ $bonus_win_total }} €{{ $bonus_cost_total }} €{{ $ggr_total }}