<?php
/**
 * @package linea21.core
 * @subpackage public
 * @author linea21 <info@linea21.com>
 * @version $id SVN
 * @access public
 * @license http://opensource.org/licenses/gpl-3.0.html
 */

$GLOBALS['filters'][LANGUAGE]['scale']['active'] = 1; // filter activation
SetHTMLTitle($GLOBALS['lang']['dashboard']['section']); // HTML title
//////////////////////////////////////////
/////récupération des variables GET et POST
//////////////////////////////////////////
include_once('../dashboard/display.php');
if (isset($_REQUEST['parentid']))
{
  $sdi_id=$_REQUEST['id'];
  $scale_id=$_REQUEST['parentid'];
}
else if (isset($_REQUEST['id'])) {
  $scale_id=$_REQUEST['id'];
}
else $scale_id=1;

?>
<div id="contenu"><?php
//////////////////////////////////////////
/////affichage switch d'affichage jeune public / classique
//////////////////////////////////////////

if(!isset($_REQUEST['parentid'])) {

  if ( ActiveItemKey($GLOBALS['activeitem']) == 'dashboard') {


    //////////////////////////////////////////
    /////affichage liste des indicateurs classique
    //////////////////////////////////////////
    echo "<h1>".$GLOBALS['lang']['dashboard']['list_public']."</h1>".END_LINE;
    ?>
<div class="h1_comment" id="h1_dashboard"><?php echo $GLOBALS['lang']['dashboard']['h1_public_comment']; ?>
</div>
    <?php
    echo DisplaySwitchAffichage($scale_id);
    echo "<hr />";
    DisplayListValues($scale_id, $GLOBALS['filters'][LANGUAGE]['scale']['linkvalue']);
    echo "<br />";
  }


  //////////////////////////////////////////
  /////affichage tableau de bord jeune
  //////////////////////////////////////////
  else {
    echo "<h1>".$GLOBALS['lang']['dashboard']['list_public_anim']."</h1>".END_LINE;
    ?>
<div class="h1_comment" id="h1_dashboard"><?php echo $GLOBALS['lang']['dashboard']['h1_public_comment']; ?>
</div>
    <?php
    echo DisplaySwitchAffichage($scale_id);
    echo "<hr />";
    echo DisplayYoung();
  }

} else {
  //////////////////////////////////////////
  /////affichage détail d'un indicateur
  //////////////////////////////////////////

  // set HTML Title
  $result=$GLOBALS['sql_object']->DBSelect(SQL_getOnesdiname($sdi_id));
  SetHTMLTitle(formatText($result[0]['sdii_name'], '2HTML'));
  if(isset($_REQUEST['parentid']) && ActiveItemKey($GLOBALS['activeitem'])=='dashboard') DisplayOneSdi($sdi_id, $scale_id);
  if (isset($_REQUEST['parentid']) && ActiveItemKey($GLOBALS['activeitem'])=='dashboard-rules') DisplayOneSdirules($sdi_id, $scale_id);
  if (isset($_REQUEST['parentid']) && ActiveItemKey($GLOBALS['activeitem'])=='dashboard-assessment') DisplayOneSdievaluation($sdi_id, $scale_id);
  if (isset($_REQUEST['parentid']) && ActiveItemKey($GLOBALS['activeitem'])=='dashboard-provider') DisplayOneSdiprovider($sdi_id, $scale_id);
  }?> 
  
  </div>
