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

106 lines
4.5 KiB
PHP
Executable File

<?php
require_once 'Framework/Controleur.php';
require_once 'Modele/Adherent.php';
require_once 'Modele/Collegepolice.php';
require_once 'Modele/Menuvueutilisateur.php';
require_once 'Modele/Beneficiaire.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 'Societes/'.$_SESSION['codeSociete'].'/Tarifs/Modele/Tarif.php';
require_once 'Modele/Ville.php';
require_once 'Modele/Localite.php';
class ControleurModifieradherent extends Controleur {
private $menuvue;
private $adherent;
private $beneficiaire;
private $naturepiece;
private $sexe;
private $pays;
private $situationfamille;
private $groupesanguin;
private $tarif;
private $college;
private $ville;
private $localite;
public function __construct() {
$this->menuvue = new Menuvueutilisateur();
$this->menuvue->getMenuVue('Modifieradherent');
$this->adherent = new Adherent();
$this->beneficiaire = new Beneficiaire();
$this->naturepiece = (new Naturepiece())->getListe();
$this->sexe = (new Sexe())->getListe();
$this->situationfamille = (new Situationfamille())->getListe();
// $this->pays = (new Pays())->getListe($_SESSION['codePaysSociete']);
$this->pays = new Pays();
$this->groupesanguin = (new Groupesanguin())->getListe();
$this->tarif = new Tarif();
$this->college = (new Collegepolice())->getListeToutes($_SESSION['idPolice_C']);
$this->ville = new Ville();
$this->localite = new Localite();
}
public function index()
{
$idPolice = $_SESSION['idPolice_C'];
$id = $this->requete->getParametre("id");
$adherent = $this->adherent->getAdherentIdConso($id);
$codePays = $adherent['codePays'];
$codeVille = $adherent['codeVille'];
// $codeLocalite = $client['codeLocalite'];
$pays = $this->pays->getListe($codePays);
$ville = $this->ville->getListe($codePays);
$localite = $this->localite->getListe($codePays, $codeVille);
$this->genererVue(array('adherent' => $adherent, 'college' => $this->college, 'naturepiece' => $this->naturepiece, 'sexe' => $this->sexe,
'pays' => $pays, 'situationfamille' => $this->situationfamille, 'groupesanguin' => $this->groupesanguin,
'ville' => $ville, 'localite' => $localite));
}
public function modifier($prenoms=null) {
$id = $this->requete->getParametre("id");
// $idCollege = $this->requete->getParametre("idCollege");
$idPolice = $_SESSION['idPolice_C'];
$nom = strtoupper($this->requete->getParametreFormulaire("nom"));
$prenoms = strtoupper($this->requete->getParametreFormulaire("prenoms"));
$codeNaturePiece = $this->requete->getParametreFormulaire("codeNaturePiece");
$numeroPiece = strtoupper($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->getParametreFormulaire("codePays");
$telephonFixe = $this->requete->getParametreFormulaire("telephonFixe");
$telephonePortable = $this->requete->getParametreFormulaire("telephonePortable");
$email = $this->requete->getParametreFormulaire("email");
$dateEntree = $this->requete->getParametreDate("dateEntree");
$codeLocalite = $this->requete->getParametreFormulaire("codeLocalite");
$numeroCmu = strtoupper($this->requete->getParametreFormulaire("numeroCmu"));
$numeroMatricule = strtoupper($this->requete->getParametreFormulaire("numeroMatricule"));
// echo "codeLocalite => $codeLocalite";
// exit();
//var_dump($id);
//die();
$this->adherent->modifier($id, $nom, $prenoms, $codeNaturePiece, $numeroPiece, $sexe, $dateNaissance, $codeGroupeSanguin,
$codeSituationFamille, $nombreEnfants, $adresseGeo, $adressePostale, $codePays, $telephonFixe, $telephonePortable, $email,
$codeLocalite,$numeroCmu,$numeroMatricule);
$this->rediriger("Ficheadherent/".$id);
}
}