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_det_indicator="index.php?rub=sdi&amp;todo=det&amp;id=";
  66. $link_sup=$rub_link."&amp;todo=sup&amp;value_id=";
  67. $link_mod=$rub_link."&amp;todo=mod&amp;value_id=";
  68. $link_add=$rub_link."&amp;todo=add&amp;id=";
  69. $navtitle=_t('dashboard','det')." : ".$result_sdii[0]['sdii_name'];
  70. //valeur du graphique
  71. ?>
  72. <div id="chemin">
  73. <ul>
  74.     <li><a href="index.php" class="chemin_home"><?php echo _t('way','home'?></a></li>
  75.     <li><a href="<?php echo $rub_link?>" id="chemin_<?php echo $rub?>" class="chemin_rub"><?php echo _t('menu','dashboard')?></a></li>
  76.     <li><span><?php echo formatnavTitle($navtitle);    ?></span></li>
  77. </ul>
  78. </div>
  79. <!--end barre haute -->
  80.     <?php
  81.     include_once(THEME_ADMIN_PATH."quickicons.php");
  82.     ?>
  83. <div class="contentcontainer"><?php
  84. include_once(override($dir.'/menurub.php'THEME_ADMIN_PATH));
  85. ?>
  86. <div id="content">
  87. <h2><?php echo formatTitleh2($result_sdii[0]['sdii_name'])?></h2>
  88. <div class="iconetodo2">
  89. <?php echo "<a href=\"".$link_add.$id."&amp;scale_id=".$scale_id."\" title=\""._t('dashboard','add')."\" class=\"ico_add2\">";?><i class="icon-plus-circled"></i><span><?php echo _t('dashboard','add')?></span></a>
  90. <?php echo "<a href=\"".$link_det_indicator.$id."\" title=\""._t('sdi','det')."\" class=\"ico_generic2 no-action\">";?><i class="icon-eye"></i><span><?php echo _t('sdi','det')?></span></a>
  91. </div>
  92.  
  93. <?php if ($result_value<>false{?> <br />
  94. <?php if (count($result_value2{?> 
  95.     <img src="<?php echo override('../dashboard/graph.php')?>?id=<?php echo $id?>&amp;scale_id=<?php echo $scale_id?>&amp;display=true" id="imggraph" class="graph" alt="<?php echo _t('dashboard','all_value');?>" />
  96. <?php ?>
  97. <h2><?php echo formatTitleh2(_t('dashboard','all_value')." / ".$resultscale2[0]['scale_denomination'])?></h2>
  98. <table cellspacing="0" cellpadding="3" class="multisort">
  99.     <thead>
  100.         <tr>
  101.         <?php
  102.         echo "<td>".mb_ucfirst(_t('dashboard','date'))."</td>\n";
  103.         echo "<td>".mb_ucfirst(_t('dashboard','value'))." (".formatText($result_sdii[0]['sdii_unit']'2HTML').")"."</td>\n";
  104.         echo "<td>".mb_ucfirst(_t('dashboard','threshold_value'))."</td>\n";
  105.         echo "<td>".mb_ucfirst(_t('dashboard','rate'))."</td>\n";
  106.         echo "<td>".mb_ucfirst(_t('dashboard','comment'))."</td>\n";
  107.         echo "<td class=\"sorter-false\">&nbsp;</td>\n";
  108.         ?>
  109.         </tr>
  110.     </thead>
  111.     <tbody>
  112.     <?php
  113.     for ($i=0;$i<count($result_value);$i++){
  114.       $comment '';
  115.       
  116.       // if set, we get it from the table
  117.       if(!is_null($result_value[$i]['sdiv_threshold'])) {
  118.           $threshold $result_value[$i]['sdiv_threshold'];
  119.       else {
  120.           $threshold $default_threshold;
  121.       }
  122.       if(isset($result_value[$i+1]['sdiv_value']&& is_numeric($result_value[$i+1]['sdiv_value'])) {
  123.           $evol ($result_value[$i]['sdiv_value'$result_value[$i+1]['sdiv_value']$result_value[$i+1]['sdiv_value'100;
  124.             // _debug('rate : '. fnumber_format($evol, 2, ',', ' '). ' %  - details : ('.$result_value[$i]['sdiv_value']. ' - ' . $result_value[$i+1]['sdiv_value']. ') / '. $result_value[$i+1]['sdiv_value']);
  125.           $evol fnumber_format($evol2','' ')' %';;
  126.       else {
  127.           $evol empty_nc('');
  128.       }
  129.       
  130.       ($result_value[$i]['sdiv_comment_display'== 'Y'$comment_status _t('dashboard''public'$comment_status _t('dashboard''private');
  131.       if(!empty($result_value[$i]['sdiv_comment'])) {
  132.         $comment  '<div class="valuecomment">';
  133.         $comment .= '<img src="'.THEME_ADMIN_PATH.'images/infobull.gif" />';
  134.         $comment .= '<div class="cont"><strong>'.ucfirst(_t('dashboard''comment')).' ('.$comment_status.') :</strong> '.$result_value[$i]['sdiv_comment'].'</div>';
  135.         $comment .= '</div>';
  136.       }
  137.       echo "<tr>\n";
  138.       echo "<td>"formatText($result_value[$i]['date_p']'2HTML')."</td>\n";
  139.       echo "<td>"formatText($result_value[$i]['sdiv_value']'2HTML');
  140.  
  141.       if ($result_value[$i]['sdiv_statut']=='D'{
  142.         echo "<span class=\"state\">".mb_ucfirst(_t('statut','draft'))."</span>";
  143.       }
  144.       echo "</td>\n";
  145.       echo "<td class=\"threshold\">"$threshold."</td>\n";
  146.       echo "<td class=\"rate\">"$evol."</td>\n";
  147.       echo "<td>"$comment."</td>\n";
  148.       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\"><i class=\"icon-trash\"></i><span>" _t('dashboard','sup'"</span></a>";
  149.       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\"><i class=\"icon-pencil\"></i><span>" _t('dashboard','mod'"</span></a></div></td>\n";
  150.       echo "</tr>\n";
  151.  
  152.     }
  153.     
  154.     // Ability to sort table
  155.     addDynamicCSS('../lib/js/jquery.tablesorter/theme.default.css');
  156.     footerAddJS('../lib/js/jquery.tablesorter/jquery.tablesorter.min.js');
  157.     $str '$("table.multisort").tablesorter({    });';
  158.     footerAddInlineJS($str);
  159.     ?>
  160.     </tbody>
  161. </table>
  162.     <?php }
  163.     else echo "<div class=\"info\">"._t('dashboard','novalue').": ".formatText($resultscale2[0]['scale_denomination']'2HTML')."</div>";
  164.     ?>
  165.  
  166. <dl class="dl2">
  167.     <dt><?php echo mb_ucfirst(_t('sdi','theme')) ?> :</dt>
  168.     <dd><?php 
  169.     if ($l21auth->isSuperAdmin())
  170.     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>";
  171.     else echo formatText($result_sdii[0]['theme_name']'2HTML');
  172.     ?></dd>
  173.     <dt><?php echo mb_ucfirst(_t('sdi','description')) ?> :</dt>
  174.     <dd><?php echo formatText($result_sdii[0]['sdii_description']'2HTML');?></dd>
  175.     <dt><?php echo mb_ucfirst(_t('sdi','threshold_relative')) ?> :</dt>
  176.     <dd><?php 
  177.     if ($result_sdii[0]['sdii_threshold_relative']=='Y'echo mb_ucfirst(_t('sdi','threshold_relative_Y'));
  178.     else echo mb_ucfirst(_t('sdi','threshold_relative_N'));
  179.     ?></dd>
  180. </dl>
  181.  
  182.  
  183. <h2><?php echo _t('sdi','info_mesure')?></h2>
  184.  
  185. <table cellspacing="0" cellpadding="3">
  186.     <thead>
  187.         <tr>
  188.         <?php
  189.         echo "<td>".mb_ucfirst(_t('sdi','min_value'))." (".formatText($result_sdii[0]['sdii_unit']'2HTML').")"."</td>\n";
  190.         echo "<td>".mb_ucfirst(_t('sdi','max_value'))." (".formatText($result_sdii[0]['sdii_unit']'2HTML').")"."</td>\n";
  191.         echo "<td>".mb_ucfirst(_t('sdi','initial_threshold_value'))." (".formatText($result_sdii[0]['sdii_unit']'2HTML').")"."</td>\n";
  192.         echo "<td>".mb_ucfirst(_t('sdi','frequency'))."</td>\n";
  193.         ?>
  194.         </tr>
  195.     </thead>
  196.     <tbody>
  197.     <?php echo "<tr>\n";
  198.     echo "<td>"formatText(empty_nc($result_sdii[0]['sdii_min_value'])'2HTML')."</td>\n";
  199.     echo "<td>"formatText(empty_nc($result_sdii[0]['sdii_max_value'])'2HTML')."</td>\n";
  200.     echo "<td>"formatText(empty_nc($result_sdii[0]['sdii_threshold_value'])'2HTML')."</td>\n";
  201.     echo "<td>"formatText($result_sdii[0]['sdii_frequency']'2HTML')."</td>\n";
  202.     echo "</tr>\n";
  203.     ?>
  204.     </tbody>
  205. </table>
  206.  
  207. <div class="toggle_title">
  208.     <a href="" id="affinfoge"><?php echo mb_ucfirst(_t('dashboard','det_sdi'));?></a>
  209. </div>
  210. <div id="general" style="display: none;">
  211. <dl class="dl2">
  212.  
  213. <?php /*<dt><?php echo mb_ucfirst(_t('sdi','range')) ?> : </dt>
  214. <dd><?php echo formatText(empty_nc($result_sdii[0]['sdii_range']), '2HTML');?></dd> */ ?>
  215.     <dt><?php echo mb_ucfirst(_t('sdi','comment')) ?> :</dt>
  216.     <dd><?php echo formatText(empty_nc($result_sdii[0]['sdii_comment'])'2HTML');?></dd>
  217.     <dt><?php echo mb_ucfirst(_t('sdi','goal')) ?> :</dt>
  218.     <dd><?php echo formatText(empty_nc($result_sdii[0]['sdii_goal'])'2HTML');?></dd>
  219.     <dt><?php echo mb_ucfirst(_t('sdi','consulting')) ?> :</dt>
  220.     <dd><?php echo formatText(empty_nc($result_sdii[0]['sdii_consulting'])'2HTML');?></dd>
  221.     <dt><?php echo mb_ucfirst(_t('divers','statut')) ?> :</dt>
  222.     <dd><?php echo display_statut($result_sdii[0]['sdii_statut']);?></dd>
  223. </dl>
  224. </div>
  225.  
  226. <div class="toggle_title">
  227.     <a href="#" id="affprovider"><?php echo _t('sdi','aff_sdi_p');?></a>
  228. </div>
  229. <div id="provider" style="display: none;"><?php if ($result_p[0]['sdip_name']==""{
  230.   echo "<h2 class=\"info\">"._t('divers','nodata')."</h2>";
  231. }else {?> <?php
  232. if(empty($result_p[0]['sdip_email'])) {
  233.   $mailto_provider empty_nc($result_p[0]['sdip_email']);
  234. else {
  235.   $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>";
  236. }
  237. ?>
  238. <h2><?php echo formatText(empty_nc($result_p[0]['sdip_name'])'2HTML');?></h2>
  239. <dl class="dl2">
  240.     <dt><?php echo mb_ucfirst(_t('sdi','p_service')) ?> :</dt>
  241.     <dd><?php echo formatText(empty_nc($result_p[0]['sdip_service'])'2HTML');?></dd>
  242.     <dt><?php echo mb_ucfirst(_t('sdi','p_incharge')) ?>    :</dt>
  243.     <dd><?php echo formatText(empty_nc($result_p[0]['sdip_incharge'])'2HTML');?></dd>
  244.     <dt><?php echo mb_ucfirst(_t('sdi','p_address')) ?> :</dt>
  245.     <dd><?php echo formatText(empty_nc($result_p[0]['sdip_address'])'2HTML');?></dd>
  246.     <dt><?php echo mb_ucfirst(_t('sdi','p_phone')) ?> :</dt>
  247.     <dd><?php echo formatText(empty_nc($result_p[0]['sdip_phone'])'2HTML');?></dd>
  248.     <dt><?php echo mb_ucfirst(_t('sdi','p_fax')) ?> :</dt>
  249.     <dd><?php echo formatText(empty_nc($result_p[0]['sdip_fax'])'2HTML');?></dd>
  250.     <dt><?php echo mb_ucfirst(_t('sdi','p_email')) ?> :</dt>
  251.     <dd><?php echo $mailto_provider?></dd>
  252.     <dt><?php echo mb_ucfirst(_t('sdi','p_description')) ?> :</dt>
  253.     <dd><?php echo formatText(empty_nc($result_p[0]['sdip_description'])'2HTML');?></dd>
  254. </dl>
  255. <?php ?></div>
  256.  
  257. <div class="toggle_title"> 
  258.     <a href="#" id="affeval"><?php echo _t('sdi','aff_sdi_e');?></a>
  259. </div>
  260. <div id="evaluation" style="display: none;">
  261. <table cellspacing="0" cellpadding="3">
  262.     <thead>
  263.         <tr>
  264.         <?php
  265.         echo "<td>".mb_ucfirst(_t('sdi','e_scale_compare'))."</td>\n";
  266.         echo "<td>".mb_ucfirst(_t('sdi','e_fiability'))."</td>\n";
  267.         echo "<td>".mb_ucfirst(_t('sdi','e_accessibility'))."</td>\n";
  268.         echo "<td>".mb_ucfirst(_t('sdi','e_lisibility'))."</td>\n";
  269.         echo "<td>".mb_ucfirst(_t('sdi','e_relevance'))."</td>\n";
  270.         echo "<td>".mb_ucfirst(_t('sdi','e_global_performance'))."</td>\n";
  271.         ?>
  272.         </tr>
  273.     </thead>
  274.     <tbody>
  275.     <?php echo "<tr>\n";
  276.     echo "<td>"empty_nc($result_e[0]['sdie_scale_compare'])."</td>\n";
  277.     echo "<td>"empty_nc($result_e[0]['sdie_fiability'])."</td>\n";
  278.     echo "<td>"empty_nc($result_e[0]['sdie_accessibility'])."</td>\n";
  279.     echo "<td>"empty_nc($result_e[0]['sdie_lisibility'])."</td>\n";
  280.     echo "<td>"empty_nc($result_e[0]['sdie_relevance'])."</td>\n";
  281.     echo "<td>"empty_nc($result_e[0]['sdie_global_performance'])."</td>\n";
  282.     echo "</tr>\n";
  283.     ?>
  284.     </tbody>
  285. </table>
  286. </div>
  287.  
  288. <div class="toggle_title">
  289.     <a href="#" id="affreg"><?php echo _t('sdi','aff_sdi_r');?></a>
  290. </div>
  291. <div id="reglementation" style="display: none;"><?php if ($result_r[0]['sdir_title']==""{
  292.   echo "<h2 class=\"info\">"._t('divers','nodata')."</h2>";
  293. }else {?> <?php
  294. if(empty($result_r[0]['sdir_referer_uri'])) {
  295.   $rules_link empty_nc($result_r[0]['sdir_referer_uri']);
  296. else {
  297.   $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>";
  298. }
  299. ?>
  300. <h2><?php echo formatText(empty_nc($result_r[0]['sdir_title'])'2HTML');?></h2>
  301.  
  302. <dl class="dl2">
  303.     <dt><?php echo mb_ucfirst(_t('sdi','r_referer_uri')) ?> :</dt>
  304.     <dd><?php echo $rules_link"</dd>"?>
  305. </dl>
  306.  
  307. <div>
  308.   <?php echo formatText(empty_nc($result_r[0]['sdir_body'])'2HTML')?>
  309. </div>
  310. <?php ?>
  311. </div>
  312. </div>
  313. <?php include_once(override($dir.'/help.php'THEME_ADMIN_PATH))?></div>
  314.  
  315. <script type="text/javascript">
  316. $(document).ready(function() {
  317.     $(".valuecomment").hover(
  318.         function() {
  319.             $('.cont', this).fadeIn();
  320.         },
  321.         function() {
  322.             $('.cont', this).hide();
  323.         }
  324.     );
  325. })
  326. </script>

Documentation generated on Thu, 20 Mar 2014 16:47:26 +0100 by phpDocumentor 1.4.1