Added partner order statistic on dashboard
This commit is contained in:
@@ -1,3 +1,30 @@
|
||||
<?php
|
||||
|
||||
$additionalJS = ["plugins/chart.js/Chart.min.js"];
|
||||
|
||||
$chartColors = [
|
||||
'#3366CC',
|
||||
'#DC3912',
|
||||
'#FF9900',
|
||||
'#109618',
|
||||
'#990099',
|
||||
'#3B3EAC',
|
||||
'#0099C6',
|
||||
'#DD4477',
|
||||
'#66AA00',
|
||||
'#B82E2E',
|
||||
'#316395',
|
||||
'#994499',
|
||||
'#22AA99',
|
||||
'#AAAA11',
|
||||
'#6633CC',
|
||||
'#E67300',
|
||||
'#8B0707',
|
||||
'#329262',
|
||||
'#5574A6',
|
||||
'#3B3EAC'
|
||||
]
|
||||
?>
|
||||
<?php include(realpath(dirname(__FILE__)."/../../$mfLayoutPackage")."/header.php"); ?>
|
||||
|
||||
<div class="row justify-content-center mt-1">
|
||||
@@ -115,25 +142,37 @@
|
||||
|
||||
</div>
|
||||
|
||||
<!--div class="row mt-2">
|
||||
<div class="col-lg">
|
||||
<h4 class="card-title">Kunden pro Provider</h4>
|
||||
<div class="row">
|
||||
<?php if(1): ?>
|
||||
<div class="col-lg-7">
|
||||
<canvas id="partner-chart" height="200"></canvas>
|
||||
<div class="row mt-2">
|
||||
<div class="col-6">
|
||||
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<h4 class="card-title">Kunden pro Provider</h4>
|
||||
<hr />
|
||||
<div class="row">
|
||||
<?php if(1): ?>
|
||||
<div class="col-lg-7">
|
||||
<canvas id="partner-chart" height="200"></canvas>
|
||||
</div>
|
||||
<div class="col-lg-5">
|
||||
<table>
|
||||
<?php $i=0; foreach($partner_orders as $provider => $count): ?>
|
||||
<tr style="border-bottom: 1px solid <?=$chartColors[$i]?>;">
|
||||
<td><span style="background-color: <?=$chartColors[$i]?>; color: <?=$chartColors[$i]?>">##</span></td>
|
||||
<td class="pl-2 pr-2" style="white-space: nowrap;"><?=round(($count / $total_orders) * 100, 1)?>% (<?=($count)?>)</td>
|
||||
<td title="<?=$provider?>" style="white-space: nowrap; overflow: hidden; text-overflow: ellipsis;"><?=$this->strtrim($provider,22)?></td>
|
||||
</tr>
|
||||
<?php $i++; endforeach; ?>
|
||||
</table>
|
||||
</div>
|
||||
<?php else: ?>
|
||||
<i>Keine Aktiven Anschlüsse</i>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-5">
|
||||
<table>
|
||||
|
||||
</table>
|
||||
</div>
|
||||
<?php else: ?>
|
||||
<i>Keine Aktiven Anschlüsse</i>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
</div-->
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
@@ -163,6 +202,39 @@
|
||||
});
|
||||
|
||||
|
||||
<?php if(count($partner_orders)): ?>
|
||||
var providerChart = new Chart(document.getElementById('partner-chart').getContext('2d'), {
|
||||
type: 'doughnut',
|
||||
data: {
|
||||
labels: [
|
||||
<?php foreach($partner_orders as $partner => $c): ?>
|
||||
"<?=$partner?> (<?=round(($c / $total_orders) * 100, 1)?>%)",
|
||||
<?php endforeach; ?>
|
||||
],
|
||||
datasets: [{
|
||||
data: [
|
||||
<?php foreach($partner_orders as $c): ?>
|
||||
<?=($c)?>,
|
||||
<?php endforeach; ?>
|
||||
],
|
||||
backgroundColor: [
|
||||
"<?=implode('","', $chartColors)?>"
|
||||
],
|
||||
borderWidth: 2
|
||||
|
||||
}]
|
||||
},
|
||||
options: {
|
||||
scales: {
|
||||
y: {
|
||||
beginAtZero: true
|
||||
}
|
||||
},
|
||||
legend: false,
|
||||
}
|
||||
});
|
||||
<?php endif; ?>
|
||||
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user