2018 lines
67 KiB
PHP
Executable File
2018 lines
67 KiB
PHP
Executable File
<?php
|
|
|
|
require_once '././Framework/Modele.php';
|
|
|
|
class College_temp extends Modele {
|
|
|
|
public function ajouterUneGarantie($idCollegeTemp, $codeGarantie)
|
|
{
|
|
|
|
// $sql = 'call sp_ajouter_une_garantie(?, ?)';
|
|
$sql = 'call sp_ajouter_une_garantie_bicor(?, ?)';
|
|
|
|
$this->executerRequete($sql, array($idCollegeTemp, $codeGarantie));
|
|
}
|
|
|
|
public function getCollegeTemp($idCollegeTemp)
|
|
{
|
|
//$sql = 'call sp_afficher_college_temp_mcicareci(?)';
|
|
$sql = 'call sp_afficher_college_temp_saas(?)';
|
|
|
|
|
|
$collegeTemp = $this->executerRequete($sql, array($idCollegeTemp));
|
|
|
|
return $collegeTemp->fetch();
|
|
}
|
|
|
|
public function getBaseTarifCollege()
|
|
{
|
|
if (est_anglophone()){
|
|
$sql = "select codeBaseTarification as code, libelleEng as libelle
|
|
from basetarification where (codeBaseTarification IN ('FAM', 'IND', 'AUC'))
|
|
ORDER BY ordre;";
|
|
}else{
|
|
$sql = "select codeBaseTarification as code, libelle
|
|
from basetarification where (codeBaseTarification IN ('FAM', 'IND', 'AUC'))
|
|
ORDER BY ordre;";
|
|
|
|
}
|
|
|
|
$liste = $this->executerRequete($sql);
|
|
return $liste->fetchAll(PDO::FETCH_ASSOC);
|
|
}
|
|
|
|
public function getCollegeTempPolice($idPolice, $user)
|
|
{
|
|
$sql = 'select * from college_temp where (idPolice=?) and (user=?)';
|
|
|
|
$collegeTemp = $this->executerRequete($sql, array($idPolice, $user));
|
|
return $collegeTemp->fetchAll(PDO::FETCH_ASSOC);
|
|
}
|
|
|
|
|
|
public function getCollegeTempPoliceRen($idPolice, $user)
|
|
{
|
|
$sql = 'select * from college_ren_temp where (idPolice=?) and (user=?) order by codeProduit, libelleCollege';
|
|
|
|
$collegeTemp = $this->executerRequete($sql, array($idPolice, $user));
|
|
return $collegeTemp->fetchAll(PDO::FETCH_ASSOC);
|
|
}
|
|
|
|
public function getGarCollege($idCollegeTemp)
|
|
{
|
|
$sql = 'select * from garantie_temp where (idCollegeTemp=?) order by ordre';
|
|
$garanties = $this->executerRequete($sql, array($idCollegeTemp));
|
|
return $garanties;
|
|
}
|
|
|
|
public function getGarAddCollege($idCollegeTemp)
|
|
{
|
|
$sql = 'select A.*, B.plafond as plafondOld, B.plafond+A.plafond as plafondNew from garantieaddition_temp A
|
|
join garantie_temp B on (B.user=A.user) and (B.idCollegeTemp=A.idCollegeTemp) and (B.codeGarantie=A.codeGarantie)
|
|
where (A.idCollegeTemp=?) order by A.ordre';
|
|
|
|
$garanties = $this->executerRequete($sql, array($idCollegeTemp));
|
|
return $garanties;
|
|
}
|
|
|
|
public function getGarBaseCollege($idCollegeTemp)
|
|
{
|
|
$sql = 'select * from garantie_temp where (idCollegeTemp=?) and (optionnelle!="1") order by ordre';
|
|
$garanties = $this->executerRequete($sql, array($idCollegeTemp));
|
|
return $garanties;
|
|
}
|
|
|
|
public function getGarOptCollege($idCollegeTemp)
|
|
{
|
|
$sql = 'select A.*, IFNULL(B.idCollegeTemp,"0") as idCollegeTemp
|
|
from garantie A
|
|
left join garantie_temp B on (B.idCollegeTemp=?) and (B.codeSociete=A.codeSociete) and (B.codeGarantie=A.codeGarantie)
|
|
Where (A.optionnelle="1") order by A.ordre';
|
|
|
|
$garanties = $this->executerRequete($sql, array($idCollegeTemp));
|
|
return $garanties;
|
|
}
|
|
|
|
public function getGarOptCollegeAcq($idCollegeTemp)
|
|
{
|
|
$sql = 'select * from garantie_temp where (idCollegeTemp=?) and (optionnelle="1") order by ordre';
|
|
$garanties = $this->executerRequete($sql, array($idCollegeTemp));
|
|
return $garanties;
|
|
}
|
|
|
|
public function getPrestation($idCollegeTemp)
|
|
{
|
|
$sql = 'select A.*, B.libelle as reseausoin from prestation_temp A
|
|
join reseausoins B on (B.codeReseau=A.codeReseau)
|
|
where (A.idCollegeTemp=?) order by A.tmBase, A.tm';
|
|
|
|
$prestations = $this->executerRequete($sql, array($idCollegeTemp));
|
|
return $prestations;
|
|
}
|
|
|
|
public function supprimer($idCollegeTemp) {
|
|
$sql = 'DELETE FROM college_temp WHERE (id=?)';
|
|
$this->executerRequete($sql, array($idCollegeTemp));
|
|
|
|
$sql = 'DELETE FROM garantie_temp WHERE (idCollegeTemp=?)';
|
|
$this->executerRequete($sql, array($idCollegeTemp));
|
|
}
|
|
|
|
public function supprimergarantie($idGarantie) {
|
|
$sql = 'DELETE FROM garantie_temp WHERE (id=?)';
|
|
$this->executerRequete($sql, array($idGarantie));
|
|
}
|
|
|
|
|
|
|
|
public function initCollege($idPolice, $codeGcAssureur, $user)
|
|
{
|
|
$codeSociete = $_SESSION['codeSociete'];
|
|
|
|
$this->viderfamilleacteproduitlienparente();
|
|
$this->videractecollegelienparente_temp();
|
|
|
|
|
|
$sql = 'CALL sp_init_college(?, ?, ?, ?);';
|
|
|
|
|
|
$this->executerRequete($sql, array($idPolice, $codeSociete, $codeGcAssureur, $user));
|
|
|
|
$resultat = $this->executerRequete($sql, array($idPolice, $codeSociete, $codeGcAssureur, $user));
|
|
|
|
$ligne = $resultat->fetch(PDO::FETCH_ASSOC);
|
|
|
|
$idCollegeTemp = $ligne['idCollegeTemp'];
|
|
|
|
$_SESSION['idCollegeTemp'] = $idCollegeTemp;
|
|
|
|
return $idCollegeTemp;
|
|
}
|
|
|
|
//($idCollege, $codeGcAssureur, $user)
|
|
|
|
public function initModifCollege($idCollege, $user)
|
|
{
|
|
$this->viderCollegTemp($user);
|
|
|
|
$sql = 'CALL sp_init_modifier_college(?, ?);';
|
|
|
|
|
|
$this->executerRequete($sql, array($idCollege, $user));
|
|
|
|
|
|
$resultat = $this->executerRequete($sql, array($idCollege, $user));
|
|
|
|
$ligne = $resultat->fetch(PDO::FETCH_ASSOC);
|
|
|
|
$idCollegeTemp = $ligne['idCollegeTemp'];
|
|
|
|
$_SESSION['idCollegeTemp'] = $idCollegeTemp;
|
|
|
|
return $idCollegeTemp;
|
|
}
|
|
|
|
public function recapituler($idCollegeTemp,$codeProduit,$codeCollegeType,$codeReseau,
|
|
$codeTypeRemboursement,$codeTerritoire,$codeLienParente,$libelleCollege,$ticketModerateurCollege,$delaiCarenceCollege,
|
|
$plafondCollege,$idPolice,$numeroPolice,$accessoireManuel,$rachatTm,$tauxRachatTm,$tauxPrimeRachatTm,$budgetDefini,
|
|
$montantBudget,$nbAdherent,$nbAyantdroit,$codeTypeTarifActe,$codeTarifActe,$codeGcAssureur,$idBaremePriseEnCharge,
|
|
$codeBaseTarification,$seuilRdCollege,$plafondAdherent,$forfaitHonoraire,$forfaitAppelFond,$forfaitAppelCotisation,
|
|
$numeroOptionTarif)
|
|
{
|
|
$codeSociete = $_SESSION['codeSociete'];
|
|
$nbAdherent = preg_replace('/\s+/', '', $nbAdherent);
|
|
$nbAyantdroit = preg_replace('/\s+/', '', $nbAyantdroit);
|
|
|
|
$plafondAdherent = str_replace(' ', '', $plafondAdherent);
|
|
|
|
$sql = 'call sp_recapituler_college_temp_lienparente_saas(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?,?,?,?,?,?,?,?,?)';
|
|
|
|
$this->executerRequete($sql, array($codeSociete,$idCollegeTemp,$codeProduit,$codeCollegeType,$codeReseau,
|
|
$codeTypeRemboursement,$codeTerritoire,$codeLienParente,$libelleCollege,$ticketModerateurCollege,$delaiCarenceCollege,
|
|
$plafondCollege,$idPolice,$numeroPolice,$accessoireManuel,$rachatTm,$tauxRachatTm,$tauxPrimeRachatTm,$budgetDefini,
|
|
$montantBudget,$nbAdherent,$nbAyantdroit,$codeTypeTarifActe,$codeTarifActe,$codeGcAssureur,$idBaremePriseEnCharge,
|
|
$codeBaseTarification,$seuilRdCollege,$plafondAdherent,$forfaitHonoraire,$forfaitAppelFond,$forfaitAppelCotisation,
|
|
$numeroOptionTarif));
|
|
}
|
|
|
|
public function maj($idCollegeTemp, $codeProduit, $libelleCollege, $nbAdherent, $nbAyantdroit, $primeFamille,
|
|
$surprimeAnt, $rachatTm, $cplFuneraire, $tauxRachatTm, $tauxPrimeRachatTm)
|
|
{
|
|
$sql = 'call sp_maj_college_temp(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)';
|
|
|
|
$this->executerRequete($sql, array($idCollegeTemp, $codeProduit, $libelleCollege, $nbAdherent, $nbAyantdroit,
|
|
$primeFamille, $surprimeAnt, $rachatTm, $cplFuneraire, $tauxRachatTm, $tauxPrimeRachatTm));
|
|
}
|
|
|
|
public function enregistrer($idCollegeTemp)
|
|
{
|
|
$sql = 'call sp_creer_college(?)';
|
|
//var_dump($idCollegeTemp);
|
|
|
|
$this->executerRequete($sql, array($idCollegeTemp));
|
|
|
|
}
|
|
|
|
public function modifiercollege($idCollegeTemp, $idCollege)
|
|
{
|
|
$user = $_SESSION['login'];
|
|
|
|
$sql = 'call sp_modifier_college_lien_parente(?, ?, ?)';
|
|
$this->executerRequete($sql, array($idCollegeTemp, $idCollege, $user));
|
|
}
|
|
|
|
|
|
public function ajouterGarantieCollege($idCollege, $idCollegeTemp)
|
|
{
|
|
$sql = 'delete from garantiecollege where idCollege=?';
|
|
$this->executerRequete($sql, array($idCollege));
|
|
|
|
$sql = 'insert into garantiecollege (codeSociete, idCollege, idPolice, numeroPolice, codeGarantie, garantie, garantieEng, optionnelle,
|
|
additionnelle, tauxPlafond, forfaitPlafond, primeOption, user, plafond, plafondLettre, primeFamille, ordre, champApplication,
|
|
tauxPrime, capital, primeParTete)
|
|
|
|
select codeSociete, ? as idCollege, idPolice, numeroPolice, codeGarantie, garantie, garantieEng, optionnelle,
|
|
additionnelle, tauxPlafond, forfaitPlafond, primeOption, user, plafond, plafondLettre, primeFamille, ordre, champApplication,
|
|
tauxPrime, capital, primeParTete
|
|
from garantie_temp where idCollegeTemp=?';
|
|
|
|
$this->executerRequete($sql, array($idCollege, $idCollegeTemp));
|
|
}
|
|
|
|
public function ajouterTableauPrestation($idCollege, $idCollegeTemp)
|
|
{
|
|
$sql = 'delete from prestationcollege where idCollege=?';
|
|
$this->executerRequete($sql, array($idCollege));
|
|
|
|
$sql = 'INSERT INTO prestationcollege (
|
|
codeSociete,
|
|
idCollege,
|
|
idPolice,
|
|
numeroPolice,
|
|
codeProduit,
|
|
codeReseau,
|
|
tm,
|
|
`user`,
|
|
dateSysteme,
|
|
tmBase,
|
|
rachatTm,
|
|
tauxRachatTm
|
|
)
|
|
SELECT
|
|
codeSociete,
|
|
? as idCollege,
|
|
idPolice,
|
|
numeroPolice,
|
|
codeProduit,
|
|
codeReseau,
|
|
tm,
|
|
`user`,
|
|
dateSysteme,
|
|
tmBase,
|
|
rachatTm,
|
|
tauxRachatTm
|
|
FROM prestation_temp where idCollegeTemp=?';
|
|
|
|
$this->executerRequete($sql, array($idCollege, $idCollegeTemp));
|
|
}
|
|
|
|
public function initGarantieCollege($idCollegeTemp)
|
|
{
|
|
$sql = 'insert into garantie_temp
|
|
(
|
|
codeSociete,
|
|
idCollegeTemp,
|
|
idPolice,
|
|
numeroPolice,
|
|
codeGarantie,
|
|
garantie,
|
|
garantieEng,
|
|
optionnelle,
|
|
additionnelle,
|
|
tauxPlafond,
|
|
forfaitPlafond,
|
|
user,
|
|
plafond,
|
|
ordre,
|
|
plafondLettre,
|
|
champApplication,
|
|
primeParTete
|
|
)
|
|
select
|
|
A.codeSociete,
|
|
B.id as idCollegeTemp,
|
|
B.idPolice,
|
|
B.numeroPolice,
|
|
A.codeGarantie,
|
|
A.libelle as garantie,
|
|
A.libelleEng as garantieEng,
|
|
A.optionnelle,
|
|
A.additionnelle,
|
|
A.tauxPlafond,
|
|
A.forfaitPlafond,
|
|
B.user,
|
|
ROUND((B.primeFamille*A.tauxPlafond),0)+A.forfaitPlafond as plafond,
|
|
A.ordre, A.plafondLettre,
|
|
A.champApplication,
|
|
A.primeParTete
|
|
from garantie A
|
|
join college_temp B on (B.codeSociete=A.codeSociete)
|
|
Where (B.id=?) and optionnelle!="1"';
|
|
|
|
$this->executerRequete($sql, array($idCollegeTemp));
|
|
}
|
|
|
|
public function initPrestationCollege($idCollegeTemp)
|
|
{
|
|
$user = $_SESSION['login'];
|
|
$codeProduitBase = $_SESSION['codeProduitBase'];
|
|
|
|
$sql = 'call sp_init_prestation_college(?, ?, ?)';
|
|
|
|
$this->executerRequete($sql, array($idCollegeTemp, $codeProduitBase, $user));
|
|
}
|
|
|
|
public function initModifGarantieCollege($idCollegeTemp)
|
|
{
|
|
$sql = 'insert into garantie_temp
|
|
(
|
|
codeSociete,
|
|
idCollege,
|
|
idCollegeTemp,
|
|
idPolice,
|
|
numeroPolice,
|
|
codeGarantie,
|
|
garantie,
|
|
garantieEng,
|
|
optionnelle,
|
|
additionnelle,
|
|
tauxPlafond,
|
|
forfaitPlafond,
|
|
primeOption,
|
|
user,
|
|
plafond,
|
|
ordre,
|
|
plafondLettre,
|
|
primeFamille,
|
|
champApplication,
|
|
primeParTete
|
|
)
|
|
select
|
|
A.codeSociete,
|
|
A.idCollege,
|
|
B.id as idCollegeTemp,
|
|
B.idPolice,
|
|
B.numeroPolice,
|
|
A.codeGarantie,
|
|
A.garantie,
|
|
A.garantieEng,
|
|
A.optionnelle,
|
|
A.additionnelle,
|
|
A.tauxPlafond,
|
|
A.forfaitPlafond,
|
|
A.primeOption,
|
|
B.user,
|
|
A.plafond,
|
|
A.ordre, A.plafondLettre,
|
|
A.primeFamille,
|
|
A.champApplication,
|
|
A.primeParTete
|
|
from garantiecollege A
|
|
join college_temp B on (B.codeSociete=A.codeSociete) and (B.idCollege=A.idCollege)
|
|
Where (B.id=?)';
|
|
|
|
$this->executerRequete($sql, array($idCollegeTemp));
|
|
}
|
|
|
|
public function initModifPrestation($idCollegeTemp)
|
|
{
|
|
$sql = 'insert into prestation_temp (
|
|
codeSociete,
|
|
idCollegeTemp,
|
|
idCollege,
|
|
idPolice,
|
|
numeroPolice,
|
|
codeProduit,
|
|
codeReseau,
|
|
tm,
|
|
user,
|
|
dateSysteme,
|
|
tmBase,
|
|
rachatTm,
|
|
tauxRachatTm,
|
|
tauxPrimeRachatTm
|
|
)
|
|
select
|
|
A.codeSociete,
|
|
B.id as idCollegeTemp,
|
|
B.idCollege,
|
|
B.idPolice,
|
|
B.numeroPolice,
|
|
A.codeProduit,
|
|
A.codeReseau,
|
|
A.tm,
|
|
B.user,
|
|
now() as dateSysteme,
|
|
A.tmBase,
|
|
B.rachatTm,
|
|
B.tauxRachatTm,
|
|
B.tauxPrimeRachatTm
|
|
from prestationcollege A
|
|
join college_temp B on (B.codeSociete=A.codeSociete) and (B.idCollege=A.idCollege)
|
|
Where (B.id=?)';
|
|
|
|
$this->executerRequete($sql, array($idCollegeTemp));
|
|
}
|
|
|
|
public function majtauxplafond($idGarantie, $tauxPlafond)
|
|
{
|
|
$sql = 'update garantie_temp set tauxPlafond=? where (id=?)';
|
|
$this->executerRequete($sql, array($tauxPlafond, $idGarantie));
|
|
|
|
$sql = 'update garantie_temp set plafond= ROUND((primeFamille*tauxPlafond),0)+forfaitPlafond where (id=?)';
|
|
$this->executerRequete($sql, array($idGarantie));
|
|
}
|
|
|
|
public function imposerplafond($idGarantie, $plafond)
|
|
{
|
|
$sql = 'update garantie_temp set plafond=? where (id=?)';
|
|
$this->executerRequete($sql, array($plafond, $idGarantie));
|
|
}
|
|
|
|
public function majtm($idPrestation, $tm)
|
|
{
|
|
$sql = 'update prestation_temp set tm=? where (id=?)';
|
|
$this->executerRequete($sql, array($tm, $idPrestation));
|
|
}
|
|
|
|
public function majtmprestatairenplus($idPrestation, $tm)
|
|
{
|
|
$sql = 'update prestationcollegeplus set tm=? where (id=?)';
|
|
$this->executerRequete($sql, array($tm, $idPrestation));
|
|
}
|
|
|
|
public function retirerprestatairenplus($idPrestation)
|
|
{
|
|
$sql = 'delete from prestationcollegeplus where (id=?)';
|
|
$this->executerRequete($sql, array($idPrestation));
|
|
}
|
|
|
|
public function ajouterunprestataireenplus($codePrestataire)
|
|
{
|
|
$idCollege = $_SESSION['idCollege'];
|
|
$user = $_SESSION['login'];
|
|
|
|
$sql = 'call sp_ajouterprestataireenplus(?, ?, ?)';
|
|
$this->executerRequete($sql, array($idCollege, $codePrestataire, $user));
|
|
}
|
|
|
|
public function ajouterunprestataireenmoins($codePrestataire)
|
|
{
|
|
$idCollege = $_SESSION['idCollege'];
|
|
$user = $_SESSION['login'];
|
|
|
|
$sql = 'call sp_ajouterprestataireenmoins(?, ?, ?)';
|
|
$this->executerRequete($sql, array($idCollege, $codePrestataire, $user));
|
|
}
|
|
|
|
public function retirerprestatairenmoins($idPrestation)
|
|
{
|
|
$sql = 'delete from prestationcollegemoins where (id=?)';
|
|
$this->executerRequete($sql, array($idPrestation));
|
|
}
|
|
|
|
// ajouterunprestatairetm
|
|
public function ajouterunprestatairetm($codePrestataire)
|
|
{
|
|
$idCollege = $_SESSION['idCollege'];
|
|
$user = $_SESSION['login'];
|
|
|
|
$sql = 'call sp_ajouterprestatairetm(?, ?, ?)';
|
|
$this->executerRequete($sql, array($idCollege, $codePrestataire, $user));
|
|
}
|
|
|
|
public function retirerprestatairetm($idPrestation)
|
|
{
|
|
$sql = 'delete from prestationcollegetm where (id=?)';
|
|
$this->executerRequete($sql, array($idPrestation));
|
|
}
|
|
|
|
public function majtmprestatairetm($idPrestation, $tm)
|
|
{
|
|
$sql = 'update prestationcollegetm set tm=? where (id=?)';
|
|
$this->executerRequete($sql, array($tm, $idPrestation));
|
|
}
|
|
|
|
public function majPrimeOpt($idGarantie, $primeOption)
|
|
{
|
|
$sql = 'call sp_maj_prime_opt(?, ?)';
|
|
|
|
$this->executerRequete($sql, array($idGarantie, $primeOption));
|
|
}
|
|
|
|
public function majPlafondOpt($idGarantie, $plafondOption)
|
|
{
|
|
$sql = 'call sp_maj_plafond_opt(?, ?)';
|
|
|
|
$this->executerRequete($sql, array($idGarantie, $plafondOption));
|
|
}
|
|
|
|
public function majlibgar($idGarantie, $libellegarantie)
|
|
{
|
|
$sql = 'update garantie_temp set garantie=? where (id=?)';
|
|
$this->executerRequete($sql, array($libellegarantie, $idGarantie));
|
|
}
|
|
|
|
public function viderCollegTemp($user)
|
|
{
|
|
/*
|
|
$sql = 'DELETE FROM college_temp WHERE (user=?)';
|
|
$this->executerRequete($sql, array($user));
|
|
|
|
$sql = 'DELETE FROM garantie_temp WHERE (user=?)';
|
|
$this->executerRequete($sql, array($user));
|
|
|
|
$sql = 'DELETE FROM prestation_temp WHERE (user=?)';
|
|
$this->executerRequete($sql, array($user));
|
|
*/
|
|
|
|
$sql = 'call sp_vider_college_temp(?)';
|
|
$this->executerRequete($sql, array($user));
|
|
}
|
|
|
|
public function init_changement_college($idAdherent)
|
|
{
|
|
$user = $_SESSION['login'];
|
|
$sql = 'call sp_init_changement_college(?, ?)';
|
|
|
|
$college_temp = $this->executerRequete($sql, array($idAdherent, $user));
|
|
return $college_temp->fetch();
|
|
}
|
|
|
|
public function changer_college_temp($idAdherent, $idCollege)
|
|
{
|
|
$user = $_SESSION['login'];
|
|
$sql = 'call sp_changer_college_temp(?, ?, ?)';
|
|
|
|
$college_temp = $this->executerRequete($sql, array($idAdherent, $idCollege, $user));
|
|
return $college_temp->fetch();
|
|
}
|
|
|
|
public function changer_college($idAdherent)
|
|
{
|
|
$user = $_SESSION['login'];
|
|
$sql = 'call sp_changer_college(?, ?)';
|
|
$this->executerRequete($sql, array($idAdherent, $user));
|
|
}
|
|
|
|
public function getCollegesPolice()
|
|
{
|
|
$user = $_SESSION['login'];
|
|
$sql = 'SELECT * FROM college_temp WHERE (user=?) order by libelleCollege';
|
|
$college = $this->executerRequete($sql, array($user));
|
|
return $college;
|
|
}
|
|
|
|
public function getTotaldcollege($idPolice) {
|
|
$user = $_SESSION['login'];
|
|
$sql = 'call sp_totalcollege_temp(?, ?)';
|
|
$totalcollege = $this->executerRequete($sql, array($idPolice, $user));
|
|
return $totalcollege->fetch(PDO::FETCH_ASSOC);
|
|
}
|
|
|
|
public function selectioncollegetemp($idCollegeTemp, $choix) {
|
|
$sql = 'update college_temp set choix=? WHERE (id=?)';
|
|
$this->executerRequete($sql, array($choix, $idCollegeTemp));
|
|
}
|
|
|
|
public function majplafondadd($idGarantie, $plafond)
|
|
{
|
|
$sql = 'update garantieaddition_temp set plafond=? where (id=?)';
|
|
$this->executerRequete($sql, array($plafond, $idGarantie));
|
|
}
|
|
|
|
public function majprimeadd($idGarantie, $primeOption)
|
|
{
|
|
$sql = 'update garantieaddition_temp set primeOption=? where (id=?)';
|
|
$this->executerRequete($sql, array($primeOption, $idGarantie));
|
|
}
|
|
|
|
public function recapituler_maj_limite_college($idCollegeTemp)
|
|
{
|
|
$user = $_SESSION['login'];
|
|
$sql = 'call sp_recapituller_maj_limite_college(?, ?)';
|
|
|
|
$this->executerRequete($sql, array($idCollegeTemp, $user));
|
|
}
|
|
|
|
public function modifierlimitecollegetemp($idCollegeTemp)
|
|
{
|
|
$user = $_SESSION['login'];
|
|
$sql = 'call sp_modifier_limite_college_temp(?)';
|
|
$this->executerRequete($sql, array($idCollegeTemp, $user));
|
|
}
|
|
|
|
public function getCollegepoliceId($idCollege) {
|
|
$sql = 'SELECT A.id AS idCollege, A.*, B.libelle as produit
|
|
from college A
|
|
join produit B on (B.codeSociete=A.codeSociete) AND (B.codeProduit=A.codeProduit)
|
|
where A.id=?';
|
|
|
|
$college = $this->executerRequete($sql, array($idCollege));
|
|
return $college->fetch();
|
|
}
|
|
|
|
public function getprestatairehorsreseau($idCollege) {
|
|
$sql = 'call sp_getprestatairehorsreseau(?);';
|
|
|
|
$college = $this->executerRequete($sql, array($idCollege));
|
|
return $college->fetchAll(PDO::FETCH_ASSOC);
|
|
}
|
|
|
|
public function getprestataireenplus($idCollege) {
|
|
$sql = 'call sp_getprestataireenplus(?);';
|
|
|
|
$college = $this->executerRequete($sql, array($idCollege));
|
|
return $college->fetchAll(PDO::FETCH_ASSOC);
|
|
}
|
|
|
|
// Prestataires en moins
|
|
public function getprestatairereseau($idCollege) {
|
|
$sql = 'call sp_getprestatairereseau(?);';
|
|
|
|
$college = $this->executerRequete($sql, array($idCollege));
|
|
return $college->fetchAll(PDO::FETCH_ASSOC);
|
|
}
|
|
|
|
public function getprestataireenmoins($idCollege) {
|
|
$sql = 'call sp_getprestataireenmoins(?);';
|
|
|
|
$college = $this->executerRequete($sql, array($idCollege));
|
|
return $college->fetchAll(PDO::FETCH_ASSOC);
|
|
}
|
|
|
|
public function getListeCollege($idPolice) {
|
|
$sql = 'SELECT id as code, CONCAT(codeProduit, " : ", libelleCollege) as libelle FROM college
|
|
where (idPolice=?) order by 2';
|
|
$liste = $this->executerRequete($sql, array($idPolice));
|
|
return $liste;
|
|
// return $liste->fetch(PDO::FETCH_ASSOC);
|
|
}
|
|
|
|
// Prestataires dérogation TM
|
|
public function getprestatairereseautm($idCollege) {
|
|
$sql = 'call sp_getprestatairereseau_tm(?);';
|
|
|
|
$college = $this->executerRequete($sql, array($idCollege));
|
|
return $college->fetchAll(PDO::FETCH_ASSOC);
|
|
}
|
|
|
|
public function getprestatairetm($idCollege) {
|
|
$sql = 'call sp_getprestataire_tm(?);';
|
|
|
|
$college = $this->executerRequete($sql, array($idCollege));
|
|
return $college->fetchAll(PDO::FETCH_ASSOC);
|
|
}
|
|
|
|
|
|
public function majchampapplicationplafond($idGarantie, $choix)
|
|
{
|
|
/*
|
|
$sql = 'update garantie_temp set champApplication=? where (id=?)';
|
|
$this->executerRequete($sql, array($choix, $idGarantie));
|
|
*/
|
|
$sql = 'update garantie_temp set champApplication=?, primeParTete=? where (id=?)';
|
|
$this->executerRequete($sql, array($choix, $choix, $idGarantie));
|
|
}
|
|
|
|
public function changercategorieprimecollege_temp($codeProduit, $codeGcAssureur)
|
|
{
|
|
$user = $_SESSION['login'];
|
|
$idCollegeTemp = $_SESSION['idCollegeTemp'];
|
|
|
|
|
|
$sql = 'CALL sp_changer_categorie_prime_college_temp(?, ?, ?, ?);';
|
|
|
|
//var_dump($idCollegeTemp, $codeProduit, $codeGcAssureur, $user);
|
|
$resultat = $this->executerRequete($sql, array($idCollegeTemp, $codeProduit, $codeGcAssureur, $user));
|
|
|
|
return $resultat->fetchAll(PDO::FETCH_ASSOC);
|
|
}
|
|
|
|
public function maj_libelle_college($idCollegeTemp, $nouvLibelleCollege)
|
|
{
|
|
$sql = 'CALL sp_maj_libelle_college(?, ?);';
|
|
|
|
$this->executerRequete($sql, array($idCollegeTemp, $nouvLibelleCollege));
|
|
}
|
|
|
|
|
|
|
|
public function getPrimesCollege($idCollegeTemp)
|
|
{
|
|
if (est_anglophone())
|
|
{
|
|
$sql = 'CALL sp_get_primes_college_temp_eng(?);';
|
|
}
|
|
else
|
|
{
|
|
$sql = 'CALL sp_get_primes_college_temp(?);';
|
|
}
|
|
|
|
$resultat = $this->executerRequete($sql, array($idCollegeTemp));
|
|
|
|
return $resultat->fetchAll(PDO::FETCH_ASSOC);
|
|
}
|
|
|
|
public function getPrimeMincollege($idPrime){
|
|
$sql = "select primeMin
|
|
from primecollege_temp
|
|
where id=?;";
|
|
|
|
$resultat = $this->executerRequete($sql, array($idPrime));
|
|
return $resultat->fetch(PDO::FETCH_ASSOC);
|
|
}
|
|
|
|
public function getStatut($idPrime){
|
|
$sql = "select codeLienParente
|
|
from primecollege_temp
|
|
where id=?;";
|
|
|
|
$resultat = $this->executerRequete($sql, array($idPrime));
|
|
return $resultat->fetch(PDO::FETCH_ASSOC);
|
|
}
|
|
|
|
|
|
public function getIdCollegeTemp($idPrime){
|
|
$sql = "select idCollegeTemp
|
|
from primecollege_temp
|
|
where id=?;";
|
|
|
|
$resultat = $this->executerRequete($sql, array($idPrime));
|
|
return $resultat->fetch(PDO::FETCH_ASSOC);
|
|
}
|
|
|
|
public function getNombreFamille($idCollegeTemp){
|
|
$sql = "select population
|
|
from primecollege_temp
|
|
where idCollegeTemp=?
|
|
and codeLienParente='A';";
|
|
|
|
$resultat = $this->executerRequete($sql, array($idCollegeTemp));
|
|
return $resultat->fetch(PDO::FETCH_ASSOC);
|
|
|
|
}
|
|
|
|
|
|
public function getNombreDependants($idCollegeTemp){
|
|
$sql = "select SUM(population) as nbdependant
|
|
from primecollege_temp
|
|
where idCollegeTemp=?
|
|
and codeLienParente<>'A';";
|
|
|
|
$resultat = $this->executerRequete($sql, array($idCollegeTemp));
|
|
return $resultat->fetch(PDO::FETCH_ASSOC);
|
|
|
|
}
|
|
|
|
public function majprimecollege($idPrime, $prime)
|
|
{
|
|
|
|
$sql = 'UPDATE primecollege_temp SET
|
|
prime=?,
|
|
primeTarif=?,
|
|
maj = "1"
|
|
WHERE (id=?)';
|
|
|
|
$this->executerRequete($sql, array($prime, $prime, $idPrime));
|
|
}
|
|
|
|
public function majpopulationcollege($idPrime, $population)
|
|
{
|
|
|
|
|
|
$sql = 'UPDATE primecollege_temp SET
|
|
population=?,
|
|
maj = "1"
|
|
WHERE (id=?)';
|
|
$this->executerRequete($sql, array($population, $idPrime));
|
|
}
|
|
|
|
public function majforfaitcollege($idPrime, $forfait)
|
|
{
|
|
$sql = 'update primecollege_temp set forfait=? where (id=?)';
|
|
$this->executerRequete($sql, array($forfait, $idPrime));
|
|
}
|
|
|
|
|
|
public function majplafondcollege($idPrime, $plafond)
|
|
{
|
|
|
|
$sql = 'UPDATE primecollege_temp SET
|
|
forfaitPlafond=?,
|
|
plafondBeneficiaire=?,
|
|
maj = "1"
|
|
WHERE (id=?);';
|
|
$this->executerRequete($sql, array($plafond, $plafond, $idPrime));
|
|
|
|
}
|
|
|
|
public function majplafondfamille($plafond)
|
|
{
|
|
$idCollegeTemp = $_SESSION['idCollegeTemp'];
|
|
|
|
$sql = "update primecollege_temp
|
|
set forfait = 1, forfaitPlafond=?, plafondBeneficiaire=?
|
|
where (idCollegeTemp=?) and codeLienParente='A';";
|
|
$this->executerRequete($sql, array($plafond, $plafond, $idCollegeTemp));
|
|
|
|
}
|
|
|
|
|
|
public function majplafondIndividu($plafond)
|
|
{
|
|
$idCollegeTemp = $_SESSION['idCollegeTemp'];
|
|
|
|
$sql = "update primecollege_temp
|
|
set forfait = 1, forfaitPlafond=?, plafondBeneficiaire=?
|
|
where (idCollegeTemp=?);";
|
|
$this->executerRequete($sql, array($plafond, $plafond, $idCollegeTemp));
|
|
|
|
}
|
|
|
|
|
|
public function ajouterPrimesCollege($idCollege, $idCollegeTemp)
|
|
{
|
|
$sql = 'call sp_ajouter_prime_college(?, ?)';
|
|
|
|
$this->executerRequete($sql, array($idCollege, $idCollegeTemp));
|
|
}
|
|
|
|
public function getCollegeLienParenteTemp($idCollegeTemp, $codeLienParente)
|
|
{
|
|
$sql = 'call sp_afficher_college_lien_parente_temp(?, ?)';
|
|
|
|
$collegeTemp = $this->executerRequete($sql, array($idCollegeTemp, $codeLienParente));
|
|
|
|
return $collegeTemp->fetch();
|
|
}
|
|
|
|
public function getGarantieLienParente($idCollegeTemp, $codeLienParente)
|
|
{
|
|
if (est_anglophone())
|
|
{
|
|
$sql = 'CALL sp_afficher_garantie_college_lien_parente_temp_eng(?, ?);';
|
|
}
|
|
else
|
|
{
|
|
$sql = 'CALL sp_afficher_garantie_college_lien_parente_temp(?, ?);';
|
|
}
|
|
|
|
$resultat = $this->executerRequete($sql, array($idCollegeTemp, $codeLienParente));
|
|
|
|
return $resultat->fetchAll(PDO::FETCH_ASSOC);
|
|
}
|
|
|
|
public function getGarantieConsulter($idCollege, $codeProduit)
|
|
{
|
|
|
|
$sql = 'CALL sp_afficher_garantie_college(?, ?);';
|
|
|
|
$resultat = $this->executerRequete($sql, array($idCollege, $codeProduit));
|
|
|
|
return $resultat->fetchAll(PDO::FETCH_ASSOC);
|
|
}
|
|
|
|
|
|
public function enregistrercollegelienparentetemp($idCollegeTemp,$codeProduit,$codeCollegeType,$codeReseau,
|
|
$codeTypeRemboursement,$codeTerritoire,$codeLienParente,$libelleCollege,$ticketModerateurCollege,$delaiCarenceCollege,
|
|
$plafondCollege,$idPolice,$numeroPolice,$accessoireManuel,$rachatTm,$tauxRachatTm,$tauxPrimeRachatTm,$budgetDefini,
|
|
$montantBudget,$nbAdherent,$nbAyantdroit,$codeTypeTarifActe,$codeTarifActe,$codeGcAssureur,$idBaremePriseEnCharge,
|
|
$codeBaseTarification, $seuilRdCollege, $plafondAdherent,$forfaitHonoraire,$forfaitAppelFond,$forfaitAppelCotisation,
|
|
$ticketModerateurHorsReseau, $ageLimiteEnfantEleve, $numeroOptionTarif)
|
|
{
|
|
|
|
$plafondAdherent = str_replace(' ', '', $plafondAdherent);
|
|
|
|
$sql = 'call sp_enregistrer_college_lien_parente_temp(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,
|
|
?,?,?,?,?,?,?,?,?,?,?,?,?,?);';
|
|
|
|
$this->executerRequete($sql, array($idCollegeTemp,$codeProduit,$codeCollegeType,$codeReseau,
|
|
$codeTypeRemboursement,$codeTerritoire,$codeLienParente,$libelleCollege,$ticketModerateurCollege,
|
|
$delaiCarenceCollege, $plafondCollege,$idPolice,$numeroPolice,$accessoireManuel,$rachatTm,$tauxRachatTm,$tauxPrimeRachatTm,$budgetDefini,
|
|
$montantBudget,$nbAdherent,$nbAyantdroit,$codeTypeTarifActe,$codeTarifActe,$codeGcAssureur,$idBaremePriseEnCharge,
|
|
$codeBaseTarification, $seuilRdCollege, $plafondAdherent,$forfaitHonoraire,$forfaitAppelFond,$forfaitAppelCotisation,
|
|
$ticketModerateurHorsReseau, $ageLimiteEnfantEleve, $numeroOptionTarif));
|
|
}
|
|
|
|
public function getprestationlienparente($idCollegeTemp, $codeLienParente)
|
|
{
|
|
if (est_anglophone())
|
|
{
|
|
$sql = 'call sp_get_prestation_lien_parente_temp_eng(?, ?)';
|
|
}
|
|
else
|
|
{
|
|
$sql = 'call sp_get_prestation_lien_parente_temp(?, ?)';
|
|
}
|
|
|
|
$resultat = $this->executerRequete($sql, array($idCollegeTemp, $codeLienParente));
|
|
|
|
return $resultat->fetchAll(PDO::FETCH_ASSOC);
|
|
}
|
|
|
|
public function getreseauhorslienparente($idCollegeTemp, $codeLienParente)
|
|
{
|
|
if (est_anglophone())
|
|
{
|
|
$sql = 'call sp_get_reseaus_hors_lien_parente_eng(?, ?, ?)';
|
|
}
|
|
else
|
|
{
|
|
$sql = 'call sp_get_reseaus_hors_lien_parente(?, ?, ?)';
|
|
}
|
|
|
|
$codeSociete = $_SESSION['codeSociete'];
|
|
|
|
$resultat = $this->executerRequete($sql, array($codeSociete, $idCollegeTemp, $codeLienParente));
|
|
|
|
return $resultat->fetchAll(PDO::FETCH_ASSOC);
|
|
}
|
|
|
|
public function majtmlienparente($idPrestation, $tm)
|
|
{
|
|
$sql = 'update prestationlienparente_temp set tm=? where (id=?)';
|
|
$this->executerRequete($sql, array($tm, $idPrestation));
|
|
}
|
|
|
|
public function ajoutertousreseaulienparente($idCollegeTemp, $codeLienParente)
|
|
{
|
|
$sql = 'call sp_r_ajouter_tous_reseau_lien_parente_temp(?, ?, ?)';
|
|
|
|
$this->executerRequete($sql, array($idCollegeTemp, $codeLienParente));
|
|
}
|
|
|
|
public function retirerunreseaulienparente($idCollegeTemp, $codeLienParente, $codeReseau)
|
|
{
|
|
$sql = 'call sp_r_retirer_reseau_lien_parente_temp(?, ?, ?)';
|
|
|
|
$this->executerRequete($sql, array($idCollegeTemp, $codeLienParente, $codeReseau));
|
|
}
|
|
|
|
public function ajouterunreseaulienparente($idCollegeTemp, $codeLienParente, $codeReseau)
|
|
{
|
|
$sql = 'call sp_r_ajouter_reseau_lien_parente_temp(?, ?, ?)';
|
|
|
|
$this->executerRequete($sql, array($idCollegeTemp, $codeLienParente, $codeReseau));
|
|
}
|
|
|
|
public function imposerplafondlienparente($idGarantie, $plafond)
|
|
{
|
|
$sql = 'update garantielienparente_temp set plafond=? where (id=?)';
|
|
$this->executerRequete($sql, array($plafond, $idGarantie));
|
|
}
|
|
|
|
public function majpopulationcollegeliste()
|
|
{
|
|
$idCollegeTemp = $_SESSION['idCollegeTemp'];
|
|
|
|
$sql = 'call sp_maj_population_college_liste_temp(?)';
|
|
|
|
$this->executerRequete($sql, array($idCollegeTemp));
|
|
}
|
|
|
|
public function majpopulationcollegelistevalide()
|
|
{
|
|
$idCollegeTemp = $_SESSION['idCollegeTemp'];
|
|
|
|
$sql = 'call sp_maj_population_college_liste_valide(?)';
|
|
|
|
$this->executerRequete($sql, array($idCollegeTemp));
|
|
}
|
|
|
|
public function getNomStatus($codeLienParente)
|
|
{
|
|
$sql = 'SELECT codeLienParente, libelle, libelleEng FROM lienparente
|
|
WHERE codeLienParente=?;';
|
|
|
|
$resultat = $this->executerRequete($sql, array($codeLienParente));
|
|
return $resultat->fetch(PDO::FETCH_ASSOC);
|
|
}
|
|
|
|
public function getNomGarant($codeGcAssureur)
|
|
{
|
|
$sql = 'SELECT libelle FROM gc_assureur
|
|
WHERE codeGcAssureur=?;';
|
|
|
|
$resultat = $this->executerRequete($sql, array($codeGcAssureur))->fetch(PDO::FETCH_ASSOC);
|
|
|
|
return $resultat['libelle'];
|
|
}
|
|
|
|
public function getTauxForfait(){
|
|
if (est_anglophone()){
|
|
$sql = "SELECT id AS code, libelleEng AS libelle
|
|
FROM choixforfaittaux
|
|
where id='1';";
|
|
}else{
|
|
$sql = "SELECT id AS code, libelle
|
|
FROM choixforfaittaux
|
|
where id='1';";
|
|
}
|
|
$resultat = $this->executerRequete($sql);
|
|
|
|
return $resultat->fetchAll(PDO::FETCH_ASSOC);
|
|
}
|
|
|
|
public function getObservationplafond(){
|
|
if (est_anglophone()){
|
|
$sql = "SELECT codeObservation AS code, libelleEng AS libelle
|
|
FROM observationsplafond order by libelle;";
|
|
}else{
|
|
$sql = "SELECT codeObservation AS code, libelle
|
|
FROM observationsplafond order by libelle;";
|
|
}
|
|
$resultat = $this->executerRequete($sql);
|
|
|
|
return $resultat->fetchAll(PDO::FETCH_ASSOC);
|
|
}
|
|
|
|
public function getNomGarantie($codeGarantie)
|
|
{
|
|
$sql = 'SELECT codeGarantie, libelle, libelleEng FROM garantie
|
|
WHERE codeSociete = ? and codeGarantie=?;';
|
|
|
|
$resultat = $this->executerRequete($sql, array($_SESSION['codeSociete'],$codeGarantie));
|
|
return $resultat->fetch(PDO::FETCH_ASSOC);
|
|
}
|
|
|
|
|
|
public function getBaremeProduit($codeProduit, $codeGcAssureur){
|
|
|
|
$sql = "SELECT id AS code, libelle
|
|
FROM baremepriseencharge
|
|
WHERE codeProduit=?
|
|
AND codeGcAssureur=?;";
|
|
|
|
$resultat = $this->executerRequete($sql, array($codeProduit,$codeGcAssureur));
|
|
|
|
return $resultat->fetchAll(PDO::FETCH_ASSOC);
|
|
}
|
|
|
|
///////////////////////////////////particulariteStatus//////////////////////////////////////////
|
|
|
|
public function majageLimiteStatutcollege_temp($ageLimiteStatus, $codeLienParente){
|
|
|
|
$idCollegeTemp = $_SESSION['idCollegeTemp'];
|
|
|
|
switch ($codeLienParente):
|
|
case "A":
|
|
$sql = 'update college_temp set ageLimiteAdherent=? where (id=?)';
|
|
$this->executerRequete($sql, array($ageLimiteStatus, $idCollegeTemp));
|
|
break;
|
|
case "C":
|
|
$sql = 'update college_temp set ageLimiteConjoint=? where (id=?)';
|
|
$this->executerRequete($sql, array($ageLimiteStatus, $idCollegeTemp));
|
|
break;
|
|
case "D":
|
|
$sql = 'update college_temp set ageLimiteAutreConjoint=? where (id=?)';
|
|
$this->executerRequete($sql, array($ageLimiteStatus, $idCollegeTemp));
|
|
break;
|
|
case "E":
|
|
$sql = 'update college_temp set ageLimiteEnfant=? where (id=?)';
|
|
$this->executerRequete($sql, array($ageLimiteStatus, $idCollegeTemp));
|
|
break;
|
|
case "F":
|
|
$sql = 'update college_temp set ageLimiteAscendant=? where (id=?)';
|
|
$this->executerRequete($sql, array($ageLimiteStatus, $idCollegeTemp));
|
|
break;
|
|
case "O":
|
|
$sql = 'update college_temp set ageLimiteAutre=? where (id=?)';
|
|
$this->executerRequete($sql, array($ageLimiteStatus, $idCollegeTemp));
|
|
endswitch;
|
|
}
|
|
|
|
|
|
public function majageLimiteStatus($idCollege, $ageLimiteStatus, $codeLienParente)
|
|
{
|
|
$this->majageLimiteStatutcollege_temp($ageLimiteStatus, $codeLienParente);
|
|
|
|
$sql = 'update collegelienparente_temp set ageLimiteStatus=? where (id=?)';
|
|
$this->executerRequete($sql, array($ageLimiteStatus, $idCollege));
|
|
}
|
|
|
|
public function majageLimiteStatutElevecollege_temp($ageLimiteStatus, $codeLienParente){
|
|
$idCollegeTemp = $_SESSION['idCollegeTemp'];
|
|
|
|
$sql = 'update college_temp set ageLimiteEnfantEleve=? where (id=?)';
|
|
$this->executerRequete($sql, array($ageLimiteStatus, $idCollegeTemp));
|
|
}
|
|
|
|
|
|
public function majageLimiteStatusEleve($idCollege, $ageLimiteStatusEleve, $codeLienParente)
|
|
{
|
|
$this->majageLimiteStatutElevecollege_temp($ageLimiteStatus, $codeLienParente);
|
|
|
|
$sql = 'update collegelienparente_temp set ageLimiteStatusEleve=? where (id=?)';
|
|
$this->executerRequete($sql, array($ageLimiteStatusEleve, $idCollege));
|
|
}
|
|
|
|
public function majticketModerateurStatuscollege_temp($ticketModerateurStatus, $codeLienParente){
|
|
|
|
$idCollegeTemp = $_SESSION['idCollegeTemp'];
|
|
|
|
switch ($codeLienParente):
|
|
case "A":
|
|
$sql = 'update college_temp set ticketModerateurAdherent=? where (id=?)';
|
|
$this->executerRequete($sql, array($ticketModerateurStatus, $idCollegeTemp));
|
|
break;
|
|
case "C":
|
|
$sql = 'update college_temp set ticketModerateurConjoint=? where (id=?)';
|
|
$this->executerRequete($sql, array($ticketModerateurStatus, $idCollegeTemp));
|
|
break;
|
|
case "D":
|
|
$sql = 'update college_temp set ticketModerateurAutreConjoint=? where (id=?)';
|
|
$this->executerRequete($sql, array($ticketModerateurStatus, $idCollegeTemp));
|
|
break;
|
|
case "E":
|
|
$sql = 'update college_temp set ticketModerateurEnfant=? where (id=?)';
|
|
$this->executerRequete($sql, array($ticketModerateurStatus, $idCollegeTemp));
|
|
break;
|
|
case "F":
|
|
$sql = 'update college_temp set ticketModerateurAscendant=? where (id=?)';
|
|
$this->executerRequete($sql, array($ticketModerateurStatus, $idCollegeTemp));
|
|
break;
|
|
case "O":
|
|
$sql = 'update college_temp set ticketModerateurAutre=? where (id=?)';
|
|
$this->executerRequete($sql, array($ticketModerateurStatus, $idCollegeTemp));
|
|
endswitch;
|
|
}
|
|
|
|
public function majticketModerateurStatus($idCollege, $ticketModerateurStatus, $codeLienParente)
|
|
{
|
|
$this->majticketModerateurStatuscollege_temp($ticketModerateurStatus, $codeLienParente);
|
|
|
|
$sql = 'update collegelienparente_temp set ticketModerateurStatus=? where (id=?)';
|
|
$this->executerRequete($sql, array($ticketModerateurStatus, $idCollege));
|
|
}
|
|
|
|
public function majticketModerateurStatusElevecollege_temp($ticketModerateurStatus, $codeLienParente){
|
|
$idCollegeTemp = $_SESSION['idCollegeTemp'];
|
|
|
|
$sql = 'update college_temp set ticketModerateurEnfantEleve=? where (id=?)';
|
|
$this->executerRequete($sql, array($ticketModerateurStatus, $idCollegeTemp));
|
|
}
|
|
|
|
|
|
public function majticketModerateurStatusEleve($idCollege, $ticketModerateurStatusEleve, $codeLienParente)
|
|
{
|
|
$this->majticketModerateurStatusElevecollege_temp($ticketModerateurStatus, $codeLienParente);
|
|
|
|
$sql = 'update collegelienparente_temp set ticketModerateurStatusEleve=? where (id=?)';
|
|
$this->executerRequete($sql, array($ticketModerateurStatusEleve, $idCollege));
|
|
|
|
}
|
|
|
|
|
|
public function majsurprimeOptioncollege_temp($surprimeOption, $codeLienParente){
|
|
|
|
$idCollegeTemp = $_SESSION['idCollegeTemp'];
|
|
|
|
switch ($codeLienParente):
|
|
case "A":
|
|
$sql = 'update college_temp set surprimeOptionAdherent=? where (id=?)';
|
|
$this->executerRequete($sql, array($surprimeOption, $idCollegeTemp));
|
|
break;
|
|
case "C":
|
|
$sql = 'update college_temp set surprimeOptionConjoint=? where (id=?)';
|
|
$this->executerRequete($sql, array($surprimeOption, $idCollegeTemp));
|
|
break;
|
|
case "D":
|
|
$sql = 'update college_temp set surprimeOptionAutreConjoint=? where (id=?)';
|
|
$this->executerRequete($sql, array($surprimeOption, $idCollegeTemp));
|
|
break;
|
|
case "E":
|
|
$sql = 'update college_temp set surprimeOptionEnfant=? where (id=?)';
|
|
$this->executerRequete($sql, array($surprimeOption, $idCollegeTemp));
|
|
break;
|
|
case "F":
|
|
$sql = 'update college_temp set surprimeOptionAscendant=? where (id=?)';
|
|
$this->executerRequete($sql, array($surprimeOption, $idCollegeTemp));
|
|
break;
|
|
case "O":
|
|
$sql = 'update college_temp set surprimeOptionAutre=? where (id=?)';
|
|
$this->executerRequete($sql, array($surprimeOption, $idCollegeTemp));
|
|
endswitch;
|
|
}
|
|
|
|
public function majsurprimeOptionstatus($idCollege, $surprimeOption, $codeLienParente)
|
|
{
|
|
$this->majsurprimeOptioncollege_temp($surprimeOption, $codeLienParente);
|
|
|
|
$sql = 'update collegelienparente_temp set surprimeOption=? where (id=?)';
|
|
$this->executerRequete($sql, array($surprimeOption, $idCollege));
|
|
}
|
|
|
|
public function majsurprimeOptionstatuselevecollege_temp($surprimeOption, $codeLienParente){
|
|
$idCollegeTemp = $_SESSION['idCollegeTemp'];
|
|
|
|
$sql = 'update college_temp set surprimeOptionEnfantEleve=? where (id=?)';
|
|
$this->executerRequete($sql, array($surprimeOption, $idCollegeTemp));
|
|
}
|
|
|
|
|
|
public function majsurprimeOptionstatuseleve($idCollege, $surprimeOption, $codeLienParente)
|
|
{
|
|
$this->majsurprimeOptionstatuselevecollege_temp($surprimeOption, $codeLienParente);
|
|
|
|
$sql = 'update collegelienparente_temp set surprimeOptionEleve=? where (id=?)';
|
|
$this->executerRequete($sql, array($surprimeOption, $idCollege));
|
|
|
|
}
|
|
|
|
///////////////////////////////////garantielienparente_temp///////////////////////////////////
|
|
public function majgarantielienparente($idGarantie){
|
|
|
|
$sql = 'call sp_maj_garantielienparente_temp(?);';
|
|
$this->executerRequete($sql, array($idGarantie));
|
|
|
|
}
|
|
|
|
|
|
public function majforfaitgarantie($idGarantie, $forfait)
|
|
{
|
|
$sql = 'update garantielienparente_temp set forfait=? where (id=?)';
|
|
$this->executerRequete($sql, array($forfait, $idGarantie));
|
|
}
|
|
|
|
public function majplafondgarantie($idGarantie, $plafond, $choixForfait)
|
|
{
|
|
if($choixForfait =="1"){
|
|
$sql = 'update garantielienparente_temp set
|
|
forfaitPlafond=?,plafond=?
|
|
where (id=?)';
|
|
$this->executerRequete($sql, array($plafond, $plafond, $idGarantie));
|
|
}else{
|
|
$sql = 'update garantielienparente_temp set
|
|
tauxPlafond=?,tauxPlafondLimiteAdherent=?,tauxPlafondLimiteBeneficiaire=?
|
|
where (id=?)';
|
|
$this->executerRequete($sql, array($plafond, $plafond, $plafond, $idGarantie));
|
|
}
|
|
}
|
|
|
|
public function majnbretransactiongarantie($idGarantie, $nbreTransaction)
|
|
{
|
|
$sql = 'update garantielienparente_temp set nbreTransaction=? where (id=?)';
|
|
$this->executerRequete($sql, array($nbreTransaction, $idGarantie));
|
|
}
|
|
|
|
public function majperiodicitegarantie($idGarantie, $codePeriodicite)
|
|
{
|
|
$sql = 'update garantielienparente_temp set codePeriodicite=? where (id=?)';
|
|
$this->executerRequete($sql, array($codePeriodicite, $idGarantie));
|
|
}
|
|
|
|
public function majdelaicarencegarantie($idGarantie, $delaiCarenceFamilleActe){
|
|
$sql = 'update garantielienparente_temp set delaiCarenceFamilleActe=? where (id=?)';
|
|
$this->executerRequete($sql, array($delaiCarenceFamilleActe, $idGarantie));
|
|
|
|
}
|
|
|
|
public function majticketmoderateurgarantie($idGarantie, $ticketModerateur)
|
|
{
|
|
$sql = 'update garantielienparente_temp set ticketModerateur=? where (id=?)';
|
|
$this->executerRequete($sql, array($ticketModerateur, $idGarantie));
|
|
}
|
|
|
|
public function trouvelibelleobservationplafond($codeObservation){
|
|
$codeSociete = $_SESSION['codeSociete'];
|
|
if (est_anglophone()){
|
|
$sql = 'SELECT id, libelleEng as libelle FROM observationsplafond WHERE (codeSociete=?) AND (codeObservation=?)';
|
|
}else{
|
|
$sql = 'SELECT id, libelle FROM observationsplafond WHERE (codeSociete=?) AND (codeObservation=?)';
|
|
}
|
|
|
|
$resultat = $this->executerRequete($sql, array($codeSociete, $codeObservation));
|
|
|
|
return $resultat->fetch();
|
|
}
|
|
|
|
public function majplafondlettregarantie($idGarantie, $codeObservation)
|
|
{
|
|
$plafondLettre = $this->trouvelibelleobservationplafond($codeObservation);
|
|
|
|
$sql = 'update garantielienparente_temp set plafondLettre=?, codeObservation=? where (id=?)';
|
|
$this->executerRequete($sql, array($plafondLettre['libelle'], $codeObservation, $idGarantie));
|
|
}
|
|
|
|
///////////////////////////////////familleacte///////////////////////////////////////////////
|
|
|
|
public function existeligne($codeLienParente){
|
|
|
|
$idCollegeTemp = $_SESSION['idCollegeTemp'];
|
|
|
|
$sql = 'SELECT id FROM p_familleacte_produit_lienparente_temp
|
|
WHERE (codeSociete=?) and (idCollegeTemp=?) and (codeLienParente=?)';
|
|
$resultat = $this->executerRequete($sql, array($_SESSION['codeSociete'], $idCollegeTemp, $codeLienParente));
|
|
return ($resultat->rowCount() > 0);
|
|
}
|
|
|
|
public function majforfaitfamilleacte($idFamilleacte, $forfait)
|
|
{
|
|
$sql = 'update p_familleacte_produit_lienparente_temp set forfait=? where (id=?)';
|
|
$this->executerRequete($sql, array($forfait, $idFamilleacte));
|
|
}
|
|
|
|
public function majplafondfamilleacte($idFamilleacte, $plafond, $choixForfait)
|
|
{
|
|
if($choixForfait =="1"){
|
|
$sql = 'update p_familleacte_produit_lienparente_temp set forfaitPlafond=?,tauxPlafond=0 where (id=?)';
|
|
$this->executerRequete($sql, array($plafond, $idFamilleacte));
|
|
}else{
|
|
$sql = 'update p_familleacte_produit_lienparente_temp set tauxPlafond=?, forfaitPlafond=0 where (id=?)';
|
|
$this->executerRequete($sql, array($plafond, $idFamilleacte));
|
|
}
|
|
}
|
|
|
|
public function majnbretransactionfamilleacte($idFamilleacte, $nbreTransaction)
|
|
{
|
|
$sql = 'update p_familleacte_produit_lienparente_temp set nbreTransaction=? where (id=?)';
|
|
$this->executerRequete($sql, array($nbreTransaction, $idFamilleacte));
|
|
}
|
|
|
|
public function majperiodicitefamilleacte($idFamilleacte, $codePeriodicite)
|
|
{
|
|
$sql = 'update p_familleacte_produit_lienparente_temp set codePeriodicite=? where (id=?)';
|
|
$this->executerRequete($sql, array($codePeriodicite, $idFamilleacte));
|
|
}
|
|
|
|
public function majobservationfamilleacte($idFamilleacte, $codeObservation)
|
|
{
|
|
//var_dump($codeObservation);
|
|
if($codeObservation=="IL"){
|
|
$sql = 'update p_familleacte_produit_lienparente_temp
|
|
set codeObservation=?,
|
|
forfaitPlafond =9999999999
|
|
where (id=?)';
|
|
}else{
|
|
$sql = 'update p_familleacte_produit_lienparente_temp set codeObservation=? where (id=?)';
|
|
}
|
|
|
|
$this->executerRequete($sql, array($codeObservation, $idFamilleacte));
|
|
}
|
|
|
|
public function majdelaicarencefamilleacte($idFamilleacte, $delaiCarenceFamilleActe){
|
|
$sql = 'update p_familleacte_produit_lienparente_temp set delaiCarenceFamilleActe=? where (id=?)';
|
|
$this->executerRequete($sql, array($delaiCarenceFamilleActe, $idFamilleacte));
|
|
|
|
}
|
|
|
|
|
|
public function majticketmoderateurfamilleacte($idFamilleacte, $ticketModerateur)
|
|
{
|
|
$sql = 'update p_familleacte_produit_lienparente_temp set ticketModerateur=? where (id=?)';
|
|
$this->executerRequete($sql, array($ticketModerateur, $idFamilleacte));
|
|
}
|
|
|
|
|
|
////////////////////////////actes//////////////////////////////////
|
|
|
|
public function majforfaitacte($idActe, $forfait)
|
|
{
|
|
$sql = 'update p_acte_collegelienparente_temp set forfait=? where (id=?)';
|
|
$this->executerRequete($sql, array($forfait, $idActe));
|
|
}
|
|
|
|
public function majplafondacte($idActe, $plafond, $choixForfait)
|
|
{
|
|
if($choixForfait =="1"){
|
|
$sql = 'update p_acte_collegelienparente_temp set forfaitPlafond=? where (id=?)';
|
|
$this->executerRequete($sql, array($plafond, $idActe));
|
|
}else{
|
|
$sql = 'update p_acte_collegelienparente_temp set tauxPlafond=? where (id=?)';
|
|
$this->executerRequete($sql, array($plafond, $idActe));
|
|
}
|
|
}
|
|
|
|
public function majnbretransactionacte($idActe, $nbreTransaction)
|
|
{
|
|
$sql = 'update p_acte_collegelienparente_temp set nbreTransaction=? where (id=?)';
|
|
$this->executerRequete($sql, array($nbreTransaction, $idActe));
|
|
}
|
|
|
|
public function majperiodiciteacte($idActe, $codePeriodicite)
|
|
{
|
|
$sql = 'update p_acte_collegelienparente_temp set codePeriodicite=? where (id=?)';
|
|
$this->executerRequete($sql, array($codePeriodicite, $idActe));
|
|
}
|
|
|
|
|
|
public function majobservationacte($idActe, $codeObservation)
|
|
{
|
|
if($codeObservation=="EP"){
|
|
$sql = 'update p_acte_collegelienparente_temp set codeObservation=?, ententePrealable="1" where (id=?)';
|
|
}elseif($codeObservation=="IL"){
|
|
$sql = 'update p_acte_collegelienparente_temp
|
|
set codeObservation=?,
|
|
ententePrealable="0",
|
|
forfaitPlafond =9999999999
|
|
where (id=?)';
|
|
}else{
|
|
$sql = 'update p_acte_collegelienparente_temp set codeObservation=?, ententePrealable="0" where (id=?)';
|
|
}
|
|
|
|
$this->executerRequete($sql, array($codeObservation, $idActe));
|
|
}
|
|
|
|
public function majdelaicarenceacte($idActe, $delaiCarenceActe){
|
|
$sql = 'update p_acte_collegelienparente_temp set delaiCarenceActe=? where (id=?)';
|
|
$this->executerRequete($sql, array($delaiCarenceActe, $idActe));
|
|
|
|
}
|
|
|
|
public function majticketmoderateuracte($idActe, $ticketModerateur)
|
|
{
|
|
$sql = 'update p_acte_collegelienparente_temp set ticketModerateur=? where (id=?)';
|
|
$this->executerRequete($sql, array($ticketModerateur, $idActe));
|
|
}
|
|
|
|
//////////////////////////////ToutFamilleacte///////////////////////////////////
|
|
|
|
public function majtoutforfaitfamilleacte($forfaitFamilleActe){
|
|
$codeSociete = $_SESSION['codeSociete'];
|
|
$idCollegeTemp = $_SESSION['idCollegeTemp'];
|
|
$codeLienParente = $_SESSION['codeLienParente'];
|
|
$codeGarantie = $_SESSION['codeGarantie'];
|
|
|
|
$sql = 'UPDATE p_familleacte_produit_lienparente_temp SET forfait=?
|
|
WHERE (codeSociete=? AND idCollegeTemp=? AND
|
|
codeLienParente=? AND codeGarantie=?);';
|
|
$this->executerRequete($sql, array($forfaitFamilleActe,$codeSociete,$idCollegeTemp,$codeLienParente,$codeGarantie));
|
|
}
|
|
|
|
|
|
public function majtoutplafondfamilleacte($plafondFamilleActe, $choixForfait)
|
|
{
|
|
$codeSociete = $_SESSION['codeSociete'];
|
|
$idCollegeTemp = $_SESSION['idCollegeTemp'];
|
|
$codeLienParente = $_SESSION['codeLienParente'];
|
|
$codeGarantie = $_SESSION['codeGarantie'];
|
|
|
|
if($choixForfait =="1"){
|
|
$sql = 'update p_familleacte_produit_lienparente_temp set forfaitPlafond=?
|
|
WHERE (codeSociete=? AND idCollegeTemp=? AND
|
|
codeLienParente=? AND codeGarantie=?);';
|
|
$this->executerRequete($sql, array($plafondFamilleActe,$codeSociete,$idCollegeTemp,$codeLienParente,$codeGarantie));
|
|
}else{
|
|
$sql = 'update p_familleacte_produit_lienparente_temp set tauxPlafond=?
|
|
WHERE (codeSociete=? AND idCollegeTemp=? AND
|
|
codeLienParente=? AND codeGarantie=?);';
|
|
$this->executerRequete($sql, array($plafondFamilleActe));
|
|
}
|
|
}
|
|
|
|
public function majtoutnbretransactionfamilleacte($nbreTransactionFamilleActe)
|
|
{
|
|
$codeSociete = $_SESSION['codeSociete'];
|
|
$idCollegeTemp = $_SESSION['idCollegeTemp'];
|
|
$codeLienParente = $_SESSION['codeLienParente'];
|
|
$codeGarantie = $_SESSION['codeGarantie'];
|
|
|
|
$sql = 'update p_familleacte_produit_lienparente_temp set nbreTransaction=?
|
|
WHERE (codeSociete=? AND idCollegeTemp=? AND
|
|
codeLienParente=? AND codeGarantie=?);';
|
|
$this->executerRequete($sql, array($nbreTransactionFamilleActe,$codeSociete,$idCollegeTemp,$codeLienParente,$codeGarantie));
|
|
}
|
|
|
|
|
|
public function majtoutperiodicitefamilleacte($codePeriodiciteFamilleActe)
|
|
{
|
|
$codeSociete = $_SESSION['codeSociete'];
|
|
$idCollegeTemp = $_SESSION['idCollegeTemp'];
|
|
$codeLienParente = $_SESSION['codeLienParente'];
|
|
$codeGarantie = $_SESSION['codeGarantie'];
|
|
|
|
$sql = 'update p_familleacte_produit_lienparente_temp set codePeriodicite=?
|
|
WHERE (codeSociete=? AND idCollegeTemp=? AND
|
|
codeLienParente=? AND codeGarantie=?);';
|
|
$this->executerRequete($sql, array($codePeriodiciteFamilleActe,$codeSociete,$idCollegeTemp,$codeLienParente,$codeGarantie));
|
|
}
|
|
|
|
public function majtoutdelaicarencefamilleacte($delaiCarenceFamilleActe){
|
|
$codeSociete = $_SESSION['codeSociete'];
|
|
$idCollegeTemp = $_SESSION['idCollegeTemp'];
|
|
$codeLienParente = $_SESSION['codeLienParente'];
|
|
$codeGarantie = $_SESSION['codeGarantie'];
|
|
|
|
$sql = 'update p_familleacte_produit_lienparente_temp set delaiCarenceFamilleActe=?
|
|
WHERE (codeSociete=? AND idCollegeTemp=? AND
|
|
codeLienParente=? AND codeGarantie=?);';
|
|
$this->executerRequete($sql, array($delaiCarenceFamilleActe,$codeSociete,$idCollegeTemp,$codeLienParente,$codeGarantie));
|
|
|
|
}
|
|
|
|
public function majtoutticketmoderateurfamilleacte($ticketModerateurFamilleActe)
|
|
{
|
|
$codeSociete = $_SESSION['codeSociete'];
|
|
$idCollegeTemp = $_SESSION['idCollegeTemp'];
|
|
$codeLienParente = $_SESSION['codeLienParente'];
|
|
$codeGarantie = $_SESSION['codeGarantie'];
|
|
|
|
$sql = 'update p_familleacte_produit_lienparente_temp set ticketModerateur=?
|
|
WHERE (codeSociete=? AND idCollegeTemp=? AND
|
|
codeLienParente=? AND codeGarantie=?);';
|
|
$this->executerRequete($sql, array($ticketModerateurFamilleActe,$codeSociete,$idCollegeTemp,$codeLienParente,$codeGarantie));
|
|
}
|
|
|
|
// 05-11-2020
|
|
|
|
public function viderfamilleacteproduitlienparente(){
|
|
$sql = 'DELETE FROM p_familleacte_produit_lienparente_temp;';
|
|
$this->executerRequete($sql);
|
|
}
|
|
|
|
public function videractecollegelienparente_temp(){
|
|
$sql = 'DELETE FROM p_acte_collegelienparente_temp;';
|
|
$this->executerRequete($sql);
|
|
}
|
|
|
|
//////////////////////////////Toutacte///////////////////////////////////
|
|
|
|
public function majtoutforfaitacte($forfaitActe){
|
|
$codeSociete = $_SESSION['codeSociete'];
|
|
$idCollegeTemp = $_SESSION['idCollegeTemp'];
|
|
$codeLienParente = $_SESSION['codeLienParente'];
|
|
$codeGarantie = $_SESSION['codeGarantie'];
|
|
|
|
$sql = 'update p_acte_collegelienparente_temp set forfait=?
|
|
WHERE (codeSociete=? AND idCollegeTemp=? AND
|
|
codeLienParente=? AND codeGarantie=?);';
|
|
$this->executerRequete($sql, array($forfaitActe,$codeSociete,$idCollegeTemp,$codeLienParente,$codeGarantie));
|
|
}
|
|
|
|
|
|
public function majtoutplafondacte($plafondActe, $choixForfait)
|
|
{
|
|
$codeSociete = $_SESSION['codeSociete'];
|
|
$idCollegeTemp = $_SESSION['idCollegeTemp'];
|
|
$codeLienParente = $_SESSION['codeLienParente'];
|
|
$codeGarantie = $_SESSION['codeGarantie'];
|
|
|
|
if($choixForfait =="1"){
|
|
$sql = 'update p_acte_collegelienparente_temp set forfaitPlafond=?
|
|
WHERE (codeSociete=? AND idCollegeTemp=? AND
|
|
codeLienParente=? AND codeGarantie=?);';
|
|
$this->executerRequete($sql, array($plafondActe,$codeSociete,$idCollegeTemp,$codeLienParente,$codeGarantie));
|
|
}else{
|
|
$sql = 'update p_acte_collegelienparente_temp set tauxPlafond=?
|
|
WHERE (codeSociete=? AND idCollegeTemp=? AND
|
|
codeLienParente=? AND codeGarantie=?);';
|
|
$this->executerRequete($sql, array($plafondActe,$codeSociete,$idCollegeTemp,$codeLienParente,$codeGarantie));
|
|
}
|
|
}
|
|
|
|
public function majtoutnbretransactionacte($nbreTransactionActe)
|
|
{
|
|
$codeSociete = $_SESSION['codeSociete'];
|
|
$idCollegeTemp = $_SESSION['idCollegeTemp'];
|
|
$codeLienParente = $_SESSION['codeLienParente'];
|
|
$codeGarantie = $_SESSION['codeGarantie'];
|
|
|
|
$sql = 'update p_acte_collegelienparente_temp set nbreTransaction=?
|
|
WHERE (codeSociete=? AND idCollegeTemp=? AND
|
|
codeLienParente=? AND codeGarantie=?);';
|
|
$this->executerRequete($sql, array($nbreTransactionActe,$codeSociete,$idCollegeTemp,$codeLienParente,$codeGarantie));
|
|
}
|
|
|
|
|
|
public function majtoutcodeperiodiciteacte($codePeriodiciteActe)
|
|
{
|
|
$codeSociete = $_SESSION['codeSociete'];
|
|
$idCollegeTemp = $_SESSION['idCollegeTemp'];
|
|
$codeLienParente = $_SESSION['codeLienParente'];
|
|
$codeGarantie = $_SESSION['codeGarantie'];
|
|
|
|
$sql = 'update p_acte_collegelienparente_temp set codePeriodicite=?
|
|
WHERE (codeSociete=? AND idCollegeTemp=? AND
|
|
codeLienParente=? AND codeGarantie=?);';
|
|
$this->executerRequete($sql, array($codePeriodiciteActe,$codeSociete,$idCollegeTemp,$codeLienParente,$codeGarantie));
|
|
}
|
|
|
|
public function majtoutobservationacte($codeObservationActe)
|
|
{
|
|
$codeSociete = $_SESSION['codeSociete'];
|
|
$idCollegeTemp = $_SESSION['idCollegeTemp'];
|
|
$codeLienParente = $_SESSION['codeLienParente'];
|
|
$codeGarantie = $_SESSION['codeGarantie'];
|
|
|
|
$sql = 'update p_acte_collegelienparente_temp set codeObservation=?
|
|
WHERE (codeSociete=? AND idCollegeTemp=? AND
|
|
codeLienParente=? AND codeGarantie=?);';
|
|
$this->executerRequete($sql, array($codeObservationActe,$codeSociete,$idCollegeTemp,$codeLienParente,$codeGarantie));
|
|
}
|
|
|
|
public function majtoutdelaicarenceacte($delaiCarenceActe){
|
|
$codeSociete = $_SESSION['codeSociete'];
|
|
$idCollegeTemp = $_SESSION['idCollegeTemp'];
|
|
$codeLienParente = $_SESSION['codeLienParente'];
|
|
$codeGarantie = $_SESSION['codeGarantie'];
|
|
|
|
$sql = 'update p_acte_collegelienparente_temp set delaiCarenceActe=?
|
|
WHERE (codeSociete=? AND idCollegeTemp=? AND
|
|
codeLienParente=? AND codeGarantie=?);';
|
|
$this->executerRequete($sql, array($delaiCarenceActe,$codeSociete,$idCollegeTemp,$codeLienParente,$codeGarantie));
|
|
|
|
}
|
|
|
|
public function majtoutticketmoderateuracte($ticketModerateurActe)
|
|
{
|
|
$codeSociete = $_SESSION['codeSociete'];
|
|
$idCollegeTemp = $_SESSION['idCollegeTemp'];
|
|
$codeLienParente = $_SESSION['codeLienParente'];
|
|
$codeGarantie = $_SESSION['codeGarantie'];
|
|
|
|
$sql = 'update p_acte_collegelienparente_temp set ticketModerateur=?
|
|
WHERE (codeSociete=? AND idCollegeTemp=? AND
|
|
codeLienParente=? AND codeGarantie=?);';
|
|
$this->executerRequete($sql, array($ticketModerateurActe,$codeSociete,$idCollegeTemp,$codeLienParente,$codeGarantie));
|
|
}
|
|
|
|
/////////////////////////////////
|
|
public function getGarantPolice($idPolice){
|
|
$sql = 'SELECT id, codeGcAssureur
|
|
FROM police
|
|
WHERE id = ?';
|
|
|
|
$garant = $this->executerRequete($sql, array($idPolice));
|
|
return $garant->fetch();
|
|
}
|
|
|
|
public function getTypeGarantPolice($idPolice){
|
|
|
|
$garant = $this->getGarantPolice($idPolice);
|
|
|
|
if(!empty($garant['codeGcAssureur'])){
|
|
$sql = 'SELECT a.typeGarant AS idTypeGarant, b.codeTypeGarant
|
|
FROM gc_assureur a
|
|
JOIN gc_typegarant b ON (b.id = a.typeGarant)
|
|
WHERE a.codeSociete =?
|
|
AND a.codeGcAssureur = ?;';
|
|
$typeGarant = $this->executerRequete($sql, array($_SESSION['codeSociete'], $garant['codeGcAssureur']));
|
|
|
|
return $typeGarant->fetch();
|
|
}else{
|
|
return false;
|
|
}
|
|
}
|
|
|
|
public function getTypeTarifActe(){
|
|
|
|
if (est_anglophone())
|
|
{
|
|
$sql = "SELECT codeTypeTarifActe AS code, libelleEng AS libelle
|
|
FROM p_typetarifacte
|
|
WHERE codeSociete =?
|
|
AND codeTypeTarifActe IN ('TCOL');";
|
|
}else{
|
|
$sql = "SELECT codeTypeTarifActe AS code, libelle
|
|
FROM p_typetarifacte
|
|
WHERE codeSociete =?
|
|
AND codeTypeTarifActe IN ('TCOL');";
|
|
}
|
|
|
|
$resultat = $this->executerRequete($sql, array($_SESSION['codeSociete']));
|
|
return $resultat->fetchAll();
|
|
}
|
|
|
|
public function getPopulationStatut($idCollegeTemp,$codeLienParente){
|
|
|
|
$sql = "SELECT codeLienParente, population
|
|
FROM primecollege_temp
|
|
WHERE (codeSociete = ?)
|
|
AND (codeLienParente = ?)
|
|
AND (idCollegeTemp = ?);";
|
|
|
|
$resultat = $this->executerRequete($sql, array($_SESSION['codeSociete'],$codeLienParente,$idCollegeTemp));
|
|
return $resultat->fetch();
|
|
}
|
|
|
|
public function dupliquerstatut($codeLienParente){
|
|
$codeSociete = $_SESSION['codeSociete'];
|
|
$idCollegeTemp = $_SESSION['idCollegeTemp'];
|
|
$codeProduit = $_SESSION['codeProduit'];
|
|
$user = $_SESSION['login'];
|
|
|
|
|
|
$sql = 'CALL sp_dupliquer_statut(?,?,?,?,?);';
|
|
$this->executerRequete($sql, array($codeSociete, $idCollegeTemp, $user));
|
|
}
|
|
|
|
public function chargerbareme($idBaremePriseEnCharge,$idCollegeTemp,$codeLienParente){
|
|
|
|
$user = $_SESSION['login'];
|
|
|
|
$sql = 'CALL sp_inserer_bareme_collegetemp(?, ?, ?, ?);';
|
|
|
|
$this->executerRequete($sql, array($idBaremePriseEnCharge,$idCollegeTemp,$codeLienParente,$user));
|
|
|
|
}
|
|
|
|
|
|
public function majprimebase($codeBaseTarification, $codeProduit, $codeGcAssureur)
|
|
{
|
|
$codeSociete = $_SESSION['codeSociete'];
|
|
$user = $_SESSION['login'];
|
|
|
|
$idCollegeTemp = $_SESSION['idCollegeTemp'];
|
|
|
|
if($codeBaseTarification=="FAM"){
|
|
$sql = "CALL sp_maj_prime_base_famille(?,?,?,?,?)";
|
|
}elseif($codeBaseTarification=="IND"){
|
|
$sql = "CALL sp_maj_prime_base_individu(?,?,?,?,?)";
|
|
}else{
|
|
$sql = "CALL sp_maj_prime_base_aucune(?,?,?,?,?)";
|
|
}
|
|
|
|
$this->executerRequete($sql, array($codeSociete,$codeProduit,$codeGcAssureur,$user, $idCollegeTemp));
|
|
}
|
|
|
|
public function getPlafondFamille($codeProduit,$codeGcAssureur)
|
|
{
|
|
$sql = "SELECT fn_plafond_famille_produit(?,?) AS plafondAdherent;";
|
|
|
|
$resultat = $this->executerRequete($sql, array($codeProduit,$codeGcAssureur))->fetch();
|
|
|
|
return $resultat['plafondAdherent'];
|
|
}
|
|
|
|
public function getPlafondIndividu($codeProduit,$codeGcAssureur)
|
|
{
|
|
$sql = "SELECT fn_plafond_individu_produit(?,?) AS plafondIndividu;";
|
|
|
|
$resultat = $this->executerRequete($sql, array($codeProduit,$codeGcAssureur))->fetch();
|
|
|
|
return $resultat['plafondIndividu'];
|
|
}
|
|
|
|
public function getBaremeConsultation($idBaremePriseEnCharge){
|
|
|
|
$sql = "SELECT id AS code, libelle
|
|
FROM baremepriseencharge
|
|
WHERE id=?;";
|
|
|
|
$resultat = $this->executerRequete($sql, array($idBaremePriseEnCharge));
|
|
|
|
return $resultat->fetchAll(PDO::FETCH_ASSOC);
|
|
}
|
|
|
|
public function initbaremecollege($idBaremePriseEnCharge)
|
|
{
|
|
$user = $_SESSION['login'];
|
|
$idCollegeTemp = $_SESSION['idCollegeTemp'];
|
|
|
|
$sql = 'CALL sp_init_bareme(?, ?, ?);';
|
|
|
|
$this->executerRequete($sql, array($idCollegeTemp, $idBaremePriseEnCharge,$user));
|
|
}
|
|
|
|
public function getPrimeEnfantSup($codeProduit, $codeGcAssureur)
|
|
{
|
|
|
|
$sql = "SELECT fn_prime_enfant_supplementaire_produit(?, ?, ?) AS primeEnfantSupplementaire;";
|
|
|
|
$resultat = $this->executerRequete($sql, array($_SESSION['codeSociete'], $codeProduit,$codeGcAssureur))->fetch();
|
|
|
|
return $resultat['primeEnfantSupplementaire'];
|
|
|
|
}
|
|
|
|
public function getModecalculprimeproduit($codeProduit, $codeGcAssureur)
|
|
{
|
|
$sql = "SELECT fn_modecalcul_prime_produit(?, ?, ?) AS codeModecalculPrime;";
|
|
|
|
$resultat = $this->executerRequete($sql, array($_SESSION['codeSociete'], $codeProduit,$codeGcAssureur))->fetch();
|
|
|
|
return $resultat['codeModecalculPrime'];
|
|
|
|
}
|
|
|
|
|
|
public function getPrimeTrancheAge($codeProduit,$codeGcAssureur)
|
|
{
|
|
$idCollegeTemp = $_SESSION['idCollegeTemp'];
|
|
$user = $_SESSION['login'];
|
|
|
|
|
|
$sql = "CALL sp_affiche_primeproduit_trancheage_temp(?, ?, ?, ?, ?);";
|
|
|
|
$resultat = $this->executerRequete($sql, array($_SESSION['codeSociete'], $codeProduit, $codeGcAssureur, $idCollegeTemp, $user));
|
|
|
|
return $resultat->fetchAll(PDO::FETCH_ASSOC);
|
|
}
|
|
|
|
public function majnbrefamillecollege($idPrime, $nbreParFamille)
|
|
{
|
|
$sql = 'UPDATE primecollege_temp SET
|
|
nbreParFamille=?,
|
|
maj = "1"
|
|
WHERE (id=?)';
|
|
$this->executerRequete($sql, array($nbreParFamille, $idPrime));
|
|
}
|
|
|
|
public function majprimesupplementairecollege($idPrime, $prime)
|
|
{
|
|
|
|
$sql = 'UPDATE primecollege_temp SET
|
|
primeSupplementaire=?,
|
|
maj = "1"
|
|
WHERE (id=?)';
|
|
$this->executerRequete($sql, array($prime, $idPrime));
|
|
|
|
}
|
|
|
|
public function majprimetrancheage($idPrime,$prime)
|
|
{
|
|
$sql = 'UPDATE primeproduittrancheage_collegetemp SET
|
|
prime=?
|
|
WHERE (id=?);';
|
|
$this->executerRequete($sql, array($prime, $idPrime));
|
|
}
|
|
|
|
public function majpopulationtranche($idPrime,$population)
|
|
{
|
|
$sql = 'CALL sp_maj_population_trancheage_temp(?, ?);';
|
|
$this->executerRequete($sql, array($population, $idPrime));
|
|
}
|
|
|
|
public function getPrimeTotalTrancheAge($codeProduit,$codeGcAssureur)
|
|
{
|
|
$idCollegeTemp = $_SESSION['idCollegeTemp'];
|
|
|
|
$sql = "CALL sp_affiche_prime_total_trancheage_temp(?, ?, ?, ?);";
|
|
|
|
|
|
$resultat = $this->executerRequete($sql, array($_SESSION['codeSociete'], $codeProduit, $codeGcAssureur, $idCollegeTemp));
|
|
|
|
return $resultat->fetch(PDO::FETCH_ASSOC);
|
|
}
|
|
|
|
public function recapitulerTrancheage($idCollegeTemp,$codeProduit,$codeCollegeType,$codeReseau,
|
|
$codeTypeRemboursement,$codeTerritoire,$codeLienParente,$libelleCollege,$ticketModerateurCollege,$delaiCarenceCollege,
|
|
$plafondCollege,$idPolice,$numeroPolice,$accessoireManuel,$rachatTm,$tauxRachatTm,$tauxPrimeRachatTm,$budgetDefini,
|
|
$montantBudget,$nbAdherent,$nbAyantdroit,$codeTypeTarifActe,$codeTarifActe,$codeGcAssureur,$idBaremePriseEnCharge,
|
|
$codeBaseTarification,$seuilRdCollege,$plafondAdherent,$forfaitHonoraire,$forfaitAppelFond,$forfaitAppelCotisation,
|
|
$numeroOptionTarif)
|
|
{
|
|
$codeSociete = $_SESSION['codeSociete'];
|
|
$nbAdherent = '0';
|
|
$nbAyantdroit = '0';
|
|
|
|
$plafondAdherent = str_replace(' ', '', $plafondAdherent);
|
|
|
|
$sql = 'call sp_recapituler_college_temp_trancheage_saas(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?,?,?,?,?,?,?,?,?);';
|
|
|
|
$this->executerRequete($sql, array($codeSociete,$idCollegeTemp,$codeProduit,$codeCollegeType,$codeReseau,
|
|
$codeTypeRemboursement,$codeTerritoire,$codeLienParente,$libelleCollege,$ticketModerateurCollege,$delaiCarenceCollege,
|
|
$plafondCollege,$idPolice,$numeroPolice,$accessoireManuel,$rachatTm,$tauxRachatTm,$tauxPrimeRachatTm,$budgetDefini,
|
|
$montantBudget,$nbAdherent,$nbAyantdroit,$codeTypeTarifActe,$codeTarifActe,$codeGcAssureur,$idBaremePriseEnCharge,
|
|
$codeBaseTarification,$seuilRdCollege,$plafondAdherent,$forfaitHonoraire,$forfaitAppelFond,$forfaitAppelCotisation,
|
|
$numeroOptionTarif));
|
|
}
|
|
|
|
public function getModecalculprimeCollegeTemp($idCollegeTemp)
|
|
{
|
|
$sql = "SELECT fn_modecalcul_prime_college_temp(?) AS codeModecalculPrime;";
|
|
|
|
$resultat = $this->executerRequete($sql, array($idCollegeTemp))->fetch();
|
|
|
|
return $resultat['codeModecalculPrime'];
|
|
|
|
}
|
|
|
|
|
|
public function init_trancheage_temp($codeProduit, $codeGcAssureur)
|
|
{
|
|
$idCollegeTemp = $_SESSION['idCollegeTemp'];
|
|
$user = $_SESSION['login'];
|
|
|
|
$sql = "CALL sp_init_primeproduit_trancheage_temp(?, ?, ?, ?, ?);";
|
|
|
|
$this->executerRequete($sql, array($_SESSION['codeSociete'], $codeProduit, $codeGcAssureur, $idCollegeTemp, $user));
|
|
|
|
}
|
|
|
|
public function init_primelienparente_temp($codeProduit, $codeGcAssureur)
|
|
{
|
|
$idCollegeTemp = $_SESSION['idCollegeTemp'];
|
|
$user = $_SESSION['login'];
|
|
|
|
$sql = "CALL sp_init_prime_college(?, ?, ?, ?);";
|
|
|
|
|
|
$this->executerRequete($sql, array($idCollegeTemp, $codeProduit, $codeGcAssureur, $user));
|
|
|
|
}
|
|
|
|
public function init_prime_base_tarif_temp($codeProduit, $codeGcAssureur, $codeBaseTarification)
|
|
{
|
|
$idCollegeTemp = $_SESSION['idCollegeTemp'];
|
|
$user = $_SESSION['login'];
|
|
|
|
$sql = "CALL sp_init_prime_college_base_tarif(?, ?, ?, ?, ?);";
|
|
|
|
$this->executerRequete($sql, array($idCollegeTemp, $codeProduit, $codeGcAssureur, $user, $codeBaseTarification));
|
|
|
|
}
|
|
|
|
public function majautorisercollege($idPrime,$autorise)
|
|
{
|
|
$sql = 'UPDATE primecollege_temp SET
|
|
autoriserSupplement=?,
|
|
maj = "1"
|
|
WHERE (id=?);';
|
|
|
|
$this->executerRequete($sql, array($autorise, $idPrime));
|
|
}
|
|
|
|
public function initprimeTranche($codeProduit,$codeGcAssureur, $idCollegeTemp)
|
|
{
|
|
$codeSociete = $_SESSION['codeSociete'];
|
|
$user = $_SESSION['login'];
|
|
|
|
$sql = 'CALL sp_init_modifier_primeproduit_trancheage_temp(?,?,?,?,?);';
|
|
|
|
$this->executerRequete($sql, array($codeSociete, $codeProduit, $codeGcAssureur, $idCollegeTemp, $user));
|
|
}
|
|
|
|
public function majagemincollege($idPrime,$ageMin)
|
|
{
|
|
$sql = 'UPDATE primecollege_temp SET
|
|
ageMinimum=?,
|
|
maj = "1"
|
|
WHERE (id=?);';
|
|
|
|
$this->executerRequete($sql, array($ageMin, $idPrime));
|
|
}
|
|
|
|
public function majagemaxcollege($idPrime,$ageMax)
|
|
{
|
|
$sql = 'UPDATE primecollege_temp SET
|
|
ageMaximum=?,
|
|
maj = "1"
|
|
WHERE (id=?);';
|
|
|
|
$this->executerRequete($sql, array($ageMax, $idPrime));
|
|
}
|
|
|
|
public function majforfaithonoraire($idCollegeTemp ,$forfait)
|
|
{
|
|
$sql = 'UPDATE college_temp SET
|
|
forfaitHonoraire=?
|
|
WHERE (id=?);';
|
|
|
|
$this->executerRequete($sql, array($forfait, $idCollegeTemp));
|
|
|
|
}
|
|
|
|
public function majforfaitappelfond($idCollegeTemp ,$forfait)
|
|
{
|
|
$sql = 'UPDATE college_temp SET
|
|
forfaitAppelFond=?
|
|
WHERE (id=?);';
|
|
|
|
$this->executerRequete($sql, array($forfait, $idCollegeTemp));
|
|
|
|
}
|
|
|
|
public function majforfaitappelcotisation($idCollegeTemp ,$forfait)
|
|
{
|
|
$sql = 'UPDATE college_temp SET
|
|
forfaitAppelCotisation=?
|
|
WHERE (id=?);';
|
|
|
|
$this->executerRequete($sql, array($forfait, $idCollegeTemp));
|
|
|
|
}
|
|
|
|
public function getmodifierBareme()
|
|
{
|
|
$codeSociete = $_SESSION['codeSociete'];
|
|
$codeUtilisateur = $_SESSION['login'];
|
|
|
|
$sql = "SELECT fn_get_modifier_bareme(?, ?) AS modifierBareme;";
|
|
|
|
$resultat = $this->executerRequete($sql, array($codeSociete,$codeUtilisateur))->fetch();
|
|
|
|
return $resultat['modifierBareme'];
|
|
|
|
}
|
|
|
|
public function getoptionstarif($idPolice) {
|
|
$sql = 'SELECT numeroOptionTarif as code, libelleOptionTarif as libelle from d_optionstarif where (idPolice=?) order by 1';
|
|
$liste = $this->executerRequete($sql, array($idPolice));
|
|
return $liste;
|
|
}
|
|
}
|
|
|
|
|