linea21-modules
[ class tree: linea21-modules ] [ index: linea21-modules ] [ all elements ]

Source for file list.php

Documentation is available at list.php

  1. <?php
  2. /**
  3.  * @package linea21.modules
  4.  * @subpackage dashboard
  5.  * @author linea21 <info@linea21.com>
  6.  * @version $id SVN
  7.  * @access public
  8.  * @license http://opensource.org/licenses/gpl-3.0.html
  9.  */
  10.  
  11. //////////// Check Inclusion de pages ////////////
  12. if (!function_exists('AuthenthificationProcess')){
  13.   include_once("../lib/lib_common.php");
  14.   ReloadIndex('admin');
  15. }
  16. ////////////
  17.  
  18. //$scale_id=1;
  19. include_once("../lib/input_helpers.php");
  20. $result=$sql_object->DBSelect($req_list_theme);
  21. $sdi_objectnew sdi;
  22. //$result_sdi=$sdi_object->GetListSdi($filter="R", $valueparam=0, $sql_object);
  23. $req_sdi=SQL_getListSdi($filter="R"$valueparam=0);
  24. $result_sdi $sql_object -> DBSelect($req_sdi);
  25.  
  26. $link_sup=$rub_link."&amp;todo=sup&amp;id=";
  27. $link_add=$rub_link."&amp;todo=add&amp;id=";
  28. $link_det=$rub_link."&amp;todo=det&amp;id=";
  29. $link_list_scale=$rub_link."&amp;todo=list&amp;scale_id=";
  30.  
  31. if (!isset($_GET['scale_id']&& !isset($_POST['scale_id'])) {
  32.   $scale_id 1;
  33. else {
  34.   if (isset($_POST['scale_id'])) $scale_id $_POST['scale_id'];
  35.   if (isset($_GET['scale_id'])) $scale_id $_GET['scale_id'];
  36. }
  37.  
  38. $req_scale=SQL_getonescale($scale_id);
  39. $resultscale2 $sql_object -> DBSelect($req_scale);
  40.  
  41. $listing="";
  42. $current_sdtheme='';
  43. for ($i=0;$i<count($result);$i++){
  44.   if ($result[$i]['sdtheme_id']!=$current_sdtheme && $current_sdtheme<>''{
  45.     $listing.="</ul>\n";
  46.     $listing.="</div>\n";
  47.   }
  48.   if ($result[$i]['sdtheme_id']!=$current_sdtheme{
  49.     $current_sdtheme=$result[$i]['sdtheme_id'];
  50.     $listing.="<h3><a href=\"\">".formatText($result[$i]['sdtheme_name']'2HTML')."</a></h3>";
  51.     $listing.="<div class=\"contboxgray\">\n";
  52.     $listing.="<ul>\n";
  53.   }
  54.   for ($j=0;$j<count($result_sdi);$j++){
  55.     if ($result[$i]['theme_id']==$result_sdi[$j]['sdii_theme']{
  56.       $listing.="\t<li class=\"li2\">\n";
  57.       $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']);
  58.       $listing.=$aff_bare[1];
  59.       $listing.="\t<div>\n";
  60.       $listing.="\t\t<a href=\"".$link_det.$result_sdi[$j]['sdii_id']."&amp;scale_id=".$scale_id."\" title=\"".formatText($result_sdi[$j]['sdii_name']'2HTML')."\">".formatTextli($result_sdi[$j]['sdii_name'])."</a>\n";
  61.       if ($result_sdi[$j]['sdii_statut']=='D'$listing.="<span class=\"state\">"._t('statut','draft')."</span>\n";
  62.       $listing.="\t\t<a href=\"".$link_add.$result_sdi[$j]['sdii_id']."&amp;scale_id=".$scale_id."\" class=\"ico_add\" title=\""._t('dashboard','add')."\"></a>\n";
  63.       $listing.="\t</div>\n";
  64.       $listing.="\t</li>\n";
  65.       $barre_globale[$j]=$aff_bare[0];
  66.     }
  67.   }
  68. }
  69. $listing.="</ul>\n";
  70. $listing.="</div>\n";
  71.  
  72. //calcul de la valeur de la barre globale
  73. $value_globale="";
  74. $z="";
  75. $i="";
  76. if(isset($barre_globale)) {
  77.   for ($z=0;$z<count($barre_globale);$z++){
  78.     if ($barre_globale[$z]>0{
  79.       $value_globale+=$barre_globale[$z];
  80.       $i++;
  81.     }
  82.   }
  83. }
  84. if ($i<>0{
  85.   $value_globale=$value_globale/$i;
  86.   $value_globale=round($value_globale1);
  87.   $value_curs=111-$value_globale;
  88. }
  89.  
  90. if ($i==0{
  91.   $listing2="<div class=\"globalvalue\">";
  92.   $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";
  93.   $listing2.="</div><br class=\"brendstep\" />";
  94. }
  95. else {
  96.   $listing2="<div class=\"globalvalue\">";
  97.   $listing2.="<div class=\"imagebarre\"><span >"._t('dashboard','global_value')."</span> <img src=\"" .THEME_ADMIN_PATH"images/barre.gif\" alt=\""._t('dashboard','global_value')."\" />";
  98.   $listing2.="<img src=\"" .THEME_ADMIN_PATH"images/cursor.gif\" alt=\""._t('dashboard','global_value').": ".$value_globale.
  99. "\n"._t('dashboard','barre')."\" class=\"cursor\" style=\"left:-".$value_curs."px;\"/>";
  100.   $listing2.="\t<span class=\"value\"> (".(int)$value_globale.")</span></div>\n";
  101.   $listing2.="</div><br class=\"brendstep\" />";
  102. }
  103. //affichage selectbox échelle
  104.  
  105. $resultscale $sql_object -> DBSelect($req_list_scale);
  106. $listing3="<h2>".formatText($resultscale2[0]['scale_denomination']'2HTML')."</h2>";
  107. $listing3.="<div class=\"filterselect\">";
  108. $listing3.=ScaleSelectBox($resultscale"scale"$scale_id$link_list_scale);
  109. $listing3.="</div>\n";
  110.  
  111. ?>
  112. <div id="chemin">
  113. <ul>
  114.     <li><a href="index.php" class="chemin_home"><?php echo _t('way','home')?></a>
  115.     </li>
  116.     <li><a href="<?php echo $rub_link?>" id="chemin_<?php echo $rub?>"
  117.         class="chemin_rub"><?php echo _t('menu','dashboard');?></a></li>
  118.     <li><span><?php echo _t('dashboard','list')?></span></li>
  119. </ul>
  120. </div>
  121. <!--end barre haute -->
  122. <?php
  123. function getPositionfromValue ($value$max_value$min_value$threshold_value$threshold_relative){
  124.   if ($max_value==0$max_value=0.000001;
  125.   if ($min_value==0$min_value=0.000001;
  126.   if ($threshold_relative=='Y'{
  127.     $unitup=50/($max_value-$threshold_value);
  128.     $unitdown=50/($threshold_value-$min_value);
  129.     if ($value>$threshold_value$result=50+(($value-$threshold_value)*$unitup);
  130.     else $result=50-(($threshold_value-$value)*$unitdown);
  131.   }
  132.   else{
  133.     if(($max_value $threshold_value<> 0$unitdown=50/($max_value-$threshold_value);
  134.     if(($threshold_value $min_value<> 0$unitup=50/($threshold_value-$min_value);
  135.     if ($value>$threshold_value$result=50-(($value-$threshold_value)*$unitdown);
  136.     else $result=50+(($threshold_value-$value)*$unitup);
  137.   }
  138.   return (int)$result;
  139. }
  140.  
  141. function getRuler($scale_id$id$max_value$min_value$threshold_value$sdi_object$sql_object$lang$unit$threshold_relative){
  142.   //$req_sdiav=SQL_getInfoSdi("SCA", $scale_id, $id, $sql_object);
  143.  
  144.   $req_sdiav=SQL_getAllValue("SCA"$scale_id$id);
  145.   $result_value $sql_object -> DBSelect($req_sdiav);
  146.  
  147.  
  148.   if ($result_value<>false){
  149.     $value_cursor1=getPositionfromValue ($result_value[0]['sdiv_value']$max_value$min_value$threshold_value$threshold_relative);
  150.     $value_cursor=111$value_cursor1;
  151.   }
  152.   else $value_cursor1="";
  153.   if ($result_value==false{
  154.     $listing="<div class=\"imagebarre\">\n<img src=\"" .THEME_ADMIN_PATH"images/barre_gris.gif\" title=\""._t('dashboard','novalue')."\" />\n</div>\n";
  155.   }
  156.   else{
  157.     $listing=    "<div class=\"imagebarre indicator-info-container\">
  158.                 <a href=\"index.php?rub=dashboard&amp;todo=det&amp;id=".$id."&amp;scale_id=".$scale_id."\" class=\"ruler\">
  159.                 <img src=\"" .THEME_ADMIN_PATH"images/barre.gif\" alt=\"".ucfirst(_t('dashboard','value'))." : ".$result_value[0]['sdiv_value']." ".$unit.
  160.                 "\n ".ucfirst(_t('sdi','min_value'))." : ".$min_value." ".$unit.
  161.                 "\n ".ucfirst(_t('sdi','threshold_value'))." : ".$threshold_value." ".$unit.
  162.                 "\n ".ucfirst(_t('sdi','max_value'))." : ".$max_value." ".$unit."\"  /></a>".
  163.                 "<div class=\"indicator-info\"><p>".ucfirst(_t('dashboard','value'))." : <strong>".$result_value[0]['sdiv_value']." ".$unit."</strong></p>".
  164.                 "<p>".ucfirst(_t('sdi','min_value'))." : <strong>".$min_value." ".$unit."</strong></p>".
  165.                 "<p>".ucfirst(_t('sdi','max_value'))." : <strong>".$max_value." ".$unit."</strong></p>".
  166.                 "<p>".ucfirst(_t('sdi','threshold_value'))." : <strong>".$threshold_value." ".$unit."</strong></p>".
  167.                 "</div>";
  168.     $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;\"/>";
  169.     if (isset($result_value[1]['sdiv_value'])) {
  170.       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')."\" />";
  171.       else $listing.="<img src=\"" .THEME_ADMIN_PATH"images/ico_desc.gif\" alt=\""._t('dashboard','value_tendance')."\" />";
  172.     }
  173.     $listing.="\t<span class=\"value\"> (".(int)$result_value[0]['sdiv_value'].")</span></div>\n";
  174.   }
  175.   $result=array($value_cursor1$listing);
  176.   return     $result;
  177. }
  178. include_once(THEME_ADMIN_PATH."quickicons.php");
  179. ?>
  180. <script type="text/javascript">
  181. $(document).ready(function() {
  182.     $(".imagebarre").removeClass('a.ruler:hover');
  183.     $(".imagebarre a.ruler").hover(
  184.         function() {
  185.             $(this).next().fadeIn('fast');
  186.         },
  187.         function() {
  188.             $(this).next().hide();
  189.         }
  190.     );
  191. });
  192. </script>
  193. <div class="contentcontainer"><?php    include_once($dir."/menurub.php");    ?>
  194. <div id="content"><?
  195. echo $listing3;
  196. echo $listing2;
  197. echo $listing;
  198. ?></div>
  199. <?php include_once($dir."/help.php")?></div>

Documentation generated on Thu, 03 May 2012 15:06:01 +0200 by phpDocumentor 1.4.1