* @version $Id$ * @access public * @license http://opensource.org/licenses/gpl-3.0.html */ //////////// Check Inclusion de pages //////////// if (!class_exists('auth')){ include_once("../lib/lib_common.php"); ReloadIndex('admin'); } //////////// if(!isset($_GET['id']) && !isset($_POST['id'])) { $id="1"; } else { if(isset($_POST['id'])) $id=$_POST['id']; if(isset($_GET['id'])) $id=$_GET['id']; } if(!isset($_GET['scale_id']) && !isset($_POST['scale_id'])) { $scale_id=1; } else { if(isset($_POST['scale_id'])) $scale_id=$_POST['scale_id']; if(isset($_GET['scale_id'])) $scale_id=$_GET['scale_id']; } //////////// Check Droits utilisateur //////////// if (!$l21auth->hasRight('dashboard') && !$l21auth->hasRight('indicator', $id)) ReloadIndex('admin'); //////////// include_once("../dashboard/common.php"); include_once(override("../dashboard/chart-prepare.php")); footerAddJS('../lib/js/clipboard.js/dist/clipboard.min.js'); $str = " var clipboard = new ClipboardJS('.copy-chart-url'); clipboard.on('success', function(e) { alertify.success(\"" . _t('copy', 'url_copy_succeed') . "\"); }); clipboard.on('error', function(e) { alertify.error(\"" . _t('copy', 'url_copy_failed') . "\"); });"; footerAddInlineJS($str); $str = " var clipboard2 = new ClipboardJS('.copy-chart-iframe'); clipboard2.on('success', function(e) { alertify.success(\"" . _t('copy', 'embedcode_copy_succeed') . "\"); }); clipboard2.on('error', function(e) { alertify.error(\"" . _t('copy', 'embedcode_copy_failed') . "\"); });"; footerAddInlineJS($str); if(defined('CLIENT_CHARTS') && CLIENT_CHARTS == 1) { footerAddJS('../lib/js/Highcharts-7.0.3/code/highcharts.js'); // https://www.highcharts.com/docs/export-module/export-module-overview footerAddJS('../lib/js/Highcharts-7.0.3/code/modules/exporting.js'); footerAddJS('../lib/js/Highcharts-7.0.3/code/modules/offline-exporting.js'); footerAddJS('../lib/js/generate-chart.js'); // footerAddJS('../lib/js/Highcharts-7.0.3/code/themes/grid-light.js'); } // getting chart sizes from config file list($cwidth, $cheight) = explode('x', CHART_DEFAULT_SIZE); ?> GetInfoSdi($id, $sql_object); //$result_e=$sdi_object->GetEvaluation( $id, $sql_object, $ID=-1); //$result_p=$sdi_object->GetProvider( $id, $sql_object, $ID=-1); //$result_r=$sdi_object->GetRules( $id, $sql_object, $ID=-1); $req_sdii=SQL_getInfoSdi($id); $result_sdii = $sql_object -> DBSelect($req_sdii); $level = formatText($result_sdii[0]['level_name'], '2HTML'); $level_label_att = formatText($result_sdii[0]['level_label'] . ' : ' . $result_sdii[0]['level_name'], '2ATT'); $level_label = '' .formatText($result_sdii[0]['level_label'], '2HTML'). ' '; if(defined('DISPLAY_LEVEL_LABEL') && DISPLAY_LEVEL_LABEL == 1) $disp_level_name = $level_label . $level; else $disp_level_name = $level; // Do record exists? if(!isset($result_sdii[0]['sdii_name'])) redirect_to('@module_default'); // setting $default_threshold value // By default initial value $default_threshold = $result_sdii[0]['sdii_threshold_value']; $req_sdir=SQL_getRules( $id, $sql_object, $ID=-1); $result_r = $sql_object -> DBSelect($req_sdir); $req_sdie=SQL_getEvaluation( $id, $sql_object, $ID=-1); $result_e = $sql_object -> DBSelect($req_sdie); $req_sdip=SQL_getProvider( $id, $sql_object, $ID=-1); $result_p = $sql_object -> DBSelect($req_sdip); $req_sdiav=SQL_getAllValue("SCA", $scale_id, $id); $result_value = $sql_object -> DBSelect($req_sdiav); //$result_value=$sdi_object->GetAllValue("SCA", $scale_id, $id, $sql_object); $req_scale=SQL_getonescale($scale_id); $resultscale2 = $sql_object -> DBSelect($req_scale); $link_det=$rub_link."&todo=det&id="; $link_det_level="index.php?rub=level&todo=det&id="; $link_det_indicator="index.php?rub=sdi&todo=det&id="; $link_sup=$rub_link."&todo=sup&value_id="; $link_mod=$rub_link."&todo=mod&value_id="; $link_add=$rub_link."&todo=add&id="; $navtitle=_t('dashboard','det')." : ".$result_sdii[0]['sdii_name']; //valeur du graphique ?>

";?> hasRight('sdi')) { echo "";?>
false) { ?>
= $minChartValues) {?> 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 "\n"; echo "\n"; if($result_sdii[0]['sdii_value_type'] == 'multiple') echo "\n"; echo "\n"; echo "\n"; echo "\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 .= '

'; $raw_multivalue .= formatText($val['label'], '2HTML') . ' : ' . $val['value'] . '
'; } // we display the total if(!defined('CLIENT_CHARTS') || CLIENT_CHARTS != 1) { $chartlink = override('../dashboard/pie.php').'?id='.$id.'&value='.$result_value[$i]['sdiv_id'].'&display=true'; } else { $chartlink = SITE_ROOT_URL .'public/get-chart.php?id='.$id.'&type=donut&year='.substr(formatDate($result_value[$i]['date_p'], true), 0, 4).'&alternatives=all&share=1'; } $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']; if($i == 0) { $lastValue = $current_val_raw; // we store data to compute TCAM and global rate $year_end = substr(formatDate($result_value[$i]['date_p'], true), 0, 4); } if($i == count($result_value)-1) { $firstValue = $current_val_raw; // we store data to compute TCAM and global rate $year_start = substr(formatDate($result_value[$i]['date_p'], true), 0, 4); } // 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 or qualitative if($result_sdii[0]['sdii_nature'] == 'boolean' || $result_sdii[0]['sdii_nature'] == 'qualitative') { $a = getBooleanValues($result_sdii[0]); if($a) { $index = array(); foreach ($a as $key => $value) { array_push($index, $key); } $current_val .= $a[$result_value[$i]['sdiv_value']]; $current_val_raw = $result_value[$i]['sdiv_value']; $maskminvalue = $a[min($index)]; $maskmaxvalue = $a[max($index)]; if(is_null($result_value[$i]['sdiv_threshold'])) $threshold = empty_none(''); else $threshold = $a[$result_value[$i]['sdiv_threshold']]; } 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']; if($i == 0) { $lastValue = $current_val_raw; // we store data to compute TCAM and global rate $year_end = substr(formatDate($result_value[$i]['date_p'], true), 0, 4); } if($i == count($result_value)-1) { $firstValue = $current_val_raw; // we store data to compute TCAM and global rate $year_start = substr(formatDate($result_value[$i]['date_p'], true), 0, 4); } } $evol = empty_nc(''); // we compute rate - if($result_sdii[0]['sdii_nature'] == 'quantitative') { 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). ' %'; } } } $threshold_raw = $default_threshold; // default threshold values if($result_sdii[0]['sdii_nature'] == 'quantitative') { $threshold = empty_none(fnumber_format($default_threshold, 'auto', false)); } else { if(is_null($default_threshold)) { $threshold = empty_none(''); } else { $threshold = $a[$default_threshold]; } } // if set, we get it from the table if(!is_null($result_value[$i]['sdiv_threshold'])) { if($result_sdii[0]['sdii_nature'] == 'boolean' || $result_sdii[0]['sdii_nature'] == 'qualitative') { $threshold = $a[$result_value[$i]['sdiv_threshold']]; $threshold_raw = $result_value[$i]['sdiv_threshold']; } else { $threshold = fnumber_format($result_value[$i]['sdiv_threshold'], 'auto', false); $threshold_raw = $result_value[$i]['sdiv_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 = '
'; $comment .= ''; $comment .= '
'.ucfirst(_t('dashboard', 'comment')).' ('.$comment_status.') : '.$result_value[$i]['sdiv_comment'].'
'; $comment .= '
'; } echo "\n"; echo "\n"; echo "\n"; echo "\n"; if ($result_value[$i]['sdiv_statut']=='D') { echo "".mb_ucfirst(_t('statut','draft')).""; } echo "\n"; echo "\n"; echo "\n"; echo "\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); ?>
".mb_ucfirst(_t('divers','by'))."".mb_ucfirst(_t('dashboard','value'))." (".formatText($result_sdii[0]['sdii_unit'], '2HTML').")"."".mb_ucfirst(_t('dashboard','multivalue_distribution'))."".mb_ucfirst(_t('dashboard','threshold_value'))."".mb_ucfirst(_t('dashboard','rate'))."".mb_ucfirst(_t('dashboard','comment'))." 
". formatText($result_value[$i]['date_p'], '2HTML')."". $result_value[$i]['user_login']."". formatText($current_val, '2HTML'); if($result_sdii[0]['sdii_value_type'] == 'multiple') echo "".$raw_multivalue."". $threshold."". $evol."". $comment."
safeTruncate(50)->slugify(); $str = '$("#export-values li a").click(function() { var format = $(this).attr("data-format"); var ignoreCol = []; // set columns to ignore // 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 ignoreCol.push(7); $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"); ignoreCol.push(7); } if(format == "png") $("html, body").scrollTop(0); $el.tableExport( {tableName:"'.mb_ucfirst($result_sdii[0]['sdii_name'] . ' - ' .$result_sdii[0]['sdii_unit'] . ' / '. $resultscale2[0]['scale_denomination']). '",type:format,escape:\'false\',ignoreColumn: ignoreCol,displayTableName:\'true\',htmlContent:\'false\',fileName:\'' . $slug_name . '\'}); return false; });'; footerAddInlineJS($str); ?> "._t('dashboard','novalue').": ".formatText($resultscale2[0]['scale_denomination'], '2HTML')."
"; ?>
:
isSuperAdmin()) echo "".$disp_level_name.""; else echo formatText($result_sdii[0]['level_name'], '2HTML'); ?>
:
:
:

".mb_ucfirst(_t('sdi','min_value'))." (".formatText($result_sdii[0]['sdii_unit'], '2HTML').")"."\n"; echo "\n"; echo "\n"; echo "\n"; ?> \n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; ?>
".mb_ucfirst(_t('sdi','max_value'))." (".formatText($result_sdii[0]['sdii_unit'], '2HTML').")"."".mb_ucfirst(_t('sdi','initial_threshold_value'))." (".formatText($result_sdii[0]['sdii_unit'], '2HTML').")"."".mb_ucfirst(_t('sdi','frequency'))."
". $display_min."". $display_max."". $display_threshold ."". formatText(fnumber_format($result_sdii[0]['sdii_frequency'], 'auto', false), '2HTML')."