<?php
class app_grid_sec_groups_dsp_lookup
{
//  
   function lookup_structure(&$conteudo , $structure) 
   {   
      static $save_conteudo = "" ; 
      static $save_conteudo1 = "" ; 
      $tst_cache = $structure; 
      if ($tst_cache === $save_conteudo && $conteudo != "&nbsp;") 
      { 
          $conteudo = $save_conteudo1 ; 
          return ; 
      } 
      $save_conteudo = $tst_cache ; 
      $nm_comando = "select nom_structure from \"public\".structures_sante where code_structure = '" . substr($this->Db->qstr($structure), 1 , -1) . "' order by nom_structure" ; 
      $conteudo = "" ; 
      $_SESSION['scriptcase']['sc_sql_ult_comando'] = $nm_comando; 
      $_SESSION['scriptcase']['sc_sql_ult_conexao'] = ''; 
      if ($rx = $this->Db->Execute($nm_comando)) 
      { 
          if (isset($rx->fields[0]))  
          { 
              $conteudo = $rx->fields[0]; 
          } 
          $save_conteudo1 = $conteudo ; 
          $rx->Close(); 
      } 
      elseif ($GLOBALS["NM_ERRO_IBASE"] != 1)  
      { 
          $this->Erro->mensagem(__FILE__, __LINE__, "banco", $this->Ini->Nm_lang['lang_errm_dber'], $this->Db->ErrorMsg()); 
          exit; 
      } 
      if ($conteudo === "") 
      { 
          $conteudo = "&nbsp;";
          $save_conteudo1 = $conteudo ; 
      } 
   }  
//  
   function lookup_mobile(&$mobile) 
   {
      $conteudo = "" ; 
      if ($mobile == "O")
      { 
          $conteudo = "Oui";
      } 
      if ($mobile == "N")
      { 
          $conteudo = "Non";
      } 
      if (!empty($conteudo)) 
      { 
          $mobile = $conteudo; 
      } 
   }  
//  
   function lookup_scope(&$scope) 
   {
      $conteudo = "" ; 
      if ($scope == "N")
      { 
          $conteudo = "Nationale";
      } 
      if ($scope == "L")
      { 
          $conteudo = "Locale";
      } 
      if ($scope == "E")
      { 
          $conteudo = "Etablissement";
      } 
      if (!empty($conteudo)) 
      { 
          $scope = $conteudo; 
      } 
   }  
//  
   function lookup_profile(&$profile) 
   {
      $conteudo = "" ; 
      if ($profile == "O")
      { 
          $conteudo = "Oui";
      } 
      if ($profile == "N")
      { 
          $conteudo = "Non";
      } 
      if (!empty($conteudo)) 
      { 
          $profile = $conteudo; 
      } 
   }  
//  
   function lookup_role(&$role) 
   {
      $conteudo = "" ; 
      if ($role == "R")
      { 
          $conteudo = "Rapporteur MDO";
      } 
      if ($role == "L")
      { 
          $conteudo = "Biologiste de Laboratoire";
      } 
      if ($role == "S")
      { 
          $conteudo = "Superviseur SEMEP";
      } 
      if ($role == "W")
      { 
          $conteudo = "Superviseur Wilaya";
      } 
      if ($role == "N")
      { 
          $conteudo = "Superviseur National";
      } 
      if ($role == "A")
      { 
          $conteudo = "Administrateur";
      } 
      if (!empty($conteudo)) 
      { 
          $role = $conteudo; 
      } 
   }  
}
?>
