CM89 - contract changes

This commit is contained in:
“VeLiTi”
2024-09-20 14:57:11 +02:00
parent e139b91c30
commit 78cfe93dce
19 changed files with 1780 additions and 211 deletions

View File

@@ -2308,4 +2308,36 @@ function calculateMedian($array) {
$highMiddle = $array[ceil((count($array) - 1) / 2)];
return ($lowMiddle + $highMiddle) / 2;
}
}
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++
// visual forecast for service and warranty+++++++++++++++
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++
function usageView($messages){
//GET TOTAL SERVICE COUNT
$totalcount = 0;
foreach ($messages as $message){
$totalcount += $message['count'];
}
$view = '
<smaller>Service = '.$totalcount.' </smaller>
<div style="margin-bottom: 30px;">
<ul style="width: 100%;max-width:100%" class="chart">
';
foreach ($messages as $message){
$height = ($message['count'] / $totalcount) * 100;
$fc_year = $message['year'];
$dateObj = DateTime::createFromFormat('!m', $message['month']);
$title = $dateObj->format('F').' '.$fc_year;
$view .='<li style="text-align:center;">' . $message['count'] . '<span style="height:' . $height . '%" title="' . $title . '"></span></li>';
}
$view .='</ul>
</div>
';
return $view;
}