{% extends 'wfbo/_layout.html.twig' %} {% block title %}Users — WFBO{% endblock %} {% block wfbo_title %}Users{% endblock %} {% block wfbo_content %} {# Flash messages #} {% for flash in app.flashes('success') %}
{{ total }} user{{ total != 1 ? 's' : '' }}{% if search %} matching "{{ search }}"{% endif %}{% if role %} filtered by {{ role == 'ROLE_USER' ? 'User' : role == 'ROLE_SUPER_ADMIN' ? 'SADMIN' : role|replace({'ROLE_': '', '_': ' '})|title }}{% endif %}{% if not search and not role %} total{% endif %}
| # | Name | Mobile | Roles | Agent | Status | PLR% | Wallet | Registered | Last Login | Actions |
|---|---|---|---|---|---|---|---|---|---|---|
| {{ user.id }} | {# Name #}{{ user.firstName }} {{ user.lastName }} | {# Mobile #}{{ user.mobileNumber }} | {# Roles #} {% set isPlainUser = 'ROLE_MASTER_AGENT' not in user.roles and 'ROLE_AGENT' not in user.roles and 'ROLE_ADMIN' not in user.roles and 'ROLE_SUPER_ADMIN' not in user.roles and 'ROLE_FINANCE' not in user.roles and 'ROLE_OPERATIONS' not in user.roles %}
{% for role in user.roles %}
{% if role != 'ROLE_USER' %}
{% if role == 'ROLE_ADMIN' or role == 'ROLE_SUPER_ADMIN' %}Admin{% elseif role == 'ROLE_MASTER_AGENT' %}Master Agent{% elseif role == 'ROLE_AGENT' %}Agent{% elseif role == 'ROLE_FINANCE' %}Finance{% elseif role == 'ROLE_OPERATIONS' %}Operations{% else %}{{ role }}{% endif %}
{% endif %}
{% endfor %}
{% if isPlainUser %}
User
{% endif %}
{% if user.isOnHold %}
On Hold
{% endif %}
{% if user.isTestAccount %}
Test Account
{% endif %}
|
{# Agent #}
{% if isPlainUser %} {% if user.referredBy %} {{ user.referredBy.firstName }} {{ user.referredBy.lastName }} {% else %} — {% endif %} {% else %} — {% endif %} | {# Status #}{% if user.isSuspended %} Suspended {% else %} Active {% endif %} | {# PLR % #}{% if user.houseWinRate is not null %} {{ user.houseWinRate }}% {% else %} — {% endif %} | {# Wallet #}₱{{ user.walletBalance|number_format(2) }} | {# Registered #}{{ user.createdAt ? user.createdAt|date('M d, Y') : '—'|raw }} | {# Last Login #}{{ user.lastLoginAt ? user.lastLoginAt|date('M d, Y') : '—'|raw }} | {# Actions #}
{# Hidden forms — triggered by dropdown items #}
{% if is_granted('ROLE_ADMIN') %}
{% if 'ROLE_ADMIN' not in user.roles and 'ROLE_SUPER_ADMIN' not in user.roles %}
{% else %}
{% endif %}
{% if 'ROLE_FINANCE' not in user.roles %}
{% else %}
{% endif %}
{% if 'ROLE_OPERATIONS' not in user.roles %}
{% else %}
{% endif %}
{% endif %}
{% set isAnyAgent = 'ROLE_MASTER_AGENT' in user.roles or 'ROLE_AGENT' in user.roles or 'ROLE_SUB_AGENT' in user.roles %}
{% if is_granted('ROLE_SUPER_ADMIN') %}
{% if isAnyAgent and is_granted('ROLE_SUPER_ADMIN') %}
{% endif %}
{% endif %}
{# Dropdown trigger #}
|
| No users found. | ||||||||||
Page {{ currentPage }} of {{ totalPages }}