executerRequete($sql, array($idAdherent)); return $resultat->fetchAll(PDO::FETCH_ASSOC); // 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 getTotalGarantieAdherent($idAdherent) { $sql = 'select ifnull(sum(plafondAnnuel),"0") as plafondAnnuel, ifnull(sum(plafond),"0") as plafond, ifnull(sum(consommation),"0") as consommation, ifnull(sum(ifnull(plafond-consommation,"0")),"0") as solde from garantieadherent A Where (A.idAdherent=?)'; $garanties = $this->executerRequete($sql, array($idAdherent)); return $garanties->fetch(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 (est_anglophone()) { $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 getGarantieAdherentEnteteContrat($idAdherent, $idEntetecontrat) { if (est_anglophone()) { $sql = 'call sp_afficher_garantieadherent_entete_contrat_eng(?, ?);'; } else { $sql = 'call sp_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_afficher_garantiebeneficiaire_entete_contrat_eng(?, ?);'; } else { $sql = 'call sp_afficher_garantiebeneficiaire_entete_contrat(?, ?);'; } $resultat = $this->executerRequete($sql, array($idBeneficiaire, $idEntetecontrat)); 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 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); } public function getSituationFamille($idAdherent) { $date = date('Y-m-d'); $sql = 'call sp_situation_famille_newversion(?, ?);'; $police = $this->executerRequete($sql, array($idAdherent, $date)); return $police->fetch(PDO::FETCH_ASSOC); } public function getSituationPolice($idBeneficiaire) { $sql = 'call sp_situation_beneficiaire_famille(?);'; $police = $this->executerRequete($sql, array($idBeneficiaire)); return $police->fetch(PDO::FETCH_ASSOC); } }