executerRequete($sql, array($idCollegeTemp, $codeGarantie)); } public function getCollegeTemp($idCollegeTemp) { $sql = 'call sp_afficher_college_temp_saas(?)'; $collegeTemp = $this->executerRequete($sql, array($idCollegeTemp)); return $collegeTemp->fetch(); } 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->fetchAll(PDO::FETCH_ASSOC); } 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']; $numeroOptionTarif = $_SESSION['numeroOptionTarif']; //$this->viderfamilleacteproduitlienparente(); //$this->videractecollegelienparente_temp(); $sql = 'CALL sp_init_college_d(?, ?, ?, ?, ?);'; $this->executerRequete($sql, array($idPolice, $codeSociete, $codeGcAssureur, $numeroOptionTarif, $user)); $resultat = $this->executerRequete($sql, array($idPolice, $codeSociete, $codeGcAssureur, $numeroOptionTarif, $user)); $ligne = $resultat->fetch(PDO::FETCH_ASSOC); $idCollegeTemp = $ligne['idCollegeTemp']; $_SESSION['idCollegeTemp'] = $idCollegeTemp; return $idCollegeTemp; } public function initModifCollege($idCollege, $user) { $sql = 'CALL sp_init_modifier_college_d(?, ?);'; $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); /* var_dump(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)); die(); */ $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_d(?)'; $this->executerRequete($sql, array($idCollegeTemp)); } public function modifiercollege($idCollegeTemp, $idCollege) { $user = $_SESSION['login']; $sql = 'call sp_modifier_college_lien_parente_d(?, ?, ?)'; $this->executerRequete($sql, array($idCollegeTemp, $idCollege, $user)); } public function ajouterGarantieCollege($idCollege, $idCollegeTemp) { $sql = 'delete from d_garantiecollege where idCollege=?'; $this->executerRequete($sql, array($idCollege)); $sql = 'insert into d_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 d_prestationcollege where idCollege=?'; $this->executerRequete($sql, array($idCollege)); $sql = 'insert into d_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 d_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 d_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 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 changer_college_temp($idAdherent, $idCollege) { $user = $_SESSION['login']; $sql = 'call sp_changer_college_temp_d(?, ?, ?)'; $college_temp = $this->executerRequete($sql, array($idAdherent, $idCollege, $user)); return $college_temp->fetch(); } 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_d(?, ?)'; $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 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; } public function nouvelleoptiontarif() { $user = $_SESSION['login']; $idPolice = $_SESSION['idPolice_d_C']; $sql = 'call sp_d_nouvelle_option_tarif(?, ?)'; $resultat = $this->executerRequete($sql, array($idPolice, $user)); $ligne = $resultat->fetch(); $_SESSION['numeroOptionTarif'] = $ligne['numeroOptionTarif']; } 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 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 ajouterPrimesCollege($idCollege, $idCollegeTemp) { $sql = 'call sp_ajouter_prime_college_d(?, ?)'; $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 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_d(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?, ?,?,?,?,?,?,?,?,?,?,?,?,?,?);'; $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 getGarantPolice($idPolice){ $sql = 'SELECT id, codeGcAssureur FROM d_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 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 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 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 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 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); } 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 getModecalculprimeCollegeTemp($idCollegeTemp) { $sql = "SELECT fn_modecalcul_prime_college_temp(?) AS codeModecalculPrime;"; $resultat = $this->executerRequete($sql, array($idCollegeTemp))->fetch(); return $resultat['codeModecalculPrime']; } 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 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_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 initbaremecollege($idBaremePriseEnCharge) { $user = $_SESSION['login']; $idCollegeTemp = $_SESSION['idCollegeTemp']; $sql = 'CALL sp_init_bareme(?, ?, ?);'; $this->executerRequete($sql, array($idCollegeTemp, $idBaremePriseEnCharge,$user)); } 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 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 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 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 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 getPrimeMincollege($idPrime){ $sql = "select primeMin from primecollege_temp where id=?;"; $resultat = $this->executerRequete($sql, array($idPrime)); 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 majplafondcollege($idPrime, $plafond) { $sql = 'UPDATE primecollege_temp SET forfaitPlafond=?, plafondBeneficiaire=?, maj = "1" WHERE (id=?);'; $this->executerRequete($sql, array($plafond, $plafond, $idPrime)); } public function majnbrefamillecollege($idPrime, $nbreParFamille) { $sql = 'UPDATE primecollege_temp SET nbreParFamille=?, maj = "1" WHERE (id=?)'; $this->executerRequete($sql, array($nbreParFamille, $idPrime)); } public function majautorisercollege($idPrime,$autorise) { $sql = 'UPDATE primecollege_temp SET autoriserSupplement=?, maj = "1" WHERE (id=?);'; $this->executerRequete($sql, array($autorise, $idPrime)); } public function majprimesupplementairecollege($idPrime, $prime) { $sql = 'UPDATE primecollege_temp SET primeSupplementaire=?, maj = "1" WHERE (id=?)'; $this->executerRequete($sql, array($prime, $idPrime)); } 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 majprimetrancheage($idPrime,$prime) { $sql = 'CALL sp_maj_prime_trancheage_temp(?, ?)'; $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 recapitulerDevis($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_devis(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?,?,?,?,?,?,?,?,?)'; $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 recapitulerTrancheageDevis($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_devis(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?,?,?,?,?,?,?,?,?);'; $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 initprimeTranche($codeProduit,$codeGcAssureur, $idCollegeTemp) { $codeSociete = $_SESSION['codeSociete']; $user = $_SESSION['login']; $sql = 'CALL sp_init_modifier_primeproduit_trancheage_temp_d(?,?,?,?,?);'; $this->executerRequete($sql, array($codeSociete, $codeProduit, $codeGcAssureur, $idCollegeTemp, $user)); } 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']; } }