production/Modele/Raisonconsultation.php
2025-12-01 16:12:12 +00:00

59 lines
1.6 KiB
PHP
Executable File

<?php
require_once 'Framework/Modele.php';
class Raisonconsultation extends Modele {
public function getListe()
{
if (est_anglophone())
{
$sql = 'SELECT codeRaisonConsultation as `code`, libelleEng as libelle FROM p_raisonconsultation order by ordre, libelle';
}
else
{
$sql = 'SELECT codeRaisonConsultation as `code`, libelle FROM p_raisonconsultation order by ordre, libelle';
}
$liste = $this->executerRequete($sql);
return $liste->fetchAll(PDO::FETCH_ASSOC);
}
public function getListeFiltre()
{
$tab_lien_maternite = array("A", "C");
$codeLienParente = $_SESSION['codeLienParente_C'];
$sexe = $_SESSION['sexe_C'];
$maternitePossible = (in_array($codeLienParente, $tab_lien_maternite) && ($sexe=="F") );
if(!$maternitePossible)
{
if (est_anglophone())
{
$sql = 'SELECT codeRaisonConsultation as `code`, libelleEng as libelle
FROM p_raisonconsultation where codeRaisonConsultation != "MAT" order by ordre, libelle';
}
else
{
$sql = 'SELECT codeRaisonConsultation as `code`, libelle
FROM p_raisonconsultation where codeRaisonConsultation != "MAT" order by ordre, libelle';
}
}
else
{
if (est_anglophone())
{
$sql = 'SELECT codeRaisonConsultation as `code`, libelleEng as libelle
FROM p_raisonconsultation order by ordre, libelle';
}
else
{
$sql = 'SELECT codeRaisonConsultation as `code`, libelle
FROM p_raisonconsultation order by ordre, libelle';
}
}
$liste = $this->executerRequete($sql);
return $liste->fetchAll(PDO::FETCH_ASSOC);
}
}