menuvue = new Menuvueutilisateur(); $this->menuvue->getMenuVue('Creerbeneficiaire'); $this->beneficiaire = new Beneficiaire(); $this->naturepiece = (new Naturepiece())->getListe(); $this->sexe = (new Sexe())->getListe(); $this->groupesanguin = (new Groupesanguin())->getListe(); $this->adherent = new Adherent(); $this->lienparente = (new Lienparente())->getListeDependant(); $this->tarif = new Tarif(); // $this->avenant = (new Avenant())->getListe($_SESSION['idPolice_C']); $this->avenant = (new Avenant())->getListeEnCours($_SESSION['idPolice_C']); $this->ouinonprorata = (new Ouinon())->getListe(); $this->beneficiaire_temp = new Beneficiaire_temp(); } public function index() { $codeTypeContrat = $_SESSION['codeTypeContrat']; if($codeTypeContrat=="F") { $this->rediriger("Creerbeneficiairefamiliale"); exit(); } else { $idPolice = $_SESSION['idPolice_C']; $idAdherent = $_SESSION['idAdherent_C']; $user = $_SESSION['login']; $idCollege = $_SESSION['idCollege_C']; $fraisCarte = $this->beneficiaire_temp->get_frais_carte_college($idCollege); $prorata = "1"; $dateEntree = $_SESSION['dateAvenant_C']; $beneficiaire_temp = $this->beneficiaire_temp->getBeneficiaire_temp($idAdherent, $dateEntree, $user, $prorata, $fraisCarte); // $codeSociete = $this->requete->getSession()->getAttribut('codeSociete'); $adherent = $this->adherent->getAdherentId($idAdherent); $this->genererVue(array('adherent' => $adherent, 'naturepiece' => $this->naturepiece, 'sexe' => $this->sexe, 'groupesanguin' => $this->groupesanguin, 'lienparente' => $this->lienparente, 'avenant' => $this->avenant, 'ouinonprorata' => $this->ouinonprorata, 'beneficiaire_temp' => $beneficiaire_temp)); } } public function ajouter() { $idAdherent = $this->requete->getParametre("idAdherent"); $numeroAdherent = $this->requete->getParametre("numeroAdherent"); $nomBeneficiaire = $this->requete->getParametre("nomBeneficiaire"); $prenomsBeneficiaire = $this->requete->getParametreFormulaire("prenomsBeneficiaire"); $codeLienParente = $this->requete->getParametre("codeLienParente"); $codeNaturePiece = $this->requete->getParametre("codeNaturePiece"); $numeroPiece = $this->requete->getParametreFormulaire("numeroPiece"); $sexe = $this->requete->getParametreFormulaire("sexe"); $codeGroupeSanguin = $this->requete->getParametreFormulaire("codeGroupeSanguin"); $dateNaissance = $this->requete->getParametreDate("dateNaissance"); $telephonePortable = $this->requete->getParametreFormulaire("telephonePortable"); $dateEntree = $this->requete->getParametreDate("dateEntree"); $user = $this->requete->getSession()->getAttribut('login'); $idAvenant = $this->requete->getParametre("idAvenant"); $dateCre = date("Y-m-d"); $fraisCarte = $this->requete->getParametreFormulaire("fraisCarte","numerique"); $dernierNumeroBeneficiaire = $this->beneficiaire->getDenierNumeroBeneficiaire($idAdherent); $dernierNumeroBeneficiaire++; $numeroBeneficiaire = $numeroAdherent . $dernierNumeroBeneficiaire; $idBeneficiaire = $this->beneficiaire->ajouter($idAdherent, $numeroBeneficiaire, $nomBeneficiaire, $prenomsBeneficiaire, $codeLienParente, $codeNaturePiece, $numeroPiece, $sexe, $codeGroupeSanguin, $dateNaissance, $telephonePortable, $dateEntree, $dateCre, $user, $idAvenant, $fraisCarte); $this->beneficiaire->setDenierNumeroBeneficiaire($idAdherent, $dernierNumeroBeneficiaire); // On va calculuer la prime $_SESSION['idAdherent_C'] = $idAdherent; $_SESSION['idBeneficiaire_C'] = $idBeneficiaire; // On actualise le contexte : NbAdh et NbAss $idPolice = $_SESSION['idPolice_C']; $this->beneficiaire->getNbassure($idPolice); $this->rediriger("Ficheadherent/".$idAdherent); } }