production/Societes/envoyx/Tarifs/Modele/Lienparente_societe.php
2026-03-04 01:48:40 +00:00

103 lines
2.6 KiB
PHP
Executable File

<?php
require_once 'Framework/Modele.php';
class Lienparente_societe extends Modele {
public function getListe()
{
if (est_anglophone())
{
$sql = 'SELECT codeLienParente as `code`, libelleEng as libelle FROM lienparente order by ordre, libelle';
}
else
{
$sql = 'SELECT codeLienParente as `code`, libelle FROM lienparente order by ordre, libelle';
}
$liste = $this->executerRequete($sql);
return $liste->fetchAll(PDO::FETCH_ASSOC);
}
public function getListeConsultation()
{
$idCollege = $_SESSION['idCollege'];
if (est_anglophone())
{
$sql = 'SELECT codeLienParente as `code`, libelleEng as libelle
FROM lienparente
WHERE codeLienParente IN (
SELECT codeLienParente
FROM primecollege_temp
WHERE (idCollege = ?)
AND (population > 0)
)
order by ordre, libelle';
}
else
{
$sql = 'SELECT codeLienParente as `code`, libelle
FROM lienparente
WHERE codeLienParente IN (
SELECT codeLienParente
FROM primecollege_temp
WHERE (idCollege = ?)
AND (population > 0)
)
order by ordre, libelle';
}
$liste = $this->executerRequete($sql,array($idCollege));
return $liste->fetchAll(PDO::FETCH_ASSOC);
}
public function getListeSubstitut()
{
if (est_anglophone())
{
$sql = 'SELECT codeLienParente as `code`, libelleEng as libelle FROM liensubstitut order by ordre, libelle';
}
else
{
$sql = 'SELECT codeLienParente as `code`, libelle FROM liensubstitut order by ordre, libelle';
}
$liste = $this->executerRequete($sql);
return $liste->fetchAll(PDO::FETCH_ASSOC);
}
public function getListeDependant()
{
if (est_anglophone())
{
$sql = 'SELECT codeLienParente AS `code`, libelleEng as libelle FROM lienparente WHERE codeLienParente!="A" ORDER BY ordre, libelle';
}
else
{
$sql = 'SELECT codeLienParente AS `code`, libelle FROM lienparente WHERE codeLienParente!="A" ORDER BY ordre, libelle';
}
$liste = $this->executerRequete($sql);
return $liste->fetchAll(PDO::FETCH_ASSOC);
}
public function getListeAdherent()
{
if (est_anglophone())
{
$sql = 'SELECT codeLienParente AS `code`, libelleEng as libelle FROM lienparente WHERE codeLienParente="A" ORDER BY ordre, libelle';
}
else
{
$sql = 'SELECT codeLienParente AS `code`, libelle FROM lienparente WHERE codeLienParente="A" ORDER BY ordre, libelle';
}
$liste = $this->executerRequete($sql);
return $liste->fetchAll(PDO::FETCH_ASSOC);
}
}