* @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"); $sdi_object= new sdi; //$result_sdii=$sdi_object->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); // 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_theme="index.php?rub=theme&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 ?>

";?> isSuperAdmin()) { echo "";?>
false) {?>
2) {?> <?php echo _t('dashboard','all_value');?>

".mb_ucfirst(_t('dashboard','date'))."\n"; echo "\n"; 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 .= '

'; } // 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 .= '

'; // 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']]; $maskminvalue = $a[0]; $maskmaxvalue = $a[1]; } else { $current_val .= fnumber_format($result_value[$i]['sdiv_value'], 'auto', false); } } else { $current_val .= fnumber_format($result_value[$i]['sdiv_value'], 'auto', false); } // 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); } else { $threshold = fnumber_format($default_threshold, 'auto', false); } ($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"; 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','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_value[$i]['sdiv_statut']=='D') { echo "".mb_ucfirst(_t('statut','draft')).""; } echo "". $threshold."". $evol."". $comment."
<\/i>' . _t('dashboard', 'export_to_excel') . '<\/a>\');'.PHP_EOL; $str .= '$("#export-data").click(function() { // if is multi-values table we dynamically change the content if( $("#indicator-values").hasClass("multi-values") ) { $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-data"); // 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:\'excel\',escape:\'false\',ignoreColumn:\'[6]\',displayTableName:\'true\',htmlContent:\'false\'}); });'; footerAddInlineJS($str); ?> "._t('dashboard','novalue').": ".formatText($resultscale2[0]['scale_denomination'], '2HTML')."
"; ?>
:
isSuperAdmin()) echo "".formatText($result_sdii[0]['theme_name'], '2HTML').""; else echo formatText($result_sdii[0]['theme_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."". formatText(empty_nc($result_sdii[0]['sdii_threshold_value']), '2HTML')."". formatText($result_sdii[0]['sdii_frequency'], '2HTML')."