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

50 lines
1.5 KiB
PHP
Executable File

<?php
require_once 'Framework/Modele.php';
class Entetetrancheage extends Modele{
public function getlisterentetetrancheage(){
$sql = "SELECT A.*, B.libelle as garant
FROM entetetrancheage A
JOIN gc_assureur B ON (B.codeSociete = A.codeSociete
and B.codeGcAssureur = A.codeGcAssureur)
WHERE (A.codeSociete =?)
ORDER BY 1;";
$resultat = $this->executerRequete($sql, array($_SESSION['codeSociete']));
return $resultat->fetchAll(PDO::FETCH_ASSOC);
}
public function getentetetrancheage($id){
$sql = "SELECT *
FROM entetetrancheage
WHERE (id = ? and codeSociete =?);";
$resultat = $this->executerRequete($sql, array($id, $_SESSION['codeSociete']));
return $resultat->fetch(PDO::FETCH_ASSOC);
}
public function ajouterentetetrancheage($codeGcAssureur,$libelle,$libelleEng){
$codeSociete = $_SESSION['codeSociete'];
$sql ='CALL sp_ajouter_entetetrancheage(?, ?, ?, ?);';
$this->executerRequete($sql, array($codeSociete,$codeGcAssureur,$libelle,$libelleEng));
}
public function modifierentetetrancheage($codeGcAssureur,$codeEnteteTrancheAge,$libelle,$libelleEng,$id){
$codeSociete = $_SESSION['codeSociete'];
$sql = 'UPDATE entetetrancheage
SET codeGcAssureur=?,libelle=?,libelleEng=?
WHERE (id = ? AND codeSociete = ?);';
$this->executerRequete($sql, array($codeGcAssureur,$libelle,$libelleEng,$id,$codeSociete));
}
}