src/Flexy/FrontBundle/Themes/Lasalle/templates/admin/statistics/admin/_content.html.twig line 260
<turbo-frame id="render-stats" data-turbo-action="advance" >
{% if store is not defined %}
{% set store = null %}
{% endif %}
{% if year is not defined or app.request.get('year') == "0" %}
{% set year = null %}
{% endif %}
{% if month is not defined or app.request.get('month') == "0" %}
{% set month = null %}
{% endif %}
<div class="row header" >
<div class="col-4" >
<h2 style="font-weight:bold;font-size:16px;" class="title"><i class="fa-solid fa-chart-pie"></i> {{"Dashboard"|trans}} {{settings.get.projectName}}
<br>
{% if store != null %}
<span class="badge badge-info p-1" ><i class="fa-solid fa-shop"></i> {{"Store"|trans}} : {{store}}</span>
{% endif %}
{% if year != null or month != null %}
<span class="badge badge-info p-1" >
<i class="fa-solid fa-filter-circle-dollar"></i>
{{"Result for priod"|trans}} :
{% if year != null %}
{{year}}
{% endif %}
{% if month != null %}
{{ ("2000-"~month)|date('F')|trans }}</span>
{% endif %}
{% endif %}
</h2>
</div>
<div class="col-8" >
<form action="{{path('admin_stats')}}" method="POST">
<div class="row">
<div class="col-2" >
<button id="btn-filter-stats" class="d-none btn btn-success d-block btn-large" >Filtrer</button>
</div>
<div class="col-4" >
{% if stores|length > 1 %}
<select id="store-select" class="form-select" name="store" aria-label="Default select example">
<option value="0" selected>{{"All stores"|trans}}</option>
{% for singleStore in stores %}
<option {% if singleStore == store %}selected{% endif %} value="{{singleStore.id}}">
{{singleStore.name}}
</option>
{% endfor %}
</select>
{% endif %}
</div>
<div class="col-3" >
<select id="year-select" class="form-select" name="year" aria-label="Default select example">
<option value="0">{{"All years"|trans}}</option>
{% for singleYear in shopStatisticProvider.periodsOrdersOptions(store)|sort((a, b) => a.year < b.year ? 1 : -1) %}
<option {% if singleYear["year"] == year %}selected{% endif %} value="{{singleYear["year"]}}">
{{singleYear["year"]}}
</option>
{% endfor %}
</select>
</div>
<div class="col-3" >
<select id="months-select" class="form-select" name="month" aria-label="Default select example">
<option value="0">{{"All months"|trans}}</option>
{% for singleYear in shopStatisticProvider.periodsOrdersOptions(store) %}
{% for singleMonth in singleYear["months"]|sort((a, b) => a.number < b.number ? 1 : -1) %}
{% if singleYear["year"] == year %}
<option {% if singleMonth["number"] == month %}selected{% endif %} value="{{singleMonth["number"]}}">
{{singleMonth["name"]}}
</option>
{% endif %}
{% endfor %}
{% endfor %}
</select>
</div>
</div>
</form>
</div>
</div>
<div class="row" >
<div class="col-12 col-md-5 p-4" >
<div class="row" >
<div class="col-4">
<div class="card p-3 mb-2 bg-purple-dark text-white">
<h6 class="text-white stats-title"><i class="fa-solid fa-comment-dollar"></i> {{"Today"|trans}}</h6>
<b>{{shopStatisticProvider.getRevenue(store,year,month)["today"]|number_format(0,",","")}} {{settings.get.currency|trans}}</b>
</div>
</div>
<div class="col-4">
<div class="card p-3 mb-2 bg-blue-dark text-white">
<h6 class="text-white stats-title"><i class="fa-solid fa-comment-dollar"></i> {{"Yesterday"|trans}}</h6>
<b>{{shopStatisticProvider.getRevenue(store,year,month)["yesterday"]|number_format(0,",","")}} {{settings.get.currency|trans}}</b>
</div>
</div>
<div class="col-4">
<div class="card p-3 mb-2 bg-orange-dark text-white">
<h6 class="text-white stats-title"><i class="fa-solid fa-comment-dollar"></i> Mois {{ "now"|date("F") }}</h6>
<b>{{shopStatisticProvider.getRevenue(store,year,month)["current_month"]|number_format(0,",","")}} {{settings.get.currency|trans}}</b>
</div>
</div>
<!--<div class="col-4">
<div class="card p-3 mb-2 bg-orange-dark text-white">
<h6 class="text-white stats-title"><i class="fa-solid fa-comment-dollar"></i> {{"Average"|trans}}</h6>
<b>{{shopStatisticProvider.getAverageRevenuePerDay("day")|number_format(0,",","")}} {{settings.get.currency|trans}}</b>
</div>
</div>-->
<div class="col-12 mb-2">
<div class="card p-3">
{#{{ render_chart(shopStatisticProvider.chartRevenue(store,year,month)) }}#}
<div class="col-12 col-md-12 " >
<div class="card p-3" >
<h6>Chiffre d'affaire par type d'abonnement</h6>
<table class="table">
<thead class="bg-purple-dark text-white">
<tr>
<th scope="col">{{"Product"|trans}}</th>
<th scope="col">{{"Nombres \n des ventes"|trans}}</th>
<th scope="col">{{"Revenue"|trans}}</th>
</tr>
</thead>
<tbody>
{% for singleProductRevenu in shopStatisticProvider.revenueByProducts(store,year,month) %}
<tr>
<td>{{singleProductRevenu.productName}}</td>
<td>{{singleProductRevenu.totalSold}}</td>
<td>
<span >
<b>
{{singleProductRevenu.revenue}} {{settings.get.currency|trans}}
</b>
</span></td>
</tr>
{% endfor %}
</tbody>
</table>
{# {% set revenueProductUrl = ea_url().setDashboard("App\\Controller\\Admin\\DashboardController").setController("App\\Flexy\\FrontBundle\\Themes\\Lasalle\\Controller\\ShopAdmin\\Product\\ProductRevenueCrudController").setAction("index") %}
<a class="btn-btn-info" href="{{revenueProductUrl}}" data-turbo="false" >Voir plus</a>#}
</div>
</div>
</div>
</div>
</div>
</div>
<div class="col-12 col-md-7 p-4" >
<div class="row quick-stats">
{% for key, singleStat in shopStatisticProvider.quickStats(store,year,month) %}
<div class="col-lg-4 col-6 mb-3">
<div class="card p-3 bg-purple-dark text-white" >
<div class="row">
<div class="col-lg-3 col-12" >
<div class="icon-container text-purple">
{{singleStat["icon"]|raw}}
</div>
</div>
<div class="col-9" >
<div>
<h6 class="stats-title text-white"><span>{{singleStat["all"]}} {{singleStat["unit"]|trans}}</span> <br>{{key|trans}}</h6>
</div>
</div>
<div class="col-12" >
<ul class="list-unstyled text-center mt-2">
<li><b>{{singleStat["new"]|number_format(0,",","")}} {{singleStat["unit"]|trans}}</b> {{"last week"|trans}}</li>
<li><b>{{singleStat["old"]|number_format(0,",","")}} {{singleStat["unit"]|trans}}</b> {{"last month"|trans}}</li>
</ul>
</div>
</div>
</div>
</div>
{% endfor %}
</div>
</div>
</div>
<div class="row" >
<div class="col-12" >
<h5>Visite AdhΓ©rant </h5>
</div>
<div class="col-lg-9 col-md-9 col-sx-9">
{{ render_chart(shopStatisticProvider.chartVisteBymonths(store,year,month)) }}
</div>
<div class="col-lg-3 col-md-3 col-sx-3">
<div class="card p-3 mb-2 bg-purple-dark text-white">
<h6 class="text-white stats-title"><i class="fa-solid fa-people-group"></i> Visites {{"Yesterday"|trans}}</h6>
<b>Pointage Manuel {{shopStatisticProvider.getVisitYesterday(store,year,month)[0]["manuel"] }}<div style="float:right"><span style="font-size:16px;">π©π» </span>{{shopStatisticProvider.getVisitYesterday(store,year,month)[0]["female_manuel"]}} | <span style="font-size:16px;">π¨π»</span> {{shopStatisticProvider.getVisitYesterday(store,year,month)[0]["male_manuel"]}}</div></b>
<b>Pointage Carte {{shopStatisticProvider.getVisitYesterday(store,year,month)[0]["automatique"] }}<div style="float:right"><span style="font-size:16px;">π©π» </span> {{shopStatisticProvider.getVisitYesterday(store,year,month)[0]["female_automatique"]}} | <span style="font-size:16px;">π¨π»</span> {{shopStatisticProvider.getVisitYesterday(store,year,month)[0]["male_automatique"]}} </div></b>
</div>
<div class="card p-3 mb-2 bg-blue-dark text-white">
<h6 class="text-white stats-title"><i class="fa-solid fa-people-group"></i> Visites {{"Today"|trans}} </h6>
<b>Pointage Manuel {{shopStatisticProvider.getVisitToday(store,year,month)[0]["manuel"] }}<div style="float:right"><span style="font-size:16px;">π©π» </span>{{shopStatisticProvider.getVisitToday(store,year,month)[0]["female_manuel"]}} | <span style="font-size:16px;">π¨π»</span> {{shopStatisticProvider.getVisitToday(store,year,month)[0]["male_manuel"]}}</div></b>
<b>Pointage Carte {{shopStatisticProvider.getVisitToday(store,year,month)[0]["automatique"] }}<div style="float:right"><span style="font-size:16px;">π©π» </span> {{shopStatisticProvider.getVisitToday(store,year,month)[0]["female_automatique"]}} | <span style="font-size:16px;">π¨π»</span> {{shopStatisticProvider.getVisitToday(store,year,month)[0]["male_automatique"]}}</div></b>
</div>
</div>
</div>
<div class="row mt-5" >
{# <div class="col-12" >
<h4>Stats chiffre d'affaire</h4>
</div> #}
{# <div class="col-12 col-md-4" >
<div class="card p-3" >
{{ render_chart(shopStatisticProvider.chartRevenueByParentCategories(store,year,month)) }}
</div>
</div> #}
{#
<div class="col-12 col-md-4 d-none" >
<div class="card p-3" >
<h6>Chiffre d'affaire par type d'abonnement</h6>
<table class="table">
<thead class="bg-purple-dark text-white">
<tr>
<th scope="col">{{"Product"|trans}}</th>
<th scope="col">{{"Revenue"|trans}}</th>
</tr>
</thead>
<tbody>
{% for singleProductRevenu in shopStatisticProvider.revenueByProducts(store,year,month) %}
<tr>
<td>{{singleProductRevenu[0]}}</td>
<td><span >
<b>
{{singleProductRevenu.revenue}} {{settings.get.currency|trans}}
</b>
</span></td>
</tr>
{% endfor %}
</tbody>
</table>
{% set revenueProductUrl = ea_url().setDashboard("App\\Controller\\Admin\\DashboardController").setController("App\\Flexy\\FrontBundle\\Themes\\Lasalle\\Controller\\ShopAdmin\\Product\\ProductRevenueCrudController").setAction("index") %}
<a class="btn-btn-info" href="{{revenueProductUrl}}" data-turbo="false" >Voir plus</a>
</div>
</div>
#}
<div class="col-12 col-md-8" >
<div class="card p-3" >
<h6>Chiffre d'affaire par commercial</h6>
<table class="table">
<thead class="bg-purple-dark text-white">
<tr>
<th scope="col">{{"Agent"|trans}} </th>
<th scope="col">{{"Revenue"|trans}}</th>
</tr>
</thead>
<tbody>
{% for singleAgentRevenu in shopStatisticProvider.revenueByAgents(store,year,month) %}
<tr>
<td>{{singleAgentRevenu.agentFirstName}} {{singleAgentRevenu.agentLastName}}</td>
<td>
<span >
<b>
{{singleAgentRevenu.revenue}} {{settings.get.currency|trans}}
</b>
</span>
</td>
</tr>
{% endfor %}
</tbody>
</table>
{% set revenueCategoryUrl = ea_url().setDashboard("App\\Controller\\Admin\\DashboardController").setController("App\\Flexy\\FrontBundle\\Themes\\Lasalle\\Controller\\ShopAdmin\\Product\\CategoryProductRevenueCrudController").setAction("index") %}
<!--<a class="btn-btn-info" href="{{revenueCategoryUrl}}" data-turbo="false" >Voir plus</a>-->
</div>
</div>
</div>
<script>
document.addEventListener("turbo:load",function(){
$("#store-select,#year-select,#months-select").change(function(){
$("#btn-filter-stats").trigger("click");
});
$("#year-select").change(function(){
$("#months-select").val(0).change();
$("#btn-filter-stats").trigger("click");
});
});
</script>
</turbo-frame>