stat cadoles
This commit is contained in:
@@ -56,6 +56,7 @@ class StatController extends AbstractController
|
|||||||
"id"=>$id,
|
"id"=>$id,
|
||||||
"name"=>$name,
|
"name"=>$name,
|
||||||
"services"=>$tbservices,
|
"services"=>$tbservices,
|
||||||
|
"natures"=>$tbnatures,
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -77,6 +78,26 @@ class StatController extends AbstractController
|
|||||||
->getQuery()->getResult();
|
->getQuery()->getResult();
|
||||||
$totalmonth=($events[0]["somme"]?$events[0]["somme"]:0);
|
$totalmonth=($events[0]["somme"]?$events[0]["somme"]:0);
|
||||||
|
|
||||||
|
foreach($month["natures"] as $keynature => $nature) {
|
||||||
|
$events = $em
|
||||||
|
->createQueryBuilder('event')
|
||||||
|
->select('SUM(event.duration) as somme')
|
||||||
|
->from('App:Task','task')
|
||||||
|
->from('App:Event','event')
|
||||||
|
->andWhere('task.nature=:nature')
|
||||||
|
->andWhere('event.task=task')
|
||||||
|
->andWhere('event.start >=:start')
|
||||||
|
->andWhere('event.end <:end')
|
||||||
|
->setParameter('nature',$nature["id"])
|
||||||
|
->setParameter('start',$start)
|
||||||
|
->setParameter('end',$end)
|
||||||
|
->getQuery()->getResult();
|
||||||
|
|
||||||
|
$tbmonths[$keymonth]["natures"][$keynature]["totalnature"]=($events[0]["somme"]?$events[0]["somme"]:0);
|
||||||
|
$tbmonths[$keymonth]["natures"][$keynature]["totalmonth"]=$totalmonth;
|
||||||
|
$tbmonths[$keymonth]["natures"][$keynature]["totalservice"]=0;
|
||||||
|
}
|
||||||
|
|
||||||
foreach($month["services"] as $keyservice => $service) {
|
foreach($month["services"] as $keyservice => $service) {
|
||||||
$events = $em
|
$events = $em
|
||||||
->createQueryBuilder('event')
|
->createQueryBuilder('event')
|
||||||
|
@@ -7,6 +7,17 @@ STATISTIQUES
|
|||||||
</h1>
|
</h1>
|
||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
|
<div class="col-md-12">
|
||||||
|
<div class="card homecard" style="width: 100%; height: 600px;">
|
||||||
|
<div class="card-header">
|
||||||
|
CADOLES
|
||||||
|
</div>
|
||||||
|
<div class="card-body">
|
||||||
|
<div id="chart-c" style="height: 250px;"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="col-md-6">
|
<div class="col-md-6">
|
||||||
<div class="card homecard" style="width: 100%; height: 600px;">
|
<div class="card homecard" style="width: 100%; height: 600px;">
|
||||||
<div class="card-header">
|
<div class="card-header">
|
||||||
@@ -35,10 +46,45 @@ STATISTIQUES
|
|||||||
{% block localjavascript %}
|
{% block localjavascript %}
|
||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
|
|
||||||
|
graphCadoles();
|
||||||
graphDEV();
|
graphDEV();
|
||||||
graphCSS();
|
graphCSS();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
function graphCadoles() {
|
||||||
|
|
||||||
|
new Morris.Line({
|
||||||
|
element: 'chart-c',
|
||||||
|
xkey: 'month',
|
||||||
|
ymax: 350,
|
||||||
|
ykeys: [
|
||||||
|
'Total',
|
||||||
|
{% for nature in tbnatures %}
|
||||||
|
'{{ nature.name }}',
|
||||||
|
{% endfor %}
|
||||||
|
],
|
||||||
|
data: [
|
||||||
|
{% for month in tbmonths %}
|
||||||
|
{ month: '{{ month.name }}',
|
||||||
|
{% for nature in month.natures %}
|
||||||
|
{% if loop.first %}
|
||||||
|
'Total': {{ nature.totalmonth }},
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
'{{ nature.name }}': {{ nature.totalnature }},
|
||||||
|
{% endfor %}
|
||||||
|
},
|
||||||
|
{% endfor %}
|
||||||
|
],
|
||||||
|
labels: [
|
||||||
|
'Total',
|
||||||
|
{% for nature in tbnatures %}
|
||||||
|
'{{ nature.name }}',
|
||||||
|
{% endfor %}
|
||||||
|
]
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
function graphDEV() {
|
function graphDEV() {
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user