{% extends 'base.html.twig' %} {% block title %}Historique des demandes{% endblock %} {% block body %}

Commandes

{# {% if is_granted('ROLE_ADMIN') %} {% endif %} #} {% for commande in commandes %} {% if commande.traiter == 0 %} {# #} {% endif %} {% endfor %}
N° Utilisateur Produits Date Note Action
{{ commande.id }} {{ commande.user.name }} {{commande.user.surname}} {% set countProduits = 0 %} {% for element in commande.demande.toArray %} {% set countProduits = countProduits + element.quantite %} {% endfor %} {{ countProduits }} {% set uniqueProduits = [] %} {% for element in commande.demande.toArray %} {% if element.produit not in uniqueProduits %} {% set uniqueProduits = uniqueProduits|merge([element.produit]) %} {% endif %} {% endfor %} {{ uniqueProduits|length }} {{ commande.createdAt|date('d-m-Y') }} {{ commande.details|slice(0, 50) }} {# #} {% if is_granted('ROLE_ADMIN') %} {% endif %}
{{ knp_pagination_render(commandes) }}
{% endblock %}