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

Source for file det.php

Documentation is available at det.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 (!class_exists('auth')){
  13.   include_once("../lib/lib_common.php");
  14.   ReloadIndex('admin');
  15. }
  16. ////////////
  17.  
  18. //////////// Check Droits utilisateur ////////////
  19. if (!$l21auth->hasRight('dashboard')) ReloadIndex('admin');
  20. ////////////
  21.  
  22. if(!isset($_GET['id']&& !isset($_POST['id'])) {
  23.   $id="1";
  24. else {
  25.   if(isset($_POST['id']))    $id=$_POST['id'];
  26.   if(isset($_GET['id']))    $id=$_GET['id'];
  27. }
  28. if(!isset($_GET['scale_id']&& !isset($_POST['scale_id'])) {
  29.   $scale_id=1;
  30. else {
  31.   if(isset($_POST['scale_id']))    $scale_id=$_POST['scale_id'];
  32.   if(isset($_GET['scale_id']))    $scale_id=$_GET['scale_id'];
  33. }
  34.  
  35. $sdi_objectnew sdi;
  36. //$result_sdii=$sdi_object->GetInfoSdi($id, $sql_object);
  37. //$result_e=$sdi_object->GetEvaluation( $id, $sql_object, $ID=-1);
  38. //$result_p=$sdi_object->GetProvider( $id, $sql_object, $ID=-1);
  39. //$result_r=$sdi_object->GetRules( $id, $sql_object, $ID=-1);
  40. $req_sdii=SQL_getInfoSdi($id);
  41. $result_sdii $sql_object -> DBSelect($req_sdii);
  42.  
  43. // setting $default_threshold value
  44. // By default initial value
  45. $default_threshold $result_sdii[0]['sdii_threshold_value'];
  46.  
  47. $req_sdir=SQL_getRules$id$sql_object$ID=-1);
  48. $result_r $sql_object -> DBSelect($req_sdir);
  49.  
  50. $req_sdie=SQL_getEvaluation$id$sql_object$ID=-1);
  51. $result_e $sql_object -> DBSelect($req_sdie);
  52.  
  53. $req_sdip=SQL_getProvider$id$sql_object$ID=-1);
  54. $result_p $sql_object -> DBSelect($req_sdip);
  55.  
  56. $req_sdiav=SQL_getAllValue("SCA"$scale_id$id);
  57. $result_value $sql_object -> DBSelect($req_sdiav);
  58.  
  59. //$result_value=$sdi_object->GetAllValue("SCA", $scale_id, $id, $sql_object);
  60. $req_scale=SQL_getonescale($scale_id);
  61. $resultscale2 $sql_object -> DBSelect($req_scale);
  62.  
  63. $link_det=$rub_link."&amp;todo=det&amp;id=";
  64. $link_det_theme="index.php?rub=theme&amp;todo=det&amp;id=";
  65. $link_sup=$rub_link."&amp;todo=sup&amp;value_id=";
  66. $link_mod=$rub_link."&amp;todo=mod&amp;value_id=";
  67. $link_add=$rub_link."&amp;todo=add&amp;id=";
  68. $navtitle=_t('dashboard','det')." : ".$result_sdii[0]['sdii_name'];
  69. //valeur du graphique
  70. ?>
  71. <div id="chemin">
  72. <ul>
  73.     <li><a href="index.php" class="chemin_home"><?php echo _t('way','home'?></a></li>
  74.     <li><a href="<?php echo $rub_link?>" id="chemin_<?php echo $rub?>" class="chemin_rub"><?php echo _t('menu','dashboard')?></a></li>
  75.     <li><span><?php echo formatnavTitle($navtitle);    ?></span></li>
  76. </ul>
  77. </div>
  78. <!--end barre haute -->
  79.     <?php
  80.     include_once(THEME_ADMIN_PATH."quickicons.php");
  81.     ?>
  82. <div class="contentcontainer"><?php
  83. include_once(override($dir.'/menurub.php'THEME_ADMIN_PATH));
  84. ?>
  85. <div id="content">
  86. <h2><?php echo formatTitleh2($result_sdii[0]['sdii_name'])?></h2>
  87. <div class="iconetodo2"><?php echo "<a href=\"".$link_add.$id."&amp;scale_id=".$scale_id."\" title=\""._t('dashboard','add')."\" class=\"ico_add2\">";?></a>
  88. </div>
  89.  
  90. <?php if ($result_value<>false{?> <br />
  91. <?php if (count($result_value2{?> 
  92.     <img src="../dashboard/graph.php?id=<?php echo $id?>&amp;scale_id=<?php echo $scale_id?>" id="imggraph" class="graph" alt="<?php echo _t('dashboard','all_value');?>" />
  93. <?php ?>
  94. <h2><?php echo formatTitleh2(_t('dashboard','all_value')." / ".$resultscale2[0]['scale_denomination'])?></h2>
  95. <table cellspacing="0" cellpadding="3">
  96.     <thead>
  97.         <tr>
  98.         <?php
  99.         echo "<td>".mb_ucfirst(_t('dashboard','date'))."</td>\n";
  100.         echo "<td>".mb_ucfirst(_t('dashboard','value'))." (".formatText($result_sdii[0]['sdii_unit']'2HTML').")"."</td>\n";
  101.         echo "<td>".mb_ucfirst(_t('dashboard','threshold_value'))."</td>\n";
  102.         echo "<td>".mb_ucfirst(_t('dashboard','comment'))."</td>\n";
  103.         echo "<td>&nbsp;</td>\n";
  104.         ?>
  105.         </tr>
  106.     </thead>
  107.     <tbody>
  108.     <?php
  109.     for ($i=0;$i<count($result_value);$i++){
  110.       $comment '';
  111.       
  112.       // if set, we get it from the table
  113.       if(!is_null($result_value[$i]['sdiv_threshold'])) {
  114.           $threshold $result_value[$i]['sdiv_threshold'];
  115.       else {
  116.           $threshold $default_threshold;
  117.       }
  118.       
  119.       ($result_value[$i]['sdiv_comment_display'== 'Y'$comment_status _t('dashboard''public'$comment_status _t('dashboard''private');
  120.       if(!empty($result_value[$i]['sdiv_comment'])) {
  121.         $comment  '<div class="valuecomment">';
  122.         $comment .= '<img src="'.THEME_ADMIN_PATH.'images/infobull.gif" />';
  123.         $comment .= '<div class="cont"><strong>'.ucfirst(_t('dashboard''comment')).' ('.$comment_status.') :</strong> '.$result_value[$i]['sdiv_comment'].'</div>';
  124.         $comment .= '</div>';
  125.       }
  126.       echo "<tr>\n";
  127.       echo "<td>"formatText($result_value[$i]['date_p']'2HTML')."</td>\n";
  128.       echo "<td>"formatText($result_value[$i]['sdiv_value']'2HTML');
  129.  
  130.       if ($result_value[$i]['sdiv_statut']=='D'{
  131.         echo "<span class=\"state\">".mb_ucfirst(_t('statut','draft'))."</span>";
  132.       }
  133.       echo "</td>\n";
  134.       echo "<td class=\"threshold\">"$threshold."</td>\n";
  135.       echo "<td>"$comment."</td>\n";
  136.       echo "<td><div class=\"iconetab\"><a href=\"".$link_sup.$result_value[$i]['sdiv_id']."&amp;id=".$id."&amp;scale_id=".$scale_id."\" title=\""._t('dashboard','sup')."\" class=\"ico_sup\"></a>";
  137.       echo "<a href=\"".$link_mod.$result_value[$i]['sdiv_id']."&amp;id=".$id."&amp;scale_id=".$scale_id."\" title=\""._t('dashboard','mod')."\" class=\"ico_mod\"></a></div></td>\n";
  138.       echo "</tr>\n";
  139.  
  140.     }
  141.     ?>
  142.     </tbody>
  143. </table>
  144.     <?php }
  145.     else echo "<div class=\"info\">"._t('dashboard','novalue').": ".formatText($resultscale2[0]['scale_denomination']'2HTML')."</div>";
  146.     ?>
  147.  
  148. <dl class="dl2">
  149.     <dt><?php echo mb_ucfirst(_t('sdi','theme')) ?> :</dt>
  150.     <dd><?php 
  151.     if ($l21auth->isSuperAdmin())
  152.     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>";
  153.     else echo formatText($result_sdii[0]['theme_name']'2HTML');
  154.     ?></dd>
  155.     <dt><?php echo mb_ucfirst(_t('sdi','description')) ?> :</dt>
  156.     <dd><?php echo formatText($result_sdii[0]['sdii_description']'2HTML');?></dd>
  157.     <dt><?php echo mb_ucfirst(_t('sdi','threshold_relative')) ?> :</dt>
  158.     <dd><?php 
  159.     if ($result_sdii[0]['sdii_threshold_relative']=='Y'echo mb_ucfirst(_t('sdi','threshold_relative_Y'));
  160.     else echo mb_ucfirst(_t('sdi','threshold_relative_N'));
  161.     ?></dd>
  162. </dl>
  163.  
  164.  
  165. <h2><?php echo _t('sdi','info_mesure')?></h2>
  166.  
  167. <table cellspacing="0" cellpadding="3">
  168.     <thead>
  169.         <tr>
  170.         <?php
  171.         echo "<td>".mb_ucfirst(_t('sdi','max_value'))." (".formatText($result_sdii[0]['sdii_unit']'2HTML').")"."</td>\n";
  172.         echo "<td>".mb_ucfirst(_t('sdi','min_value'))." (".formatText($result_sdii[0]['sdii_unit']'2HTML').")"."</td>\n";
  173.         echo "<td>".mb_ucfirst(_t('sdi','initial_threshold_value'))." (".formatText($result_sdii[0]['sdii_unit']'2HTML').")"."</td>\n";
  174.         echo "<td>".mb_ucfirst(_t('sdi','frequency'))."</td>\n";
  175.         ?>
  176.         </tr>
  177.     </thead>
  178.     <tbody>
  179.     <?php echo "<tr>\n";
  180.     echo "<td>"formatText(empty_nc($result_sdii[0]['sdii_max_value'])'2HTML')."</td>\n";
  181.     echo "<td>"formatText(empty_nc($result_sdii[0]['sdii_min_value'])'2HTML')."</td>\n";
  182.     echo "<td>"formatText(empty_nc($result_sdii[0]['sdii_threshold_value'])'2HTML')."</td>\n";
  183.     echo "<td>"formatText($result_sdii[0]['sdii_frequency']'2HTML')."</td>\n";
  184.     echo "</tr>\n";
  185.     ?>
  186.     </tbody>
  187. </table>
  188.  
  189. <div class="toggle_title">
  190.     <a href="" id="affinfoge"><?php echo _t('dashboard','det_sdi');?></a>
  191. </div>
  192. <div id="general" style="display: none;">
  193. <dl class="dl2">
  194.  
  195. <?php /*<dt><?php echo mb_ucfirst(_t('sdi','range')) ?> : </dt>
  196. <dd><?php echo formatText(empty_nc($result_sdii[0]['sdii_range']), '2HTML');?></dd> */ ?>
  197.     <dt><?php echo mb_ucfirst(_t('sdi','comment')) ?> :</dt>
  198.     <dd><?php echo formatText(empty_nc($result_sdii[0]['sdii_comment'])'2HTML');?></dd>
  199.     <dt><?php echo mb_ucfirst(_t('sdi','goal')) ?> :</dt>
  200.     <dd><?php echo formatText(empty_nc($result_sdii[0]['sdii_goal'])'2HTML');?></dd>
  201.     <dt><?php echo mb_ucfirst(_t('sdi','consulting')) ?> :</dt>
  202.     <dd><?php echo formatText(empty_nc($result_sdii[0]['sdii_consulting'])'2HTML');?></dd>
  203.     <dt><?php echo mb_ucfirst(_t('divers','statut')) ?> :</dt>
  204.     <dd><?php echo display_statut($result_sdii[0]['sdii_statut']);?></dd>
  205. </dl>
  206. </div>
  207.  
  208. <div class="toggle_title">
  209.     <a href="#" id="affprovider"><?php echo _t('sdi','aff_sdi_p');?></a>
  210. </div>
  211. <div id="provider" style="display: none;"><?php if ($result_p[0]['sdip_name']==""{
  212.   echo "<h2 class=\"info\">"._t('divers','nodata')."</h2>";
  213. }else {?> <?php
  214. if(empty($result_p[0]['sdip_email'])) {
  215.   $mailto_provider empty_nc($result_p[0]['sdip_email']);
  216. else {
  217.   $mailto_provider =  "<a href=\"mailto:".formatText(empty_nc($result_p[0]['sdip_email'])'2HTML')."\" title=\"".formatText(empty_nc($result_p[0]['sdip_email'])'2HTML')."\">".formatText(empty_nc($result_p[0]['sdip_email'])'2HTML')."</a>";
  218. }
  219. ?>
  220. <h2><?php echo formatText(empty_nc($result_p[0]['sdip_name'])'2HTML');?></h2>
  221. <dl class="dl2">
  222.     <dt><?php echo mb_ucfirst(_t('sdi','p_service')) ?> :</dt>
  223.     <dd><?php echo formatText(empty_nc($result_p[0]['sdip_service'])'2HTML');?></dd>
  224.     <dt><?php echo mb_ucfirst(_t('sdi','p_incharge')) ?>    :</dt>
  225.     <dd><?php echo formatText(empty_nc($result_p[0]['sdip_incharge'])'2HTML');?></dd>
  226.     <dt><?php echo mb_ucfirst(_t('sdi','p_address')) ?> :</dt>
  227.     <dd><?php echo formatText(empty_nc($result_p[0]['sdip_address'])'2HTML');?></dd>
  228.     <dt><?php echo mb_ucfirst(_t('sdi','p_phone')) ?> :</dt>
  229.     <dd><?php echo formatText(empty_nc($result_p[0]['sdip_phone'])'2HTML');?></dd>
  230.     <dt><?php echo mb_ucfirst(_t('sdi','p_fax')) ?> :</dt>
  231.     <dd><?php echo formatText(empty_nc($result_p[0]['sdip_fax'])'2HTML');?></dd>
  232.     <dt><?php echo mb_ucfirst(_t('sdi','p_email')) ?> :</dt>
  233.     <dd><?php echo $mailto_provider?></dd>
  234.     <dt><?php echo mb_ucfirst(_t('sdi','p_description')) ?> :</dt>
  235.     <dd><?php echo formatText(empty_nc($result_p[0]['sdip_description'])'2HTML');?></dd>
  236. </dl>
  237. <?php ?></div>
  238.  
  239. <div class="toggle_title"> 
  240.     <a href="#" id="affeval"><?php echo _t('sdi','aff_sdi_e');?></a>
  241. </div>
  242. <div id="evaluation" style="display: none;">
  243. <table cellspacing="0" cellpadding="3">
  244.     <thead>
  245.         <tr>
  246.         <?php
  247.         echo "<td>".mb_ucfirst(_t('sdi','e_scale_compare'))."</td>\n";
  248.         echo "<td>".mb_ucfirst(_t('sdi','e_fiability'))."</td>\n";
  249.         echo "<td>".mb_ucfirst(_t('sdi','e_accessibility'))."</td>\n";
  250.         echo "<td>".mb_ucfirst(_t('sdi','e_lisibility'))."</td>\n";
  251.         echo "<td>".mb_ucfirst(_t('sdi','e_relevance'))."</td>\n";
  252.         echo "<td>".mb_ucfirst(_t('sdi','e_global_performance'))."</td>\n";
  253.         ?>
  254.         </tr>
  255.     </thead>
  256.     <tbody>
  257.     <?php echo "<tr>\n";
  258.     echo "<td>"empty_nc($result_e[0]['sdie_scale_compare'])."</td>\n";
  259.     echo "<td>"empty_nc($result_e[0]['sdie_fiability'])."</td>\n";
  260.     echo "<td>"empty_nc($result_e[0]['sdie_accessibility'])."</td>\n";
  261.     echo "<td>"empty_nc($result_e[0]['sdie_lisibility'])."</td>\n";
  262.     echo "<td>"empty_nc($result_e[0]['sdie_relevance'])."</td>\n";
  263.     echo "<td>"empty_nc($result_e[0]['sdie_global_performance'])."</td>\n";
  264.     echo "</tr>\n";
  265.     ?>
  266.     </tbody>
  267. </table>
  268. </div>
  269.  
  270. <div class="toggle_title">
  271.     <a href="#" id="affreg"><?php echo _t('sdi','aff_sdi_r');?></a>
  272. </div>
  273. <div id="reglementation" style="display: none;"><?php if ($result_r[0]['sdir_title']==""{
  274.   echo "<h2 class=\"info\">"._t('divers','nodata')."</h2>";
  275. }else {?> <?php
  276. if(empty($result_r[0]['sdir_referer_uri'])) {
  277.   $rules_link empty_nc($result_r[0]['sdir_referer_uri']);
  278. else {
  279.   $rules_link "<a href=\"".formatText(empty_nc($result_r[0]['sdir_referer_uri'])'2HTML')."\" title=\"".formatText(empty_nc($result_r[0]['sdir_mask_uri'])'2HTML')."\" class=\"out\">".formatText(empty_nc($result_r[0]['sdir_mask_uri'])'2HTML')."</a>";
  280. }
  281. ?>
  282. <h2><?php echo formatText(empty_nc($result_r[0]['sdir_title'])'2HTML');?></h2>
  283.  
  284. <dl class="dl2">
  285.     <dt><?php echo mb_ucfirst(_t('sdi','r_referer_uri')) ?> :</dt>
  286.     <dd><?php echo $rules_link"</dd>"?>
  287. </dl>
  288.  
  289. <div>
  290.   <?php echo formatText(empty_nc($result_r[0]['sdir_body'])'2HTML')?>
  291. </div>
  292. <?php ?>
  293. </div>
  294. </div>
  295. <?php include_once(override($dir.'/help.php'THEME_ADMIN_PATH))?></div>
  296.  
  297. <script type="text/javascript">
  298. $(document).ready(function() {
  299.     $(".valuecomment").hover(
  300.         function() {
  301.             $('.cont', this).fadeIn();
  302.         },
  303.         function() {
  304.             $('.cont', this).hide();
  305.         }
  306.     );
  307. })
  308. </script>

Documentation generated on Mon, 08 Apr 2013 18:13:40 +0200 by phpDocumentor 1.4.1