{% extends 'admin/layouts/base.html.twig' %} {% set active = 'app_admin_users' %} {% set actions = [ { 'link': path('app_admin_user_new'), 'title': 'Add New User'|trans, } ] %} {% set breadcrumbs = [ { 'link': path('app_admin_dashboard'), 'title': 'Home' }, { 'title': 'User Management', }, { 'link': path('app_admin_users'),'title': 'Users', } ]%} {% block title %}Users | {{ app_name }} {% endblock %} {% block stylesheets %} {% endblock %} {% block content %}
| ID | Last Login | Name | Role | Ticket Status | Current Sub | Duration Months | Purchased | Next Payment | Method | |||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| {{ user.id }} | {% if user.lastLogin is null %}N/A | {% else %}{{ user.lastLogin|date('Y-m-d H:i:s') }} | {% endif %}{{ user.firstname ? user.firstname : 'N/A' }} {{ user.lastname ? user.lastname : 'N/A' }} | {% if user.roles is not empty %} {% for role in user.rolesName %} {{ role }}{% if not loop.last %}, {% endif %} {% endfor %} {% else %} N/A {% endif %} | {% set totalOpenTicket = 0 %} {% set totalClosedTicket = 0 %} {% if user.getTickets is not empty %} {% for ticket in user.getTickets %} {% if ticket.status == "open" %} {% set totalOpenTicket = totalOpenTicket + 1 %} {% endif %} {% if ticket.status == "closed" %} {% set totalClosedTicket = totalClosedTicket + 1 %} {% endif %} {% endfor %} {% endif %}Open: {{ totalOpenTicket }} Closed: {{ totalClosedTicket }} | {% if user.subscriptions is not empty %} {% set productNames = [] %} {% for subscription in user.subscriptions %} {% if subscription.status|lower == 'active' %} {% set productNames = productNames|merge([subscription.getPaymentId.getOrderId.getProductId.name]) %} {% endif %} {% endfor %} {% if productNames is not empty %} {{ productNames|join(', ') }} {% else %} N/A {% endif %} {% else %} N/A {% endif %} | {% if user.subscriptions is not empty %} {% set durations = [] %} {% for subscription in user.subscriptions %} {% if subscription.status|lower == 'active' %} {% set durations = durations|merge([subscription.duration ~ ' Months']) %} {% endif %} {% endfor %} {% if durations is not empty %} {{ durations|join(', ') }} {% else %} N/A {% endif %} {% else %} N/A {% endif %} | {% if user.payments is not empty %} {% for payment in user.payments %} {{ payment.paymentdate ? payment.paymentdate|date('Y-m-d') : 'N/A' }} {% endfor %} {% else %} N/A {% endif %} | {% if user.payments is not empty %} {% for payment in user.payments %} {% set nextPaymentDate = 'N/A' %} {% set duration = 0 %} {% for subscription in user.subscriptions %} {% set duration = subscription.duration %} {% endfor %} {% if duration > 0 %} {% set nextPaymentDate = payment.paymentdate|date_modify('+' ~ duration ~ ' months')|date('Y-m-d') %} {% endif %} {{ nextPaymentDate }} {% endfor %} {% else %} N/A {% endif %} | {% if user.payments is not empty %} {% for payment in user.payments %} {{ payment.paymentmethod|upper }} {% endfor %} {% else %} N/A {% endif %} |