prestation/Modele/Adherent.php
2025-12-05 10:42:46 +00:00

240 lines
12 KiB
PHP
Executable File

<?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(PDO::FETCH_ASSOC);
}
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['p_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['p_codeSociete'], $numeroAdherent));
return $adherent;
}
public function getAdherentId($idAdherent) {
$sql = 'sselect A.* from vw_p_adherent A where (A.idAdherent=?)';
$adherent = $this->executerRequete($sql, array($idAdherent));
return $adherent->fetch(PDO::FETCH_ASSOC);
}
public function getAdherentIdConso($idAdherent) {
$sql = 'call sp_p_get_adherent_id_conso(?);';
$adherent = $this->executerRequete($sql, array($idAdherent));
return $adherent->fetch(PDO::FETCH_ASSOC);
}
public function getIdAdherent($numeroAdherent) {
$sql = 'SELECT idAdherent FROM vw_p_adherent WHERE (codeSociete=?) AND (numeroAdherent=?)';
$resultat = $this->executerRequete($sql, array($_SESSION['p_codeSociete'], $numeroAdherent));
$ligne = $resultat->fetch(PDO::FETCH_ASSOC);
return $ligne['idAdherent'];
}
public function getContexteAdherentId($idAdherent) {
$sql = 'select * from vw_p_adherent where (idAdherent=?);';
$resultat = $this->executerRequete($sql, array($idAdherent));
$context = $resultat->fetch(PDO::FETCH_ASSOC);
$_SESSION['p_idClient_C'] = $context['idClient'];
$_SESSION['p_numeroClient_C'] = $context['numeroClient'];
$_SESSION['p_nomClient_C'] = $context['nomClient'];
$_SESSION['p_adresseGeoClient_C'] = $context['adresseGeoClient'];
$_SESSION['p_boitepostaleClient_C'] = $context['boitepostaleClient'];
$_SESSION['p_telephoneBureauClient_C'] = $context['telephoneBureauClient'];
$_SESSION['p_telephonePortableClient_C'] = $context['telephonePortableClient'];
$_SESSION['p_faxClient_C'] = $context['faxClient'];
$_SESSION['p_emailClient_C'] = $context['emailClient'];
$_SESSION['p_idPolice_C'] = $context['idPolice'];
$_SESSION['p_numeroPolice_C'] = $context['numeroPolice'];
$_SESSION['p_dateEffetPolice_C'] = $context['dateEffetPolice'];
$_SESSION['p_dateFinPolice_C'] = $context['dateFinPolice'];
$_SESSION['p_dateEcheancePolice_C'] = $context['dateEcheancePolice'];
$_SESSION['p_codeEtatPolice_C'] = $context['codeEtatPolice'];
$_SESSION['p_idCollege_C'] = $context['idCollege'];
$_SESSION['p_codeProduit_C'] = $context['codeProduit'];
$_SESSION['p_idAdherent_C'] = $context['idAdherent'];
$_SESSION['p_numeroAdherent_C'] = $context['numeroAdherent'];
$_SESSION['p_nomAdherent_C'] = $context['nomAdherent'];
$_SESSION['p_prenomsAdherent_C'] = $context['prenomsAdherent'];
$_SESSION['p_adherent_C'] = $context['adherent'];
$_SESSION['p_telephonePortableAdherent_C'] = $context['telephonePortableAdherent'];
$_SESSION['p_codeLangueAdherent'] = $context['codeLangueAdherent'];
$_SESSION['p_emailAdherent_C'] = $context['emailAdherent'];
$_SESSION['p_produit_C'] = $context['produit'];
$_SESSION['p_libelleCollege_C'] = $context['libelleCollege'];
$_SESSION['p_exercieReference_C'] = $context['exercieReference'];
$_SESSION['idEntetecontrat'] = $context['idEntetecontrat'];
$_SESSION['p_adresseGeoAdherent_C'] = "";
$_SESSION['p_paysAdherent_C'] = "";
$_SESSION['p_adressePostaleAdherent_C'] = "";
$_SESSION['p_telephonFixeAdherent_C'] = "";
$_SESSION['p_nomBeneficiaire_C'] = "";
$_SESSION['p_prenomsBeneficiaire_C'] = "";
$_SESSION['p_beneficiaire_C'] = "";
$_SESSION['p_codeLienParente_C'] = "";
$_SESSION['p_numeroPiece_C'] = "";
$_SESSION['p_sexe_C'] = "";
$_SESSION['p_codeGroupeSanguin_C'] = "";
$_SESSION['p_dateNaissance_C'] = "";
$_SESSION['p_telephonePortableBeneficiaire_C'] = "";
$_SESSION['p_dateEntreeBeneficiaire_C'] = "";
$_SESSION['p_dateSortieBeneficiaire_C'] = "";
$_SESSION['p_codeMotifSortie_C'] = "";
$_SESSION['p_codeEtatBeneficiaire_C'] = "";
$_SESSION['p_lienPhoto_C'] = "";
$_SESSION['p_dateEffetBeneficiaire_C'] = "";
$_SESSION['p_dateEffetCouvert'] = "0";
$_SESSION['p_enVigueur_C'] = "";
$_SESSION['p_naturepiece_C'] = "";
$_SESSION['p_lienparente_C'] = "";
$_SESSION['p_motifsortie_C'] = "";
$_SESSION['p_etatbeneficiaire_C'] = "";
$_SESSION['p_ageBeneficiaire_C'] = "";
$_SESSION['p_idBeneficiaire_C'] = "";
$_SESSION['p_decede_C'] = "";
$_SESSION['p_dateDeces_C'] = "";
$_SESSION['p_user_id_C'] = "0";
$_SESSION['p_user_id_substitut'] = "0";
$_SESSION['p_finger_id_C'] = "0";
$_SESSION['p_numeroBeneficiaire_C'] = "";
$_SESSION['p_numeroFeuilleMaladie_C'] = "0";
$_SESSION['p_numeroPrescription_C'] = "0";
$_SESSION['p_numeroPrescription_C'] = "0";
$_SESSION['p_idFacture_C'] = "0";
//Face Bio
$_SESSION['p_idBeneficiaire_sav'] = "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(PDO::FETCH_ASSOC);
$_SESSION['p_idClient_C'] = $context['idClient'];
$_SESSION['p_numeroClient_C'] = $context['numeroClient'];
$_SESSION['p_nomClient_C'] = $context['nomClient'];
$_SESSION['p_adresseGeoClient_C'] = $context['adresseGeoClient'];
$_SESSION['p_boitepostaleClient_C'] = $context['boitepostaleClient'];
$_SESSION['p_telephoneBureauClient_C'] = $context['telephoneBureauClient'];
$_SESSION['p_telephonePortableClient_C'] = $context['telephonePortableClient'];
$_SESSION['p_faxClient_C'] = $context['faxClient'];
$_SESSION['p_emailClient_C'] = $context['emailClient'];
$_SESSION['p_idPolice_C'] = $context['idPolice'];
$_SESSION['p_numeroPolice_C'] = $context['numeroPolice'];
$_SESSION['p_dateEffetPolice_C'] = $context['dateEffetPolice'];
$_SESSION['p_dateFinPolice_C'] = $context['dateFinPolice'];
$_SESSION['p_dateEcheancePolice_C'] = $context['dateEcheancePolice'];
$_SESSION['p_codeEtatPolice_C'] = $context['codeEtatPolice'];
$_SESSION['p_idCollege_C'] = $context['idCollege'];
$_SESSION['p_codeProduit_C'] = $context['codeProduit'];
$_SESSION['p_idAdherent_C'] = $context['idAdherent'];
$_SESSION['p_numeroAdherent_C'] = $context['numeroAdherent'];
$_SESSION['p_nomAdherent_C'] = $context['nomAdherent'];
$_SESSION['p_prenomsAdherent_C'] = $context['prenomsAdherent'];
$_SESSION['p_adherent_C'] = $context['adherent'];
$_SESSION['p_telephonePortableAdherent_C'] = $context['telephonePortableAdherent'];
$_SESSION['p_codeLangueAdherent'] = $context['codeLangueAdherent'];
$_SESSION['p_emailAdherent_C'] = $context['emailAdherent'];
$_SESSION['p_produit_C'] = $context['produit'];
$_SESSION['p_libelleCollege_C'] = $context['libelleCollege'];
$_SESSION['p_adresseGeoAdherent_C'] = "";
$_SESSION['p_paysAdherent_C'] = "";
$_SESSION['p_adressePostaleAdherent_C'] = "";
$_SESSION['p_telephonFixeAdherent_C'] = "";
$_SESSION['p_nomBeneficiaire_C'] = "";
$_SESSION['p_prenomsBeneficiaire_C'] = "";
$_SESSION['p_beneficiaire_C'] = "";
$_SESSION['p_codeLienParente_C'] = "";
$_SESSION['p_numeroPiece_C'] = "";
$_SESSION['p_sexe_C'] = "";
$_SESSION['p_codeGroupeSanguin_C'] = "";
$_SESSION['p_dateNaissance_C'] = "";
$_SESSION['p_telephonePortableBeneficiaire_C'] = "";
$_SESSION['p_dateEntreeBeneficiaire_C'] = "";
$_SESSION['p_dateSortieBeneficiaire_C'] = "";
$_SESSION['p_codeMotifSortie_C'] = "";
$_SESSION['p_codeEtatBeneficiaire_C'] = "";
$_SESSION['p_lienPhoto_C'] = "";
$_SESSION['p_dateEffetBeneficiaire_C'] = "";
$_SESSION['p_dateEffetCouvert'] = "0";
$_SESSION['p_enVigueur_C'] = "";
$_SESSION['p_naturepiece_C'] = "";
$_SESSION['p_lienparente_C'] = "";
$_SESSION['p_motifsortie_C'] = "";
$_SESSION['p_etatbeneficiaire_C'] = "";
$_SESSION['p_ageBeneficiaire_C'] = "";
$_SESSION['p_idBeneficiaire_C'] = "";
$_SESSION['p_numeroBeneficiaire_C'] = "";
$_SESSION['p_numeroFeuilleMaladie_C'] = "0";
$_SESSION['p_numeroPrescription_C'] = "0";
$_SESSION['p_idFacture_C'] = "0";
$_SESSION['p_decede_C'] = "";
$_SESSION['p_dateDeces_C'] = "";
//Face Bio
$_SESSION['p_idBeneficiaire_sav'] = "0";
return $context;
}
public function existeligne($numeroAdherent) {
$sql = 'select id FROM adherent WHERE (codeSociete=?) and (numeroAdherent=?)';
$resultat = $this->executerRequete($sql, array($_SESSION['p_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 getentetecontrat($idEntetecontrat)
{
$sql = 'SELECT * FROM entetecontrat WHERE id=? limit 1;';
$resultat = $this->executerRequete($sql, array($idEntetecontrat));
return $resultat->fetch(PDO::FETCH_ASSOC);
}
}