Source for file list.php
Documentation is available at list.php
* @package linea21.modules
* @author linea21 <info@linea21.com>
* @license http://opensource.org/licenses/gpl-3.0.html
//////////// Check Inclusion de pages ////////////
include_once("../lib/lib_common.php");
include_once("../lib/input_helpers.php");
$result= $sql_object->DBSelect($req_list_theme);
//$result_sdi=$sdi_object->GetListSdi($filter="R", $valueparam=0, $sql_object);
$result_sdi = $sql_object -> DBSelect($req_sdi);
$link_sup= $rub_link. "&todo=sup&id=";
$link_add= $rub_link. "&todo=add&id=";
$link_det= $rub_link. "&todo=det&id=";
$link_list_scale= $rub_link. "&todo=list&scale_id=";
if (!isset ($_GET['scale_id']) && !isset ($_POST['scale_id'])) {
if (isset ($_POST['scale_id'])) $scale_id = $_POST['scale_id'];
if (isset ($_GET['scale_id'])) $scale_id = $_GET['scale_id'];
$resultscale2 = $sql_object -> DBSelect($req_scale);
for ($i= 0;$i< count($result);$i++ ){
if ($result[$i]['sdtheme_id']!= $current_sdtheme && $current_sdtheme<> '') {
if ($result[$i]['sdtheme_id']!= $current_sdtheme) {
$current_sdtheme= $result[$i]['sdtheme_id'];
$listing.= "<h3><a href=\"\">". formatText($result[$i]['sdtheme_name'], '2HTML'). "</a></h3>";
$listing.= "<div class=\"contboxgray\">\n";
for ($j= 0;$j< count($result_sdi);$j++ ){
if ($result[$i]['theme_id']== $result_sdi[$j]['sdii_theme']) {
$listing.= "\t<li class=\"li2\">\n";
$aff_bare= getRuler($scale_id, $result_sdi[$j]['sdii_id'], $result_sdi[$j]['sdii_max_value'], $result_sdi[$j]['sdii_min_value'], $result_sdi[$j]['sdii_threshold_value'], $sdi_object, $sql_object, $lang, $result_sdi[$j]['sdii_unit'], $result_sdi[$j]['sdii_threshold_relative']);
$listing.= "\t\t<a href=\"". $link_det. $result_sdi[$j]['sdii_id']. "&scale_id=". $scale_id. "\" title=\"". formatText($result_sdi[$j]['sdii_name'], '2HTML'). "\">". formatTextli($result_sdi[$j]['sdii_name']). "</a>\n";
if ($result_sdi[$j]['sdii_statut']== 'D') $listing.= "<span class=\"state\">". _t('statut','draft'). "</span>\n";
$listing.= "\t\t<a href=\"". $link_add. $result_sdi[$j]['sdii_id']. "&scale_id=". $scale_id. "\" class=\"ico_add\" title=\"". _t('dashboard','add'). "\"></a>\n";
$barre_globale[$j]= $aff_bare[0];
//calcul de la valeur de la barre globale
if(isset ($barre_globale)) {
for ($z= 0;$z< count($barre_globale);$z++ ){
if ($barre_globale[$z]> 0) {
$value_globale+= $barre_globale[$z];
$value_globale= $value_globale/ $i;
$value_globale= round($value_globale, 1);
$value_curs= 111- $value_globale;
$listing2= "<div class=\"globalvalue\">";
$listing2.= "<div class=\"imagebarre\">\n<span class=\"globalvaluetext\">". _t('dashboard','global_value'). "</span><img src=\"" . THEME_ADMIN_PATH. "images/barre_gris.gif\" alt=\"". _t('dashboard','novalue'). "\" />\n</div>\n";
$listing2.= "</div><br class=\"brendstep\" />";
$listing2= "<div class=\"globalvalue\">";
$listing2.= "<div class=\"imagebarre\"><span >". _t('dashboard','global_value'). "</span> <img src=\"" . THEME_ADMIN_PATH. "images/barre.gif\" alt=\"". _t('dashboard','global_value'). "\" />";
$listing2.= "<img src=\"" . THEME_ADMIN_PATH. "images/cursor.gif\" alt=\"". _t('dashboard','global_value'). ": ". $value_globale.
"\n". _t('dashboard','barre'). "\" class=\"cursor\" style=\"left:-". $value_curs. "px;\"/>";
$listing2.= "\t<span class=\"value\"> (".(int) $value_globale. ")</span></div>\n";
$listing2.= "</div><br class=\"brendstep\" />";
//affichage selectbox échelle
$resultscale = $sql_object -> DBSelect($req_list_scale);
$listing3= "<h2>". formatText($resultscale2[0]['scale_denomination'], '2HTML'). "</h2>";
$listing3.= "<div class=\"filterselect\">";
$listing3.= ScaleSelectBox($resultscale, "scale", $scale_id, $link_list_scale);
<li><a href="index.php" class="chemin_home"> <?php echo _t('way','home'); ?></a>
<li><a href=" <?php echo $rub_link; ?>" id="chemin_ <?php echo $rub; ?>"
class="chemin_rub"> <?php echo _t('menu','dashboard');?></a></li>
<li><span> <?php echo _t('dashboard','list'); ?></span></li>
function getPositionfromValue ($value, $max_value, $min_value, $threshold_value, $threshold_relative){
if ($max_value== 0) $max_value= 0.000001;
if ($min_value== 0) $min_value= 0.000001;
if ($threshold_relative== 'Y') {
$unitup= 50/ ($max_value- $threshold_value);
$unitdown= 50/ ($threshold_value- $min_value);
if ($value> $threshold_value) $result= 50+ (($value- $threshold_value)* $unitup);
else $result= 50- (($threshold_value- $value)* $unitdown);
if(($max_value - $threshold_value) <> 0) $unitdown= 50/ ($max_value- $threshold_value);
if(($threshold_value - $min_value) <> 0) $unitup= 50/ ($threshold_value- $min_value);
if ($value> $threshold_value) $result= 50- (($value- $threshold_value)* $unitdown);
else $result= 50+ (($threshold_value- $value)* $unitup);
function getRuler($scale_id, $id, $max_value, $min_value, $threshold_value, $sdi_object, $sql_object, $lang, $unit, $threshold_relative){
//$req_sdiav=SQL_getInfoSdi("SCA", $scale_id, $id, $sql_object);
$result_value = $sql_object -> DBSelect($req_sdiav);
if ($result_value<> false){
$value_cursor1= getPositionfromValue ($result_value[0]['sdiv_value'], $max_value, $min_value, $threshold_value, $threshold_relative);
$value_cursor= 111- $value_cursor1;
if ($result_value== false) {
$listing= "<div class=\"imagebarre\">\n<img src=\"" . THEME_ADMIN_PATH. "images/barre_gris.gif\" title=\"". _t('dashboard','novalue'). "\" />\n</div>\n";
$listing= "<div class=\"imagebarre indicator-info-container\">
<a href=\"index.php?rub=dashboard&todo=det&id=". $id. "&scale_id=". $scale_id. "\" class=\"ruler\">
<img src=\"" . THEME_ADMIN_PATH. "images/barre.gif\" alt=\"". ucfirst(_t('dashboard','value')). " : ". $result_value[0]['sdiv_value']. " ". $unit.
"\n ". ucfirst(_t('sdi','min_value')). " : ". $min_value. " ". $unit.
"\n ". ucfirst(_t('sdi','threshold_value')). " : ". $threshold_value. " ". $unit.
"\n ". ucfirst(_t('sdi','max_value')). " : ". $max_value. " ". $unit. "\" /></a>".
"<div class=\"indicator-info\"><p>". ucfirst(_t('dashboard','value')). " : <strong>". $result_value[0]['sdiv_value']. " ". $unit. "</strong></p>".
"<p>". ucfirst(_t('sdi','min_value')). " : <strong>". $min_value. " ". $unit. "</strong></p>".
"<p>". ucfirst(_t('sdi','max_value')). " : <strong>". $max_value. " ". $unit. "</strong></p>".
"<p>". ucfirst(_t('sdi','threshold_value')). " : <strong>". $threshold_value. " ". $unit. "</strong></p>".
$listing.= "<img src=\"" . THEME_ADMIN_PATH. "images/cursor.gif\" title=\"". _t('dashboard','value'). ": ". $result_value[0]['sdiv_value']. " ". _t('dashboard','barre'). "\" class=\"cursor\" style=\"left:-". $value_cursor. "px;\"/>";
if (isset ($result_value[1]['sdiv_value'])) {
if ($result_value[0]['sdiv_value']>= $result_value[1]['sdiv_value']) $listing.= "<img src=\"" . THEME_ADMIN_PATH. "images/ico_asc.gif\" alt=\"". _t('dashboard','value_tendance'). "\" />";
else $listing.= "<img src=\"" . THEME_ADMIN_PATH. "images/ico_desc.gif\" alt=\"". _t('dashboard','value_tendance'). "\" />";
$listing.= "\t<span class=\"value\"> (".(int) $result_value[0]['sdiv_value']. ")</span></div>\n";
$result= array($value_cursor1, $listing);
include_once(THEME_ADMIN_PATH. "quickicons.php");
<script type="text/javascript">
$(document).ready(function() {
$(".imagebarre").removeClass('a.ruler:hover');
$(".imagebarre a.ruler").hover(
$(this).next().fadeIn('fast');
<div class="contentcontainer"> <?php include_once($dir. "/menurub.php"); ?>
<?php include_once($dir. "/help.php"); ?></div>
|