{% extends'@admin/base.html.twig' %} {% block extra_scripts %} {% endblock %} {% block stylesheets %} {{ parent() }} {% endblock %} {% block subheader %}

FICHE CLIENT

{# — Avertissement si commandes/échanges en cours — #}
{% set hasCmd = (statistiques.cmdEnAttente > 0 or statistiques.cmdAccepte > 0) %} {% set hasEch = (statistiques.echangeEnAttente > 0) %} {% if hasCmd or hasEch %} {% endif %}
Modifier {# Action : Créer bon de commande (3 états client) #} {% if user.isBlocked %} {# ⛔ Blocage manuel : interdit #} {% elseif user.isBlacklisted %} {# ⚠️ Blocage auto : autorisé avec alerte #} Créer bon de commande {% else %} {# ✅ Client normal #} Créer bon de commande {% endif %} {# Menu Actions client #}
{% endblock %} {% block breadcrumb %}{% endblock %} {% block stat %}{% endblock %} {% block bodycontent %} {% if lastCommandeDate %} {% set colorClass = '' %} {% if daysSinceLastCommande > 360 %} {% set colorClass = 'text-danger' %} {% elseif daysSinceLastCommande > 180 %} {% set colorClass = 'text-warning' %} {% elseif daysSinceLastCommande > 90 %} {% set colorClass = 'text-info' %} {% elseif daysSinceLastCommande < 90 %} {% set colorClass = 'text-success' %} {% endif %} {% endif %}
{# Colonne gauche - Profil client et statistiques #}
{# 👤 Avatar icône selon civilité #}
{% if user.civility in ['Mme', 'Mlle'] %} {% else %} {% endif %}
{# 🧾 Infos personnelles #}
{{ user.civility }} {{ user.firstName }}
{{ user.username }}
{# Date de création #} {% if user.createdAt %}
Créé le {{ user.createdAt|date("d/m/Y à H:i") }}
{% endif %} {# Email #} {# Téléphones #}
{{ user.phone }} {% if user.secondPhone %} | {{ user.secondPhone }} {% endif %}
{# Adresse complète #}
{{ user.adress }}, {{ user.city }} - {{ user.region }}, {{ user.country }}
{# Type client + statut blocage #} {% if user.clientType is defined and user.clientType %}
{# --- Badge Type client (dynamique) --- #} {{ user.clientType.label }}
{{ user.isVerified ? 'Verifie' : 'Non verifie' }}
{# --- Badge Client bloqué (manuel) --- #} {% if user.isBlocked %} Client bloqué {% endif %}
{% endif %}
{# Champ caché utilisé par JavaScript #}
{% set currentTab = app.request.get('tab') %} {% if currentTab not in ['profile', 'promotion', 'content_documents', 'static', 'comments'] %} {% set currentTab = 'content_documents' %} {% endif %}
{% include '@admin/user/_tab/tab_infos_profile.html.twig' %} {#--Onglet infos profil--#}
{% include '@admin/user/_tab/tab_code_promotion.html.twig' %} {#--Onglet Code promotion--#}
{% include '@admin/user/_tab/tab_documents.html.twig' %}
{% include '@admin/user/_tab/tab_statistiques.html.twig' %} {#--Onglet statistiques--#}
{% include '@admin/user/_tab/tab_comments.html.twig' %} {#--Onglet commentaires--#}
{# MODAL : Gestion du blocage client #} {% include '@admin/user/_modal_client_block.html.twig' %} {% endblock %} {% block js %} {{ parent() }} {% endblock %}