2018-04-18 15:19:00 +02:00
|
|
|
{% extends 'base.html.twig' %}
|
|
|
|
{% trans_default_domain 'FOSUserBundle' %}
|
|
|
|
{% block body %}
|
|
|
|
<div id="wrapper">
|
|
|
|
<div id="container" class="container">
|
|
|
|
|
|
|
|
<div class="row">
|
|
|
|
<h1>Historique</h1>
|
|
|
|
</div>
|
2018-05-22 16:53:23 +02:00
|
|
|
<h2>Ventes de produits</h2>
|
2018-05-22 16:38:51 +02:00
|
|
|
<div id="chartContainer" style="display: inline-block; height: 300px; width: 49%;"></div>
|
|
|
|
<div id="chartContainerChiffreAffaire" style="display: inline-block; height: 300px; width: 49%;"></div>
|
2018-05-22 16:53:23 +02:00
|
|
|
<h2>Festivals</h2>
|
|
|
|
<div id="chartContainerstatisticsFestivals" style="display: inline-block; height: 300px; width: 100%;"></div>
|
2018-05-22 16:38:51 +02:00
|
|
|
|
2018-04-18 15:19:00 +02:00
|
|
|
<div class="row">
|
|
|
|
<div class="col-xs-6">
|
|
|
|
<div class="sells">
|
|
|
|
<h2>
|
2018-04-19 10:57:01 +02:00
|
|
|
<i class="fa fa-users"></i>
|
|
|
|
<div class="chiffre">
|
2018-04-18 15:19:00 +02:00
|
|
|
{{ recentSells |length }}
|
|
|
|
</div>
|
|
|
|
Clients
|
|
|
|
</h2>
|
|
|
|
<h2>
|
2018-04-19 10:57:01 +02:00
|
|
|
<i class="fa fa-euro"></i>
|
2018-04-18 15:19:00 +02:00
|
|
|
Chiffre d'affaires
|
2018-04-19 10:57:01 +02:00
|
|
|
<div class="chiffre">
|
2018-04-18 15:19:00 +02:00
|
|
|
{{ chiffreAffaires }} €
|
|
|
|
</div>
|
|
|
|
</h2>
|
|
|
|
<h2>
|
2018-04-19 10:57:01 +02:00
|
|
|
<i class="fa fa-shopping-cart"></i>
|
2018-04-18 15:19:00 +02:00
|
|
|
panier moyen
|
2018-04-19 10:57:01 +02:00
|
|
|
<div class="chiffre">
|
2018-04-19 15:53:29 +02:00
|
|
|
{{ chiffreAffaires / ((recentSells |length) or 1) }} €
|
2018-04-18 15:19:00 +02:00
|
|
|
</div>
|
|
|
|
</h2>
|
|
|
|
<div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="col-xs-6 text-right">
|
|
|
|
<a class="btn btn-success" href="{{ path('export_all') }}">
|
|
|
|
<i class="fa fa-file-o fa-3x"></i>
|
|
|
|
Exporter toutes vos données en format csv
|
|
|
|
</a>
|
2018-04-19 10:57:01 +02:00
|
|
|
<h2>
|
|
|
|
Dernières ventes
|
|
|
|
</h2>
|
|
|
|
<div class="table">
|
|
|
|
<div class="row">
|
|
|
|
<div class="col-xs-3">
|
|
|
|
date
|
|
|
|
</div>
|
|
|
|
<div class="col-xs-3">
|
|
|
|
commentaire
|
|
|
|
</div>
|
|
|
|
<div class="col-xs-3">
|
|
|
|
produits
|
|
|
|
</div>
|
|
|
|
<div class="col-xs-3">
|
|
|
|
montant
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
{% for vente in recentSells %}
|
|
|
|
|
|
|
|
<div class="row">
|
|
|
|
<div class="col-xs-3">
|
|
|
|
{{ vente.date |date('Y-m-d H:i:s') }}
|
|
|
|
</div>
|
|
|
|
<div class="col-xs-3">
|
|
|
|
{{ vente.comment }}
|
|
|
|
</div>
|
|
|
|
<div class="col-xs-3">
|
|
|
|
{{ vente.productsSold |length }}
|
|
|
|
</div>
|
|
|
|
<div class="col-xs-3">
|
|
|
|
{{ vente.amount }}
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
{% endfor %}
|
2018-04-18 15:19:00 +02:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
2018-05-22 16:38:51 +02:00
|
|
|
|
|
|
|
|
|
|
|
<script src="https://canvasjs.com/assets/script/canvasjs.min.js"></script>
|
|
|
|
<script>
|
|
|
|
|
|
|
|
var dataPoints = [
|
|
|
|
{% for pair in statisticsSoldProducts %}
|
|
|
|
{ label: "{{ pair.name }}", y: {{ pair.count }} },
|
|
|
|
{% endfor %}
|
|
|
|
];
|
|
|
|
var dataPointsChiffreAffaire = [
|
|
|
|
{% for pair in statisticsSoldProducts %}
|
|
|
|
{ label: "{{ pair.name }}", y: {{ pair.value }} },
|
|
|
|
{% endfor %}
|
2018-05-22 16:53:23 +02:00
|
|
|
];var dataPointsFestivals = [
|
|
|
|
{% for pair in statisticsFestivals %}
|
|
|
|
{ label: "{{ pair.name }}", y: {{ pair.chiffreAffaire }} , countClients : {{ pair.clients_count }}, date: "{{ pair.date |date('Y-m-d')}}" },
|
|
|
|
{% endfor %}
|
2018-05-22 16:38:51 +02:00
|
|
|
];
|
2018-05-22 16:53:23 +02:00
|
|
|
console.log(dataPointsFestivals);
|
|
|
|
var chartFestival = new CanvasJS.Chart("chartContainer", {
|
|
|
|
title:{
|
|
|
|
text: "Chiffre d'affaire par festival"
|
|
|
|
},
|
|
|
|
animationEnabled: true,
|
|
|
|
data: [
|
|
|
|
{
|
|
|
|
// Change type to "doughnut", "line", "splineArea", etc.
|
|
|
|
type: "bar",
|
|
|
|
dataPoints: dataPointsFestivals
|
|
|
|
}
|
|
|
|
]
|
|
|
|
});
|
|
|
|
chartFestival.render();
|
2018-05-22 16:38:51 +02:00
|
|
|
var chart = new CanvasJS.Chart("chartContainer", {
|
|
|
|
title:{
|
|
|
|
text: "Volume de produits vendus"
|
|
|
|
},
|
|
|
|
animationEnabled: true,
|
|
|
|
data: [
|
|
|
|
{
|
|
|
|
// Change type to "doughnut", "line", "splineArea", etc.
|
|
|
|
type: "pie",
|
|
|
|
dataPoints: dataPoints
|
|
|
|
}
|
|
|
|
]
|
|
|
|
});
|
|
|
|
chart.render();
|
|
|
|
var chartContainerChiffreAffaire = new CanvasJS.Chart("chartContainerChiffreAffaire", {
|
|
|
|
title:{
|
|
|
|
text: "Valeur en euros des produits vendus"
|
|
|
|
},
|
|
|
|
animationEnabled: true,
|
|
|
|
data: [
|
|
|
|
{
|
|
|
|
// Change type to "doughnut", "line", "splineArea", etc.
|
|
|
|
type: "pie",
|
|
|
|
dataPoints: dataPointsChiffreAffaire
|
|
|
|
}
|
|
|
|
]
|
|
|
|
});
|
|
|
|
chartContainerChiffreAffaire.render();
|
|
|
|
</script>
|
2018-04-18 15:19:00 +02:00
|
|
|
{% endblock %}
|