{% extends 'wfbo/_layout.html.twig' %} {% block title %}Mini Games Leaderboard — WFBO{% endblock %} {% block wfbo_title %}Mini Games Leaderboard{% endblock %} {% block wfbo_content %} {% set custom = period.period == 'custom' %} {% set baseParams = {game: game, sort: sort} %} {% set gameLabel = game == 'all' ? 'All mini games' : games[game] %} {% set rangeParams = custom ? {date_from: period.dateFrom, date_to: period.dateTo} : {period: period.period} %} {# ── Period filter ── #} {% set presets = [ {key: 'today', label: 'Today'}, {key: 'yesterday', label: 'Yesterday'}, {key: 'this_week', label: 'This Week'}, {key: 'last_week', label: 'Last Week'}, {key: 'this_month', label: 'This Month'}, {key: 'last_month', label: 'Last Month'}, ] %}
{% for p in presets %} {{ p.label }} {% endfor %}
{# ── Filters ── #}
{% if not custom %}{% endif %}
{# ── Info bar ── #}

{{ total }} player{{ total != 1 ? 's' : '' }} — {{ gameLabel }} — {{ period.label }} — ranked by {{ sortLabels[sort] }}

{# ── Table ── #}
{% if game == 'all' %}{% endif %} {% for row in rows %} {% set rank = offset + loop.index %} {% set medal = rank == 1 ? 'gold' : (rank == 2 ? 'silver' : (rank == 3 ? 'bronze' : 'plain')) %} {% if game == 'all' %} {% endif %} {% else %} {% endfor %}
# Player Master AgentTop GameBets Wins Win Rate Total Bet Total Winnings Biggest Win Net Profit
{{ rank }} {{ row.first_name }} {{ row.last_name }}
{{ row.mobile_number }}
{% if row.master_agent_id %} {{ row.master_agent_first_name }} {{ row.master_agent_last_name }} {% else %} — {% endif %} {{ row.top_game ?? '—' }} {% if row.games_played > 1 %}
{{ row.games_played }} games
{% endif %}
{{ row.bet_count }} {{ row.win_count }} {{ row.bet_count > 0 ? (row.win_count / row.bet_count * 100)|number_format(1) ~ '%' : '—' }} ₱{{ row.total_bet|number_format(2) }} ₱{{ row.total_payout|number_format(2) }} ₱{{ row.biggest_win|number_format(2) }} ₱{{ row.net_profit|number_format(2) }}
No {{ gameLabel }} players for {{ period.label }}.
{# ── Pagination ── #} {% if totalPages > 1 %} {% endif %} {% endblock %}