45 lines
1.5 KiB
PHP
45 lines
1.5 KiB
PHP
<?php
|
|
require_once 'Framework/Controleur.php';
|
|
require_once 'Modele/Adherent.php';
|
|
require_once 'Modele/Etatpersonne.php';
|
|
require_once 'Modele/Menuvueutilisateur.php';
|
|
|
|
class ControleurChangeretatadherent extends Controleur {
|
|
private $menuvue;
|
|
private $adherent;
|
|
private $etatpersonne;
|
|
|
|
|
|
public function __construct() {
|
|
$this->menuvue = new Menuvueutilisateur();
|
|
$this->menuvue->getMenuVue("Changeretatadherent");
|
|
|
|
$this->adherent = new Adherent();
|
|
$this->etatpersonne = new Etatpersonne;
|
|
}
|
|
public function index() {
|
|
$idAdherent = $_SESSION['idAdherent_C'];
|
|
$adherent = $this->adherent->getAdherentId($idAdherent);
|
|
|
|
$oldcodeEtatPersonne = $adherent['codeEtatAdherent'];
|
|
|
|
$etatpersonne = $this->etatpersonne->getListeSuiteFam($oldcodeEtatPersonne);
|
|
|
|
$this->genererVue(array('adherent' => $adherent, 'etatpersonne' => $etatpersonne));
|
|
}
|
|
|
|
public function enregistrer()
|
|
{
|
|
$idAdherent = $_SESSION['idAdherent_C'];
|
|
|
|
$codeEtatAdherent = $this->requete->getParametreFormulaire("codeEtatAdherent");
|
|
$motifEtat = $this->requete->getParametreFormulaire("motifEtat");
|
|
$dateEtat = $this->requete->getParametreDate("dateEtat");
|
|
|
|
$this->adherent->changeretat($idAdherent, $codeEtatAdherent, $motifEtat, $dateEtat);
|
|
|
|
// $this->rediriger("Ficheadherent");
|
|
// $this->rediriger("Ficheadherent", $_SESSION['idAdherent_C']);
|
|
$this->rediriger("Ficheadherent/".$_SESSION['idAdherent_C']);
|
|
}
|
|
} |