{% extends 'admin/base_admin.html.twig' %} {% block title %}Dashboard Admin{% endblock %} {% block content %} {# ══════════════════════════════════════════════════════════════════ HEADER ══════════════════════════════════════════════════════════════════ #} {# ══════════════════════════════════════════════════════════════════ STATISTIQUES PRINCIPALES ══════════════════════════════════════════════════════════════════ #}
💰
{{ stats.total_revenue|number_format(2, ',', ' ') }} €
Chiffre d'affaires total
📈
{{ stats.revenue_this_month|number_format(2, ',', ' ') }} €
Ce mois-ci
📦
{{ stats.total_commandes }}
Commandes totales
👥
{{ stats.total_users }}
Utilisateurs inscrits
{# ══════════════════════════════════════════════════════════════════ RÉPARTITION DES COMMANDES PAR STATUT ══════════════════════════════════════════════════════════════════ #}
📋 Répartition des commandes
{{ stats.commandes_by_status.pending }}
En attente
{{ stats.commandes_by_status.paid }}
Payées
{{ stats.commandes_by_status.processing }}
En cours
{{ stats.commandes_by_status.completed }}
Terminées
{{ stats.commandes_by_status.cancelled }}
Annulées
{# ══════════════════════════════════════════════════════════════════ DERNIÈRES COMMANDES ══════════════════════════════════════════════════════════════════ #}
{% if latestCommandes is empty %}
📦
Aucune commande

Il n'y a pas encore de commandes dans le système.

{% else %} {# ── Filtres ── #}
{# ── Table commandes ── #}
{% for commande in latestCommandes %} {% endfor %}
Référence Client Date Pack Bénéficiaires Montant TTC Statut Actions
{{ commande.reference }} {% if commande.isPaid %} {% endif %} {% if commande.user is not null %} {{ commande.clientNom }} {% else %}
{{ commande.clientNom }}
{% endif %} {{ commande.clientEmail }}
{{ commande.createdAt|date('d/m/Y') }}
{{ commande.createdAt|date('H:i') }}
Pack {{ commande.packType|capitalize }} {% if commande.beneficiaires|length > 0 %} {% for b in commande.beneficiaires %}
{{ b.prenom|slice(0,1)|upper }}{{ b.nom|slice(0,1)|upper }}
{{ b.prenom }} {{ b.nom }} {% if not b.isActive %} {% endif %}
{% endfor %} {% else %} {% endif %}
{{ commande.totalTTC|number_format(2, ',', ' ') }} € {{ commande.statusLabel }} Détail →
{% endif %}
{# ══════════════════════════════════════════════════════════════════ RECOMMANDATIONS ══════════════════════════════════════════════════════════════════ #}
🤝 Recommandations {% if stats.new_recommendations > 0 %} {{ stats.new_recommendations }} {% endif %} Voir tout
{% if stats.new_recommendations == 0 %}

Aucune nouvelle recommandation.

{% else %}

{{ stats.new_recommendations }} nouvelle{{ stats.new_recommendations > 1 ? 's' : '' }} recommandation{{ stats.new_recommendations > 1 ? 's' : '' }} à traiter.

📋 Traiter les recommandations {% endif %}
{# ══════════════════════════════════════════════════════════════════ NOTIFICATIONS PUSH ══════════════════════════════════════════════════════════════════ #}
🔔 Notifications Push Gérer

Envoyez des notifications aux utilisateurs qui ont installé les cartes PWA sur leur téléphone.

📤 Envoyer une notification 📢 Notifier tout le monde
{# ══════════════════════════════════════════════════════════════════ DEMANDES RGPD ══════════════════════════════════════════════════════════════════ #}
🔒 Demandes RGPD {% if rgpdPending|length > 0 %} {{ rgpdPending|length }} en attente {% endif %} Gérer
{# Compteurs synthétiques #}
{{ rgpdPending|length }}
En attente
{{ rgpdProcessedCount }}
Traitées
{{ rgpdRefusedCount }}
Refusées
{% if rgpdPending is empty %}

✅ Aucune demande en attente de traitement.

{% else %}
{% for demande in rgpdPending %} {% set jours = demande.deadlineAt ? (((demande.deadlineAt|date('U') - 'now'|date('U')) / 86400)|round(0, 'ceil')) : null %} {% endfor %}
# Type Demandeur Reçue le Échéance
#{{ demande.id }} {{ demande.typeLabel }}
{{ demande.nomDemandeur ?? '—' }}
{{ demande.emailDemandeur ?? '' }}
{{ demande.requestedAt|date('d/m/Y') }} {% if jours is not null %} {% if jours <= 0 %}⛔ Dépassé {% elseif jours <= 3 %}🔴 J-{{ jours }} {% elseif jours <= 7 %}🟡 J-{{ jours }} {% else %}🟢 {{ demande.deadlineAt|date('d/m/Y') }} {% endif %} {% else %} {% endif %} Traiter →
{% endif %}
{# ══════════════════════════════════════════════════════════════════ DERNIERS UTILISATEURS ══════════════════════════════════════════════════════════════════ #}
👤 Derniers inscrits Voir tout
{% if latestUsers is empty %}

Aucun utilisateur pour le moment.

{% else %}
{% for user in latestUsers %} {% endfor %}
Utilisateur Email Inscription Vérifié
{{ user.email }} {{ user.createdAt|date('d/m/Y') }} {% if user.isVerified %} {% else %} {% endif %} Voir →
{% endif %}
{# ══════════════════════════════════════════════════════════════════ JAVASCRIPT ══════════════════════════════════════════════════════════════════ #} {# ══════════════════════════════════════════════════════════════════ CSS ══════════════════════════════════════════════════════════════════ #} {% endblock %}