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

//////////// Check Inclusion de pages //////////// 
if (!function_exists('AuthenthificationProcess')){ 
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'];
}
include_once("../lib/lib_common.php"); 

$sdi_object= new sdi;

//$result_sdii=$sdi_object->GetInfoSdi($id, $sql_object);

$req_sdii=SQL_getInfoSdi($id);
$result_sdii = $sql_object -> DBSelect($req_sdii);

$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);

//$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);
$link_det=$rub_link."&amp;todo=det&amp;id="; 
$link_det_theme="index.php?rub=theme&amp;todo=det&amp;id="; 
$link_sup=$rub_link."&amp;todo=sup&amp;id=";
$link_mod=$rub_link."&amp;todo=mod&amp;id=";
$link_mod_e=$rub_link."&amp;todo=mod_e&amp;id=";
$link_mod_r=$rub_link."&amp;todo=mod_r&amp;id=";
$link_mod_p=$rub_link."&amp;todo=mod_p&amp;id=";
$navtitle=$GLOBALS['lang']['sdi']['det']." : ".$result_sdii[0]['sdii_name'];
?>
<div id="chemin">
	<ul>
		<li>
			<a href="index.php"><? echo $GLOBALS['lang']['way']['home'] ?></a>
		</li>
		<li>
			<a href="<?php echo $rub_link; ?>"><? echo $GLOBALS['lang']['menu']['sdi']?></a>
		</li>
		<li>
			<span><? echo formatnavTitle($navtitle);?></span>
		</li>
	</ul>
</div>
  <!--end barre haute -->
<?php
include_once("quickicons.php");
?>
<div class="contentcontainer">
<?php
include_once($dir."/menurub.php");
?>
<div id="content">
		<h2><? echo formatTitleh2($result_sdii[0]['sdii_name']);?></h2>	
		
		<? echo "<a href=\"".$link_sup.$id."\" title=\"".$GLOBALS['lang']['sdi']['sup']."\" class=\"ico_sup2\">";?></a>
		<? echo "<a href=\"".$link_mod.$id."\" title=\"".$GLOBALS['lang']['sdi']['mod']."\" class=\"ico_mod2\">";?></a>
		
		<dl class="dl2">
		<dt><? echo $GLOBALS['lang']['sdi']['theme'] ?> : </dt>
		<dd><? echo "<a href=\"".$link_det_theme.$result_sdii[0]['sdii_theme']."\" title=\"".formatText($result_sdii[0]['theme_name'], '2HTML')."\">".formatText($result_sdii[0]['theme_name'], '2HTML')."</a></dd>"; ?>
		<dt><? echo $GLOBALS['lang']['sdi']['name2'] ?> :</dt>
		<dd><? echo formatText($result_sdii[0]['sdii_name'], '2HTML');?></dd>
		<?php /*<dt><? echo $GLOBALS['lang']['sdi']['range'] ?> : </dt>
		<dd><? echo formatText($result_sdii[0]['sdii_range'], '2HTML');?></dd> */ ?>
		<dt><? echo $GLOBALS['lang']['sdi']['description'] ?> : </dt>
		<dd><? echo empty_nc(formatText($result_sdii[0]['sdii_description'], '2HTML'));?></dd>
		<dt><? echo $GLOBALS['lang']['sdi']['comment'] ?> : </dt>
		<dd><? echo empty_nc(formatText($result_sdii[0]['sdii_comment'], '2HTML'));?></dd>
		<dt><? echo $GLOBALS['lang']['sdi']['goal'] ?> : </dt>
		<dd><? echo empty_nc(formatText($result_sdii[0]['sdii_goal'], '2HTML'));?></dd>
		<dt><? echo $GLOBALS['lang']['sdi']['consulting'] ?> : </dt>
		<dd><? echo empty_nc(formatText($result_sdii[0]['sdii_consulting'], '2HTML'));?></dd>
		<dt><? echo $GLOBALS['lang']['divers']['statut'] ?>  :</dt>
		<dd><? echo display_statut($result_sdii[0]['sdii_statut']);?></dd>
		<dt><? echo $GLOBALS['lang']['sdi']['threshold_relative'] ?>  :</dt>
		<dd><? 
		if ($result_sdii[0]['sdii_threshold_relative']=='Y') echo $GLOBALS['lang']['sdi']['threshold_relative_Y'];
					else echo $GLOBALS['lang']['sdi']['threshold_relative_N'];
		?></dd>
		</dl>
		<br class="brendstep" />
		<h2>
		<? echo $GLOBALS['lang']['sdi']['info_mesure']; ?>
		</h2>
		
		<br class="brendstep" />
		<table cellspacing="0" cellpadding="3">
		<thead>
		<tr>
		<?
		echo "<td>".$GLOBALS['lang']['sdi']['max_value']." (".$result_sdii[0]['sdii_unit'].")"."</td>\n";
		echo "<td>".$GLOBALS['lang']['sdi']['min_value']." (".$result_sdii[0]['sdii_unit'].")"."</td>\n";
		echo "<td>".$GLOBALS['lang']['sdi']['threshold_value']." (".$result_sdii[0]['sdii_unit'].")"."</td>\n";
		echo "<td>".$GLOBALS['lang']['sdi']['frequency']."</td>\n";
		?>
		</tr>
		</thead>
		<tbody>
		<?echo "<tr>\n";
		echo "<td>". $result_sdii[0]['sdii_max_value']."</td>\n";
		echo "<td>". $result_sdii[0]['sdii_min_value']."</td>\n";
		echo "<td>". $result_sdii[0]['sdii_threshold_value']."</td>\n";
		echo "<td>". $result_sdii[0]['sdii_frequency']."</td>\n";
		echo "</tr>\n";
		?>
		</tbody>
		</table>
		<br class="brendstep" />
		
		
		
		
		
		<div class="sdi_det">
		<a name="affprovider" id="affprovider" style="display:none;"></a>
		<a href="#affprovider" onclick="$('#provider').slideToggle();" title="<?echo $GLOBALS['lang']['sdi']['aff_sdi_p'];?>" ><?echo $GLOBALS['lang']['sdi']['aff_sdi_p'];?></a>
		</div>
		<div id="provider" style="display:none;" >
		<? if ($result_p[0]['sdip_name']=="") {
		   echo "<h2 class=\"info\">".$GLOBALS['lang']['sdi']['noresultp']."</h2>"    
		   ?>
		<? echo "<a href=\"".$link_mod_p.$id."\" title=\"".$GLOBALS['lang']['sdi']['modify_sdi_p']."\" class=\"ico_mod2\">";?></a>
		
		   <?}else {?>
		<h2><? echo formatTitleh2($result_p[0]['sdip_name']);?></h2>	
		
		<? echo "<a href=\"".$link_mod_p.$id."\" title=\"".$GLOBALS['lang']['sdi']['modify_sdi_p']."\" class=\"ico_mod2\">";?></a>
		
		<dl class="dl2">
		<dt><? echo $GLOBALS['lang']['sdi']['p_service'] ?> :</dt>
		<dd><? echo empty_nc(formatText($result_p[0]['sdip_service'], '2HTML'));?></dd>
		<dt><? echo $GLOBALS['lang']['sdi']['p_incharge'] ?> : </dt>
		<dd><? echo empty_nc(formatText($result_p[0]['sdip_incharge'], '2HTML'));?></dd>
		<dt><? echo $GLOBALS['lang']['sdi']['p_address'] ?> : </dt>
		<dd><? echo empty_nc(formatText($result_p[0]['sdip_address'], '2HTML'));?></dd>
		<dt><? echo $GLOBALS['lang']['sdi']['p_phone'] ?> : </dt>
		<dd><? echo empty_nc(formatText($result_p[0]['sdip_phone'], '2HTML'));?></dd>
		<dt><? echo $GLOBALS['lang']['sdi']['p_fax'] ?> : </dt>
		<dd><? echo empty_nc(formatText($result_p[0]['sdip_fax'], '2HTML'));?></dd>
		<dt><? echo $GLOBALS['lang']['sdi']['p_email'] ?> : </dt>
		<dd><? echo "<a href=\"mailto:".$result_p[0]['sdip_email']."\" title=\"".formatText($result_p[0]['sdip_email'], '2HTML')."\" >".formatText($result_p[0]['sdip_email'], '2HTML')."</a>"; ?></dd>
		<dt><? echo $GLOBALS['lang']['sdi']['p_description'] ?>  :</dt>
		<dd><? echo empty_nc(formatText($result_p[0]['sdip_description'], '2HTML'));?></dd>
		</dl>
		<? } ?>
		
		</div>
		<br class="brendstep" />
		

		
		<div class="sdi_det">
		<a name="affeval" id="affeval" style="display:none;"></a>
		<a href="#affeval" onclick="$('#evaluation').slideToggle();" title="<?echo $GLOBALS['lang']['sdi']['aff_sdi_e'];?>" ><?echo $GLOBALS['lang']['sdi']['aff_sdi_e'];?></a>
		</div>
		<div id="evaluation" style="display:none;" >
	<br class="brendstep" />
		<? echo "<a href=\"".$link_mod_e.$id."\" title=\"".$GLOBALS['lang']['sdi']['modify_sdi_e']."\" class=\"ico_mod2\">";?></a>	
		<br class="brendstep" />
		<table cellspacing="0" cellpadding="3">
		<thead>
		<tr>
		<?
		echo "<td>".$GLOBALS['lang']['sdi']['e_scale_compare']."</td>\n";
		echo "<td>".$GLOBALS['lang']['sdi']['e_fiability']."</td>\n";
		echo "<td>".$GLOBALS['lang']['sdi']['e_accessibility']."</td>\n";
		echo "<td>".$GLOBALS['lang']['sdi']['e_lisibility']."</td>\n";
		echo "<td>".$GLOBALS['lang']['sdi']['e_relevance']."</td>\n";
		echo "<td>".$GLOBALS['lang']['sdi']['e_global_performance']."</td>\n";
		?>
		</tr>
		</thead>
		<tbody>
		<?echo "<tr>\n";
		echo "<td>". $result_e[0]['sdie_scale_compare']."</td>\n";
		echo "<td>". $result_e[0]['sdie_fiability']."</td>\n";
		echo "<td>". $result_e[0]['sdie_accessibility']."</td>\n";
		echo "<td>". $result_e[0]['sdie_lisibility']."</td>\n";
		echo "<td>". $result_e[0]['sdie_relevance']."</td>\n";
		echo "<td>". $result_e[0]['sdie_global_performance']."</td>\n";
		echo "</tr>\n";
		?>
		</tbody>
		</table>
		</div>
		<br class="brendstep" />
		
		
		
		
		
		
		
		<div  class="sdi_det">
		<a name="affreg" id="affreg" style="display:none;"></a>
		<a href="#affreg" onclick="$('#reglementation').slideToggle();" title="<?echo $GLOBALS['lang']['sdi']['aff_sdi_r'];?>" ><?echo $GLOBALS['lang']['sdi']['aff_sdi_r'];?></a>
		</div>
		<div id="reglementation" style="display:none;" >
		
		<? if ($result_r[0]['sdir_title']=="") {
		   echo "<h2 class=\"info\">".$GLOBALS['lang']['sdi']['noresultr']."</h2>"    
		?>
		<? echo "<a href=\"".$link_mod_r.$id."\" title=\"".$GLOBALS['lang']['sdi']['modify_sdi_r']."\" class=\"ico_mod2\">";?></a>
		
		   <?}else {?>
		
		<h2><? echo empty_nc(formatTitleh2($result_r[0]['sdir_title']));?></h2>	
		
		<? echo "<a href=\"".$link_mod_r.$id."\" title=\"".$GLOBALS['lang']['sdi']['modify_sdi_r']."\" class=\"ico_mod2\">";?></a>
		
		<dl class="dl2">
		<dt><? echo $GLOBALS['lang']['sdi']['r_referer_uri'] ?> :</dt>
		<? 
		if ($result_r[0]['sdir_referer_uri']<>"") echo "<dd><a href=\"".formatText($result_r[0]['sdir_referer_uri'], '2HTML')."\" title=\"".empty_nc(formatText($result_r[0]['sdir_mask_uri'], '2ATT'))."\" >".empty_nc(formatText($result_r[0]['sdir_mask_uri'], '2HTML'))."</a></dd>";
		
		else echo "<dd>".empty_nc(formatText($result_r[0]['sdir_mask_uri'], '2HTML'))."</dd>";
		 ?>
		</dl>
		
		<p class="brendstep" >
		<? echo empty_nc(formatText($result_r[0]['sdir_body'], '2HTML')); ?>
		</p>
		<? } ?>
		<br class="brendstep" />
		</div>
</div>
<?php include_once($dir."/help.php"); ?>
</div>

