assure/Modele/Garantieadherent.php
2025-12-05 09:34:39 +00:00

155 lines
4.1 KiB
PHP
Executable File

<?php
require_once 'Framework/Modele.php';
class Garantieadherent extends Modele {
public function getGarantieAdherent($idAdherent)
{
$sql = 'call sp_a_afficher_garantieadherent(?);';
$resultat = $this->executerRequete($sql, array($idAdherent));
return $resultat->fetchAll(PDO::FETCH_ASSOC);
}
public function getGarantieBeneficiaire($idBeneficiaire)
{
$sql = 'call sp_afficher_garantiebeneficiaire(?);';
$resultat = $this->executerRequete($sql, array($idBeneficiaire));
return $resultat->fetchAll(PDO::FETCH_ASSOC);
}
public function getPlafondAvantFacture()
{
$idFacture = $_SESSION['idFacture_C'];
$sql = 'call sp_p_get_plafond_avant_facture_id(?);';
$resultat = $this->executerRequete($sql, array($idFacture));
return $resultat->fetchAll(PDO::FETCH_ASSOC);
}
public function getPlafondAvantFactureId($idFacture)
{
$sql = 'call sp_p_get_plafond_avant_facture_id(?);';
$resultat = $this->executerRequete($sql, array($idFacture));
return $resultat->fetchAll(PDO::FETCH_ASSOC);
}
public function getGarantieAdherentExo($idAdherent, $exo)
{
if (isset($_SESSION['lang']) && $_SESSION['lang']=="en_US")
{
$sql = 'call sp_afficher_garantieadherent_exo_eng(?, ?);';
}
else
{
$sql = 'call sp_afficher_garantieadherent_exo(?, ?);';
}
$resultat = $this->executerRequete($sql, array($idAdherent, $exo));
return $resultat->fetchAll(PDO::FETCH_ASSOC);
}
public function getentetecontrat($idEntetecontrat)
{
$sql = 'SELECT * FROM entetecontrat WHERE id=? limit 1;';
$resultat = $this->executerRequete($sql, array($idEntetecontrat));
return $resultat->fetch(PDO::FETCH_ASSOC);
}
public function getlisteentetecontrat($idAdherent)
{
$sql = 'call sp_get_entete_contrat_adherent(?)';
$resultat = $this->executerRequete($sql, array($idAdherent));
return $resultat->fetchAll(PDO::FETCH_ASSOC);
}
public function getlisteentetecontratadherent($idAdherent)
{
$sql = 'call sp_get_entete_contrat_adherent(?)';
$resultat = $this->executerRequete($sql, array($idAdherent));
return $resultat->fetchAll(PDO::FETCH_ASSOC);
}
public function getlisteentetecontratbeneficiaire($idBeneficiaire)
{
$sql = 'call sp_get_entete_contrat_beneficiaire(?)';
$resultat = $this->executerRequete($sql, array($idBeneficiaire));
return $resultat->fetchAll(PDO::FETCH_ASSOC);
}
public function getGarantieAdherentEnteteContrat($idAdherent, $idEntetecontrat)
{
if (est_anglophone())
{
$sql = 'call sp_a_afficher_garantieadherent_entete_contrat_eng(?, ?);';
}
else
{
$sql = 'call sp_a_afficher_garantieadherent_entete_contrat(?, ?);';
}
$resultat = $this->executerRequete($sql, array($idAdherent, $idEntetecontrat));
return $resultat->fetchAll(PDO::FETCH_ASSOC);
}
public function getGarantieBeneficiaireEnteteContrat($idBeneficiaire, $idEntetecontrat)
{
if (est_anglophone())
{
$sql = 'call sp_a_afficher_garantiebeneficiaire_entete_contrat_eng(?, ?);';
}
else
{
$sql = 'call sp_a_afficher_garantiebeneficiaire_entete_contrat(?, ?);';
}
$resultat = $this->executerRequete($sql, array($idBeneficiaire, $idEntetecontrat));
return $resultat->fetchAll(PDO::FETCH_ASSOC);
}
public function getLimitesBeneficiaire($idBeneficiaire)
{
$sql = 'call sp_p_afficher_limites_beneficiaire(?);';
$resultat = $this->executerRequete($sql, array($idBeneficiaire));
return $resultat->fetch(PDO::FETCH_ASSOC);
}
public function getLimitesAdherent($idAdherent)
{
$sql = 'call sp_p_afficher_limites_adherent(?);';
$resultat = $this->executerRequete($sql, array($idAdherent));
return $resultat->fetch(PDO::FETCH_ASSOC);
}
public function getBaremePlafondAdherent($idAdherent, $idBeneficiaire)
{
$sql = 'call sp_p_afficher_baremeplafonne_adherent(?, ?);';
$resultat = $this->executerRequete($sql, array($idAdherent, $idBeneficiaire));
return $resultat->fetchAll(PDO::FETCH_ASSOC);
}
}