prestation/Controleur/ControleurAjaxremplaceradherent.php
2025-12-05 10:42:46 +00:00

93 lines
4.1 KiB
PHP
Executable File

<?php
require_once 'Framework/Controleur.php';
require_once 'Modele/Adherent.php';
require_once 'Modele/Naturepiece.php';
require_once 'Modele/Sexe.php';
require_once 'Modele/Pays.php';
require_once 'Modele/Situationfamille.php';
require_once 'Modele/Groupesanguin.php';
require_once 'Modele/Garantieadherent.php';
class ControleurAjaxremplaceradherent extends Controleur
{
private $adherent;
private $naturepiece;
private $sexe;
private $pays;
private $situationfamille;
private $groupesanguin;
private $garantieadherent;
public function __construct()
{
$this->adherent = new Adherent();
$this->naturepiece = (new Naturepiece())->getListe();
$this->sexe = (new Sexe())->getListe();
$this->situationfamille = (new Situationfamille())->getListe();
$this->pays = (new Pays())->getListe($_SESSION['codePaysSociete']);
$this->groupesanguin = (new Groupesanguin())->getListe();
$this->garantieadherent = new Garantieadherent();
}
public function index()
{
// $this->genererVueAjax();
}
public function init()
{
$idPolice = $_SESSION['idPolice_C'];
$idAdherent = $_SESSION['idAdherent_C'];
$dateSortie = $this->requete->getParametreDate("dateSortie");
$dateRemplacement = $this->requete->getParametreDate("dateRemplacement");
$user = $_SESSION['login'];
$motifavenant = $this->requete->getParametreFormulaire("motifavenant");
$fraisCarte = $this->requete->getParametreFormulaire("fraisCarte","numerique");
$this->adherent->initremplacementadherent($idPolice, $idAdherent, $dateSortie , $dateRemplacement, $user,
$motifavenant, $fraisCarte);
$remplacementadherent_temp = $this->adherent->getremplacementadherent_temp();
$spadherent = $this->adherent->getRapportSpAdherent($idAdherent, $dateSortie);
$beneficiairearemplacers = $this->adherent->getbeneficiairearemplacer();
$adherentremplacanttemp = $this->adherent->getadherentremplacanttemp();
$garantieadherents = $this->garantieadherent->getGarantieAdherent($idAdherent);
$this->genererVueAjax(array('spadherent' => $spadherent, 'beneficiairearemplacers' => $beneficiairearemplacers,
'adherentremplacanttemp' => $adherentremplacanttemp, 'naturepiece' => $this->naturepiece, 'sexe' => $this->sexe,
'pays' => $this->pays, 'situationfamille' => $this->situationfamille, 'groupesanguin' => $this->groupesanguin,
'remplacementadherent_temp' => $remplacementadherent_temp, 'garantieadherents' => $garantieadherents));
}
public function enregistrerremplacementadherent()
{
$nom = $this->requete->getParametre("nom");
$prenoms = $this->requete->getParametreFormulaire("prenoms");
$codeNaturePiece = $this->requete->getParametre("codeNaturePiece");
$numeroPiece = $this->requete->getParametreFormulaire("numeroPiece");
$sexe = $this->requete->getParametreFormulaire("sexe");
$dateNaissance = $this->requete->getParametreDate("dateNaissance");
$codeGroupeSanguin = $this->requete->getParametreFormulaire("codeGroupeSanguin");
$codeSituationFamille = $this->requete->getParametreFormulaire("codeSituationFamille");
$nombreEnfants = $this->requete->getParametreFormulaire("nombreEnfants");
$adresseGeo = $this->requete->getParametreFormulaire("adresseGeo");
$adressePostale = $this->requete->getParametreFormulaire("adressePostale");
$codePays = $this->requete->getParametre("codePays");
$telephonFixe = $this->requete->getParametreFormulaire("telephonFixe");
$telephonePortable = $this->requete->getParametreFormulaire("telephonePortable");
$email = $this->requete->getParametreFormulaire("email");
$fraisCarte = $this->requete->getParametreFormulaire("fraisCarte","numerique");
$nom = strtoupper($nom);
$prenoms = ucwords($prenoms);
$this->adherent->enregistrerremplacementadherent($nom, $prenoms, $codeNaturePiece, $numeroPiece, $sexe,
$dateNaissance, $codeGroupeSanguin, $codeSituationFamille, $nombreEnfants, $adresseGeo, $adressePostale,
$codePays, $telephonFixe, $telephonePortable, $email, $fraisCarte) ;
// $this->genererVueAjax();
}
}