CM89 - contract changes
This commit is contained in:
@@ -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;
|
||||
}
|
||||
Reference in New Issue
Block a user