340 lines
14 KiB
PHP
340 lines
14 KiB
PHP
<?php
|
|
require_once 'Framework/Modele.php';
|
|
class Adherent extends Modele {
|
|
|
|
public function getAdherentSimple($idAdherent) {
|
|
$sql = 'select * from vw_p_adherent WHERE (idAdherent)';
|
|
|
|
$adherent = $this->executerRequete($sql, array($idAdherent));
|
|
return $adherent->fetch();
|
|
}
|
|
|
|
public function getAdherents($noadherentsearch=null, $noPiecesearch=null, $emailsearch=null,
|
|
$nomsearch=null, $prenomsearch=null, $telsearch=null) {
|
|
|
|
$noadherentsearch = contruireParamLike($noadherentsearch);
|
|
$noPiecesearch = contruireParamLike($noPiecesearch);
|
|
$emailsearch = contruireParamLike($emailsearch);
|
|
$nomsearch = contruireParamLike($nomsearch);
|
|
$prenomsearch = contruireParamLike($prenomsearch);
|
|
$telsearch = contruireParamLike($telsearch);
|
|
|
|
$sql = 'select A.* from vw_p_adherent A WHERE (A.codeSociete=?) AND (numeroAdherent LIKE ?)
|
|
AND (emailAdherent LIKE ?) AND (nomAdherent LIKE ?) AND (prenomsAdherent LIKE ?)
|
|
AND (telephonePortableAdherent LIKE ?)';
|
|
|
|
$adherent = $this->executerRequete($sql, array($_SESSION['codeSociete'], $noadherentsearch, $noPiecesearch, $emailsearch,$nomsearch, $prenomsearch, $telsearch));
|
|
return $adherent;
|
|
}
|
|
|
|
public function getAdherent($numeroAdherent) {
|
|
$sql = 'sselect A.* from vw_p_adherent A WHERE (A.codeSociete=?) AND (A.numeroAdherent=?)';
|
|
|
|
$adherent = $this->executerRequete($sql, array($_SESSION['codeSociete'], $numeroAdherent));
|
|
return $adherent;
|
|
}
|
|
|
|
public function getAdherentId($idAdherent) {
|
|
$sql = 'call sp_get_adherent_id(?);';
|
|
$adherent = $this->executerRequete($sql, array($idAdherent));
|
|
return $adherent->fetch();
|
|
}
|
|
|
|
public function getAdherentIdConso($idAdherent) {
|
|
$sql = 'call sp_p_get_adherent_id_conso(?);';
|
|
$adherent = $this->executerRequete($sql, array($idAdherent));
|
|
return $adherent->fetch();
|
|
}
|
|
|
|
public function getIdAdherent($numeroAdherent) {
|
|
$sql = 'SELECT idAdherent FROM vw_p_adherent WHERE (codeSociete=?) AND (numeroAdherent=?)';
|
|
$resultat = $this->executerRequete($sql, array($_SESSION['codeSociete'], $numeroAdherent));
|
|
$ligne = $resultat->fetch();
|
|
return $ligne['idAdherent'];
|
|
}
|
|
|
|
public function getContexteAdherentId($idAdherent) {
|
|
|
|
$sql = 'select * from vw_p_adherent where (idAdherent=?);';
|
|
$resultat = $this->executerRequete($sql, array($idAdherent));
|
|
|
|
$context = $resultat->fetch();
|
|
|
|
$_SESSION['idClient_C'] = $context['idClient'];
|
|
$_SESSION['numeroClient_C'] = $context['numeroClient'];
|
|
$_SESSION['nomClient_C'] = $context['nomClient'];
|
|
$_SESSION['adresseGeoClient_C'] = $context['adresseGeoClient'];
|
|
$_SESSION['boitepostaleClient_C'] = $context['boitepostaleClient'];
|
|
$_SESSION['telephoneBureauClient_C'] = $context['telephoneBureauClient'];
|
|
$_SESSION['telephonePortableClient_C'] = $context['telephonePortableClient'];
|
|
$_SESSION['faxClient_C'] = $context['faxClient'];
|
|
$_SESSION['emailClient_C'] = $context['emailClient'];
|
|
$_SESSION['idPolice_C'] = $context['idPolice'];
|
|
$_SESSION['numeroPolice_C'] = $context['numeroPolice'];
|
|
$_SESSION['dateEffetPolice_C'] = $context['dateEffetPolice'];
|
|
$_SESSION['dateFinPolice_C'] = $context['dateFinPolice'];
|
|
$_SESSION['dateEcheancePolice_C'] = $context['dateEcheancePolice'];
|
|
$_SESSION['codeEtatPolice_C'] = $context['codeEtatPolice'];
|
|
$_SESSION['idCollege_C'] = $context['idCollege'];
|
|
$_SESSION['codeProduit_C'] = $context['codeProduit'];
|
|
$_SESSION['idAdherent_C'] = $context['idAdherent'];
|
|
$_SESSION['numeroAdherent_C'] = $context['numeroAdherent'];
|
|
$_SESSION['nomAdherent_C'] = $context['nomAdherent'];
|
|
$_SESSION['prenomsAdherent_C'] = $context['prenomsAdherent'];
|
|
$_SESSION['adherent_C'] = $context['adherent'];
|
|
$_SESSION['telephonePortableAdherent_C'] = $context['telephonePortableAdherent'];
|
|
$_SESSION['emailAdherent_C'] = $context['emailAdherent'];
|
|
$_SESSION['produit_C'] = $context['produit'];
|
|
$_SESSION['libelleCollege_C'] = $context['libelleCollege'];
|
|
$_SESSION['exercieReference_C'] = $context['exercieReference'];
|
|
$_SESSION['idEntetecontrat'] = $context['idEntetecontrat'];
|
|
|
|
$_SESSION['adresseGeoAdherent_C'] = "";
|
|
$_SESSION['paysAdherent_C'] = "";
|
|
$_SESSION['adressePostaleAdherent_C'] = "";
|
|
$_SESSION['telephonFixeAdherent_C'] = "";
|
|
$_SESSION['nomBeneficiaire_C'] = "";
|
|
$_SESSION['prenomsBeneficiaire_C'] = "";
|
|
$_SESSION['beneficiaire_C'] = "";
|
|
$_SESSION['codeLienParente_C'] = "";
|
|
$_SESSION['numeroPiece_C'] = "";
|
|
$_SESSION['sexe_C'] = "";
|
|
$_SESSION['codeGroupeSanguin_C'] = "";
|
|
$_SESSION['dateNaissance_C'] = "";
|
|
$_SESSION['telephonePortableBeneficiaire_C'] = "";
|
|
$_SESSION['dateEntreeBeneficiaire_C'] = "";
|
|
$_SESSION['dateSortieBeneficiaire_C'] = "";
|
|
$_SESSION['codeMotifSortie_C'] = "";
|
|
$_SESSION['codeEtatBeneficiaire_C'] = "";
|
|
$_SESSION['lienPhoto_C'] = "";
|
|
$_SESSION['dateEffetBeneficiaire_C'] = "";
|
|
$_SESSION['enVigueur_C'] = "";
|
|
$_SESSION['naturepiece_C'] = "";
|
|
$_SESSION['lienparente_C'] = "";
|
|
$_SESSION['motifsortie_C'] = "";
|
|
$_SESSION['etatbeneficiaire_C'] = "";
|
|
$_SESSION['ageBeneficiaire_C'] = "";
|
|
$_SESSION['idBeneficiaire_C'] = "";
|
|
|
|
$_SESSION['decede_C'] = "";
|
|
$_SESSION['dateDeces_C'] = "";
|
|
|
|
$_SESSION['user_id_C'] = "0";
|
|
$_SESSION['finger_id_C'] = "0";
|
|
|
|
$_SESSION['numeroBeneficiaire_C'] = "";
|
|
$_SESSION['numeroFeuilleMaladie_C'] = "0";
|
|
$_SESSION['numeroPrescription_C'] = "0";
|
|
$_SESSION['numeroPrescription_C'] = "0";
|
|
$_SESSION['idFacture_C'] = "0";
|
|
|
|
return $context;
|
|
}
|
|
|
|
public function getContexteAdherentIdConso($idAdherent) {
|
|
|
|
$sql = 'call sp_p_get_contexte_adherent_id_conso(?);';
|
|
$resultat = $this->executerRequete($sql, array($idAdherent));
|
|
|
|
$context = $resultat->fetch();
|
|
|
|
$_SESSION['idClient_C'] = $context['idClient'];
|
|
$_SESSION['numeroClient_C'] = $context['numeroClient'];
|
|
$_SESSION['nomClient_C'] = $context['nomClient'];
|
|
$_SESSION['adresseGeoClient_C'] = $context['adresseGeoClient'];
|
|
$_SESSION['boitepostaleClient_C'] = $context['boitepostaleClient'];
|
|
$_SESSION['telephoneBureauClient_C'] = $context['telephoneBureauClient'];
|
|
$_SESSION['telephonePortableClient_C'] = $context['telephonePortableClient'];
|
|
$_SESSION['faxClient_C'] = $context['faxClient'];
|
|
$_SESSION['emailClient_C'] = $context['emailClient'];
|
|
$_SESSION['idPolice_C'] = $context['idPolice'];
|
|
$_SESSION['numeroPolice_C'] = $context['numeroPolice'];
|
|
$_SESSION['dateEffetPolice_C'] = $context['dateEffetPolice'];
|
|
$_SESSION['dateFinPolice_C'] = $context['dateFinPolice'];
|
|
$_SESSION['dateEcheancePolice_C'] = $context['dateEcheancePolice'];
|
|
$_SESSION['codeEtatPolice_C'] = $context['codeEtatPolice'];
|
|
$_SESSION['idCollege_C'] = $context['idCollege'];
|
|
$_SESSION['codeProduit_C'] = $context['codeProduit'];
|
|
$_SESSION['idAdherent_C'] = $context['idAdherent'];
|
|
$_SESSION['numeroAdherent_C'] = $context['numeroAdherent'];
|
|
$_SESSION['nomAdherent_C'] = $context['nomAdherent'];
|
|
$_SESSION['prenomsAdherent_C'] = $context['prenomsAdherent'];
|
|
$_SESSION['adherent_C'] = $context['adherent'];
|
|
$_SESSION['telephonePortableAdherent_C'] = $context['telephonePortableAdherent'];
|
|
$_SESSION['emailAdherent_C'] = $context['emailAdherent'];
|
|
$_SESSION['produit_C'] = $context['produit'];
|
|
$_SESSION['libelleCollege_C'] = $context['libelleCollege'];
|
|
$_SESSION['exercieReference_C'] = $context['exercieReference'];
|
|
$_SESSION['idEntetecontrat'] = $context['idEntetecontrat'];
|
|
|
|
$_SESSION['adresseGeoAdherent_C'] = "";
|
|
$_SESSION['paysAdherent_C'] = "";
|
|
$_SESSION['adressePostaleAdherent_C'] = "";
|
|
$_SESSION['telephonFixeAdherent_C'] = "";
|
|
$_SESSION['nomBeneficiaire_C'] = "";
|
|
$_SESSION['prenomsBeneficiaire_C'] = "";
|
|
$_SESSION['beneficiaire_C'] = "";
|
|
$_SESSION['codeLienParente_C'] = "";
|
|
$_SESSION['numeroPiece_C'] = "";
|
|
$_SESSION['sexe_C'] = "";
|
|
$_SESSION['codeGroupeSanguin_C'] = "";
|
|
$_SESSION['dateNaissance_C'] = "";
|
|
$_SESSION['telephonePortableBeneficiaire_C'] = "";
|
|
$_SESSION['dateEntreeBeneficiaire_C'] = "";
|
|
$_SESSION['dateSortieBeneficiaire_C'] = "";
|
|
$_SESSION['codeMotifSortie_C'] = "";
|
|
$_SESSION['codeEtatBeneficiaire_C'] = "";
|
|
$_SESSION['lienPhoto_C'] = "";
|
|
$_SESSION['dateEffetBeneficiaire_C'] = "";
|
|
$_SESSION['enVigueur_C'] = "";
|
|
$_SESSION['naturepiece_C'] = "";
|
|
$_SESSION['lienparente_C'] = "";
|
|
$_SESSION['motifsortie_C'] = "";
|
|
$_SESSION['etatbeneficiaire_C'] = "";
|
|
$_SESSION['ageBeneficiaire_C'] = "";
|
|
$_SESSION['idBeneficiaire_C'] = "";
|
|
$_SESSION['numeroBeneficiaire_C'] = "";
|
|
$_SESSION['numeroFeuilleMaladie_C'] = "0";
|
|
$_SESSION['numeroPrescription_C'] = "0";
|
|
$_SESSION['idFacture_C'] = "0";
|
|
|
|
$_SESSION['decede_C'] = "";
|
|
$_SESSION['dateDeces_C'] = "";
|
|
|
|
return $context;
|
|
}
|
|
|
|
public function existeligne($numeroAdherent) {
|
|
$sql = 'select id FROM adherent WHERE (codeSociete=?) and (numeroAdherent=?)';
|
|
$resultat = $this->executerRequete($sql, array($_SESSION['codeSociete'],$numeroAdherent));
|
|
return ($resultat->rowCount() > 0);
|
|
}
|
|
|
|
public function getRapportSpAdherent($idAdherent)
|
|
{
|
|
$dj = date("Y-m-d");
|
|
$sql = 'call sp_rapport_sp_adherent(?, ?)';
|
|
|
|
$sppolice = $this->executerRequete($sql, array($idAdherent, $dj));
|
|
return $sppolice->fetch(PDO::FETCH_ASSOC);
|
|
}
|
|
|
|
public function getlisteexo($idAdherent)
|
|
{
|
|
$sql = 'call sp_get_exercices_adherent(?)';
|
|
|
|
$resultat = $this->executerRequete($sql, array($idAdherent));
|
|
|
|
return $resultat->fetchAll(PDO::FETCH_ASSOC);
|
|
}
|
|
|
|
public function controlerplafondadherentannuel($idAdherent)
|
|
{
|
|
$sql = 'select fn_control_plafond_adherent_courant(?) as controlerPlafondAdherent;';
|
|
|
|
$resultat = $this->executerRequete($sql, array($idAdherent));
|
|
$ligne = $resultat->fetch(PDO::FETCH_ASSOC);
|
|
$_SESSION['controlerPlafondAdherent'] = $ligne['controlerPlafondAdherent'];
|
|
}
|
|
|
|
public function getlisteprestations()
|
|
{
|
|
$sql = 'SELECT datePrestation, codeTypePrestation,
|
|
valeurActe,montantArembourser
|
|
FROM p_prestationactes limit 1';
|
|
|
|
$resultat = $this->executerRequete($sql);
|
|
|
|
return $resultat->fetchAll(PDO::FETCH_ASSOC);
|
|
}
|
|
|
|
|
|
public function getconsommationadherent()
|
|
{
|
|
$idAdherent=$_SESSION['idAdherent_C'];
|
|
|
|
$sql = 'SELECT fn_consommation_adherent(?,CURDATE()) AS consommation;';
|
|
|
|
$resultat = $this->executerRequete($sql, array($idAdherent));
|
|
$ligne = $resultat->fetch(PDO::FETCH_ASSOC);
|
|
return $ligne['consommation'];
|
|
|
|
|
|
}
|
|
|
|
|
|
public function getsoldeadherent()
|
|
{
|
|
$idAdherent=$_SESSION['idAdherent_C'];
|
|
|
|
$sql = 'SELECT fn_solde_plafond_adherent(?,CURDATE()) AS solde;';
|
|
|
|
$resultat = $this->executerRequete($sql, array($idAdherent));
|
|
$ligne = $resultat->fetch(PDO::FETCH_ASSOC);
|
|
return $ligne['solde'];
|
|
|
|
|
|
}
|
|
|
|
public function getPrestationsmensuelles($idAdherent){
|
|
|
|
if (isset($_SESSION['lang']) && $_SESSION['lang']=="en_US"){
|
|
$sql = 'call prestations_mensuelles_famille_eng(?)';
|
|
}else{
|
|
$sql = 'call prestations_mensuelles_famille(?)';
|
|
}
|
|
|
|
$resultat = $this->executerRequete($sql, array($idAdherent));
|
|
|
|
return $resultat->fetchAll(PDO::FETCH_ASSOC);
|
|
}
|
|
|
|
public function getPrestationsLiensParente($idAdherent){
|
|
|
|
if (isset($_SESSION['lang']) && $_SESSION['lang']=="en_US"){
|
|
|
|
$sql = 'call prestations_lienparente_famille_eng(?)';
|
|
}else{
|
|
$sql = 'call prestations_lienparente_famille(?)';
|
|
}
|
|
|
|
$resultat = $this->executerRequete($sql, array($idAdherent));
|
|
|
|
return $resultat->fetchAll(PDO::FETCH_ASSOC);
|
|
}
|
|
|
|
public function getLimitesAdherent($idAdherent, $dateJour){
|
|
|
|
$sql = 'call sp_situation_famille_newversion(?, ?)';
|
|
|
|
$resultat = $this->executerRequete($sql, array($idAdherent, $dateJour));
|
|
|
|
return $resultat->fetch(PDO::FETCH_ASSOC);
|
|
}
|
|
|
|
public function getConsosAdherent($idAdherent)
|
|
{
|
|
$datePrestation = date('Y-m-d');
|
|
|
|
$sql = 'call sp_consos_adherent_newversion(?, ?)';
|
|
|
|
$resultat = $this->executerRequete($sql, array($idAdherent, $datePrestation));
|
|
|
|
return $resultat->fetchAll(PDO::FETCH_ASSOC);
|
|
|
|
}
|
|
|
|
public function getConsosTotalAdherent($idAdherent)
|
|
{
|
|
$datePrestation = date('Y-m-d');
|
|
|
|
$sql = 'call sp_consos_total_adherent_newversion(?, ?)';
|
|
|
|
$resultat = $this->executerRequete($sql, array($idAdherent, $datePrestation));
|
|
|
|
return $resultat->fetch(PDO::FETCH_ASSOC);
|
|
|
|
}
|
|
|
|
|
|
} |