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

63 lines
1.6 KiB
PHP
Executable File

<?php
require_once 'Framework/Modele.php';
class Etatpersonne extends Modele {
public function getListe()
{
if (est_anglophone())
{
$sql = 'SELECT codeEtatPersonne as `code`, libelleEng as libelle FROM etatpersonne order by libelle';
}
else
{
$sql = 'SELECT codeEtatPersonne as `code`, libelle FROM etatpersonne order by libelle';
}
$liste = $this->executerRequete($sql);
return $liste->fetchAll(PDO::FETCH_ASSOC);
}
public function getListeSuiteFam($oldcodeEtatPersonne)
{
if (est_anglophone())
{
$sql = 'SELECT codeEtatPersonne as `code`, etatpossibleEng as libelle
FROM vw_suiteetatpersonne where (oldcodeEtatPersonne=?)
and (famille="1") order by etatpossible;';
}
else
{
$sql = 'SELECT codeEtatPersonne as `code`, etatpossible as libelle
FROM vw_suiteetatpersonne where (oldcodeEtatPersonne=?)
and (famille="1") order by etatpossible;';
}
$liste = $this->executerRequete($sql, array($oldcodeEtatPersonne));
return $liste->fetchAll(PDO::FETCH_ASSOC);
}
public function getListeSuiteDep($oldcodeEtatPersonne)
{
if (est_anglophone())
{
$sql = 'SELECT codeEtatPersonne as `code`, etatpossibleEng as libelle
FROM vw_suiteetatpersonne where (oldcodeEtatPersonne=?)
and (dependant="1") order by etatpossible;';
}
else
{
$sql = 'SELECT codeEtatPersonne as `code`, etatpossible as libelle
FROM vw_suiteetatpersonne where (oldcodeEtatPersonne=?)
and (dependant="1") order by etatpossible;';
}
$liste = $this->executerRequete($sql, array($oldcodeEtatPersonne));
return $liste->fetchAll(PDO::FETCH_ASSOC);
}
}