executerRequete($sql, array($idCollege)); return $garanties; } public function getGarOptCollege($idCollege) { $sql = 'select A.*, IFNULL(B.idCollege,"0") as idCollege from garantie A left join garantiecollege B on (B.idCollege=?) and (B.codeSociete=A.codeSociete) and (B.codeGarantie=A.codeGarantie) Where (A.optionnelle="1") order by A.ordre'; $garanties = $this->executerRequete($sql, array($idCollege)); return $garanties; } public function getGarOptCollegeAcq($idCollege) { $sql = 'select B.*, B.id as idGarantie from garantie A join garantiecollege B on (B.codeSociete=A.codeSociete) and (B.codeGarantie=A.codeGarantie) Where (B.idCollege=?) and (A.optionnelle="1") order by A.ordre'; $garanties = $this->executerRequete($sql, array($idCollege)); return $garanties; } public function ajouter($idCollege, $codeGarantie) { $sql = 'insert into garantiecollege (codeSociete, idCollege, numeroPolice, codeGarantie, garantie, optionnelle, additionnelle, tauxPlafond, forfaitPlafond, ordre, plafondLettre) select A.codeSociete, B.id as idCollege, B.numeroPolice, A.codeGarantie, A.libelle, A.optionnelle, A.additionnelle, A.tauxPlafond, A.forfaitPlafond, A.ordre, A.plafondLettre from garantie A join police B on (B.codeSociete=A.codeSociete) where (B.id=?) and (A.codeGarantie=?)'; $this->executerRequete($sql, array($idCollege, $codeGarantie)); } public function supprimer($id) { $sql = 'DELETE FROM garantiecollege WHERE (id=?)'; $this->executerRequete($sql, array($id)); } }