{% extends 'wfbo/_layout.html.twig' %} {% block title %}2D Draw {{ event.drawDate|date('M d, Y') }} — WFBO{% endblock %} {% block wfbo_title %}2D Draw · {{ event.drawDate|date('D, M d, Y') }}{% endblock %} {% block wfbo_content %} {% for flash in app.flashes('success') %} {% endfor %} {% for flash in app.flashes('error') %} {% endfor %}
← All draws {% include 'wfbo/live-draw/_status.html.twig' with {event: event, now: now} only %} Draw {{ event.drawAt|date('g:i A') }} · Betting closes {{ event.cutoffAt|date('g:i A') }}
{% set t = totals ?? {bets: 0, stake: 0, payout: 0, commission: 0, straightStake: 0, rambleStake: 0, winners: 0} %} {% set net = t.stake - t.payout - t.commission %}

Total Stake

₱{{ t.stake|number_format(2) }}

{{ t.bets }} bets · Straight ₱{{ t.straightStake|number_format(2) }} · Ramble ₱{{ t.rambleStake|number_format(2) }}

Payout

₱{{ t.payout|number_format(2) }}

{{ t.winners }} winning bets

Agent Commission

₱{{ t.commission|number_format(2) }}

Paid when bets were placed

Net

₱{{ net|number_format(2) }}

Stake − payout − commission

{% macro result_selects(event, range, prefix) %} {% for field in ['result1', 'result2'] %}
{% endfor %} {% endmacro %} {% import _self as ld %} {# ── Batch job running (settle / refund a cancelled draw / re-grade a correction) ── #} {% if batchMode %} {% set batch = { settle: {route: 'app_wfbo_live_draw_2d_draw_settle_batch', csrf: 'wfbo_live_draw_settle_', text: 'Settling 2D bets…'}, void: {route: 'app_wfbo_live_draw_2d_draw_void_batch', csrf: 'wfbo_live_draw_void_', text: 'Refunding 2D bets…'}, regrade: {route: 'app_wfbo_live_draw_2d_draw_regrade_batch', csrf: 'wfbo_live_draw_correct_', text: 'Re-grading 2D bets…'}, }[batchMode] %}
{{ batch.text }}
{% endif %} {# ── Result + settlement ── #}

Result

{% if event.void %}

Draw cancelled — every bet refunded and its commission taken back.

{% elseif event.settled %}

{{ '%02d-%02d'|format(event.result1, event.result2) }}

Settled {{ event.settledAt|date('M d, g:i A') }}{% if event.resultedBy %} · result by {{ event.resultedBy.firstName }} {{ event.resultedBy.lastName }}{% endif %}. {% if event.correctedFrom %}
Corrected from {{ event.correctedFrom }}.{% endif %}

{% elseif now < event.drawAt %}

The result can be declared after the draw at {{ event.drawAt|date('g:i A') }}.

{% else %}

Enter the two drawn numbers in order (first, second). You can change them until the draw is settled.

{{ ld.result_selects(event, resultRange, 'ld-input') }}
{% if event.resulted %}

Current result {{ '%02d-%02d'|format(event.result1, event.result2) }} · {{ pending }} pending bet(s)

{% if batchMode != 'settle' %} Settle Grades every bet against {{ '%02d-%02d'|format(event.result1, event.result2) }} and credits the winners. {% endif %} {% endif %} {% endif %}
{# ── Super admin: correct a settled result ── #} {% if event.settled and is_granted('ROLE_SUPER_ADMIN') and not batchMode %}

Correct the result

Use this only if the settled numbers were wrong. Every bet is re-graded: bets that now win are paid, and wins that no longer stand are taken back from the player's wallet (it may go negative).

{{ ld.result_selects(event, resultRange, 'ld-correct') }}
{% endif %} {# ── Super admin: cancel a draw that didn't happen ── #} {% if not event.settled and not event.void and is_granted('ROLE_SUPER_ADMIN') and not batchMode %}

Cancel this draw

If the draw can't happen, cancel it: betting stops, every bet is refunded to the player and the commission paid on it is taken back from the agents.

{% endif %} {# ── Bets ── #}

Bets{% if total > 0 %} ({{ total }}){% endif %}

{% if search or status %} Showing {{ bets|length }} of {{ total }}{% if status %} · {{ statusLabel }} bets{% endif %}{% if search %} · matching “{{ search }}”{% endif %} {% endif %}
{# Status filter: the counts follow the search, so they always match what the list can show. #} {% set statusPills = [ {key: null, label: 'All', count: statusCounts.total}, {key: 'pending', label: 'Pending', count: statusCounts.pending}, {key: 'won', label: 'Won', count: statusCounts.won}, {key: 'lost', label: 'Lose', count: statusCounts.lost}, {key: 'void', label: 'Void', count: statusCounts.void}, ] %}
{% for pill in statusPills %} {{ pill.label }} ({{ pill.count }}) {% endfor %}
{% if status %}{% endif %} {% if search %} Clear {% endif %}
{% for bet in bets %} {% else %} {% endfor %}
Placed Player Reference Type Numbers Amount Payout Status
{{ bet.createdAt|date('M d, g:i A') }} {{ bet.user.firstName }} {{ bet.user.lastName }}
{{ bet.user.mobileNumber }}
{{ bet.reference }} {{ bet.betTypeLabel }} {{ bet.numbersLabel }} ₱{{ bet.amount|number_format(2) }} {{ bet.payout is not null ? '₱' ~ bet.payout|number_format(2) : '—' }} {% set badgeClass = { won: 'badge-status badge-status--approved', lost: 'badge-status badge-status--lost', void: 'badge-status', }[bet.status] ?? 'badge-status badge-status--pending' %} {{ bet.statusLabel }}
{%- if search and status -%} No bets match “{{ search }}” with status “{{ statusLabel }}”. {%- elseif search -%} No bets match “{{ search }}”. {%- elseif status -%} No bets with status “{{ statusLabel }}” on this draw. {%- else -%} No bets on this draw. {%- endif -%}
{% set pagerParams = { id: event.id, search: search ?: null, status: status ?: null, settle: batchMode == 'settle' ? 1 : null, void: batchMode == 'void' ? 1 : null, regrade: batchMode == 'regrade' ? 1 : null, }|filter(v => v is not null and v != '') %} {% include 'wfbo/live-draw/_pager.html.twig' with {route: 'app_wfbo_live_draw_2d_draw', params: pagerParams, page: currentPage, maxPage: totalPages} only %} {% endblock %}