";?>
isSuperAdmin()) { echo "
";?>
false) {?>
2) {?>
safeTruncate(50)->slugify(). '.png';
$js_dlChart = "
$( 'div.chart-container')
.on( 'mouseenter', function() {
$('.download-chart').fadeIn(100);
})
.on( 'mouseleave', function() {
$('.download-chart').fadeOut( 500 );
});";
footerAddInlineJS($js_dlChart);
?>
".mb_ucfirst(_t('dashboard','date'))."\n";
echo "".mb_ucfirst(_t('divers','by'))." \n";
echo "".mb_ucfirst(_t('dashboard','value'))." (".formatText($result_sdii[0]['sdii_unit'], '2HTML').")"." \n";
echo "".mb_ucfirst(_t('dashboard','threshold_value'))." \n";
echo "".mb_ucfirst(_t('dashboard','rate'))." \n";
echo "".mb_ucfirst(_t('dashboard','comment'))." \n";
echo " \n";
?>
';
if(!empty($val['label'])) $current_val .= ''.formatText($val['label'], '2HTML'). ' : ';
$current_val .= ''.fnumber_format($val['value'], 'auto', false). ' ('.fnumber_format($val['_percentage'], 2, false).' %) ';
$current_val .= '';
$data_pie .= formatText($val['label'], '2HTML').'='.$val['value'].'||';
}
// we display the total
$current_val .= '';
$current_val .= mb_ucfirst(_t('dashboard', 'multivalue_total')) . ' : ' . fnumber_format($data[0]['_total'], 'auto', false) . ' ';
$current_val .= ' ('._t('dashboard', 'to_detail_chart').' ) ';
$current_val .= '
';
$current_val_raw = $data[0]['_total'];
// we compute rate
if(isset($result_value[$i+1]['sdiv_multivalue'])) {
$dataPlusOne = unserialize($result_value[$i+1]['sdiv_multivalue']);
$evol = ($data[0]['_total'] - $dataPlusOne[0]['_total']) / $dataPlusOne[0]['_total'] * 100;
// _debug('rate : '. fnumber_format($evol, 2). ' % - details : ('.$data[0]['_total']. ' - ' . $dataPlusOne[0]['_total']. ') / '. $dataPlusOne[0]['_total']);
$evol = fnumber_format($evol, 2). ' %';
} else {
$evol = empty_nc('');
}
// indicator is NOT multivalues
} else {
// If indicator is boolean
if($result_sdii[0]['sdii_type'] == 'boolean') {
$a = getBooleanValues($result_sdii[0]);
if($a) {
$current_val .= $a[$result_value[$i]['sdiv_value']];
$current_val_raw = $result_value[$i]['sdiv_value'];
$maskminvalue = $a[0];
$maskmaxvalue = $a[1];
} else {
$current_val .= fnumber_format($result_value[$i]['sdiv_value'], 'auto', false);
$current_val_raw = $result_value[$i]['sdiv_value'];
}
} else {
$current_val .= fnumber_format($result_value[$i]['sdiv_value'], 'auto', false);
$current_val_raw = $result_value[$i]['sdiv_value'];
}
// we compute rate
if(isset($result_value[$i+1]['sdiv_value']) && is_numeric($result_value[$i+1]['sdiv_value'])) {
$evol = ($result_value[$i]['sdiv_value'] - $result_value[$i+1]['sdiv_value']) / $result_value[$i+1]['sdiv_value'] * 100;
// _debug('rate : '. fnumber_format($evol, 2). ' % - details : ('.$result_value[$i]['sdiv_value']. ' - ' . $result_value[$i+1]['sdiv_value']. ') / '. $result_value[$i+1]['sdiv_value']);
$evol = fnumber_format($evol, 2). ' %';
} else {
$evol = empty_nc('');
}
}
// if set, we get it from the table
if(!is_null($result_value[$i]['sdiv_threshold'])) {
$threshold = fnumber_format($result_value[$i]['sdiv_threshold'], 'auto', false);
$threshold_raw = $result_value[$i]['sdiv_threshold'];
} else {
$threshold = fnumber_format($default_threshold, 'auto', false);
$threshold_raw = $default_threshold;
}
($result_value[$i]['sdiv_comment_display'] == 'Y') ? $comment_status = _t('dashboard', 'public') : $comment_status = _t('dashboard', 'private');
if(!empty($result_value[$i]['sdiv_comment'])) {
$comment = '';
}
echo "\n";
echo "". formatText($result_value[$i]['date_p'], '2HTML')." \n";
echo "". $result_value[$i]['user_login']." \n";
echo "". formatText($current_val, '2HTML');
if ($result_value[$i]['sdiv_statut']=='D') {
echo "".mb_ucfirst(_t('statut','draft'))." ";
}
echo " \n";
echo "". $threshold." \n";
echo "". $evol." \n";
echo "". $comment." \n";
echo " \n";
echo " \n";
}
// Ability to sort table
addDynamicCSS('../lib/js/jquery.tablesorter/theme.default.css');
footerAddJS('../lib/js/jquery.tablesorter/jquery.tablesorter.min.js');
$str = '$("table.multisort").tablesorter({ });';
footerAddInlineJS($str);
?>
safeTruncate(50)->slugify();
$str = '$("#export-values li a").click(function() {
var format = $(this).attr("data-format");
// if is multi-values table we dynamically change the content
if( $("#indicator-values").hasClass("multi-values") && format != "png") {
$el = $("#indicator-values").clone().attr("id", "indicator-values-clone"); // we create a clone
$el.find( "td.value" ).each(function( index ) {
// we replace all values by total value only
$( this ).text($( this ).find("p.value-total span.total-numeric").attr("data-total") );
});
$el.insertAfter("#export-values"); // if not displayed, the export does not work
} else {
$el = $("#indicator-values");
}
$el.tableExport(
{tableName:"'.mb_ucfirst($result_sdii[0]['sdii_name']. ' / '. $resultscale2[0]['scale_denomination']) .'",type:format,escape:\'false\',ignoreColumn:\'[6]\',displayTableName:\'true\',htmlContent:\'false\',fileName:\'' . $slug_name . '\'});
return false;
});';
footerAddInlineJS($str);
?>
"._t('dashboard','novalue').": ".formatText($resultscale2[0]['scale_denomination'], '2HTML')."