radiantrh/Controleur/ControleurCreeravenant.php
2026-01-03 01:35:24 +00:00

52 lines
1.5 KiB
PHP

<?php
require_once 'Framework/Controleur.php';
require_once 'Modele/Police.php';
require_once 'Modele/Typeavenant.php';
require_once 'Modele/Menuvueutilisateur.php';
class ControleurCreeravenant extends Controleur {
private $police;
private $typeavenant;
public function __construct() {
$this->menuvue = new Menuvueutilisateur();
$this->menuvue->getMenuVue("Creeravenant");
$this->police = new Police();
$this->typeavenant = new Typeavenant;
}
public function index() {
$idPolice = $_SESSION['idPolice_C'];
$this->police->getContextePoliceId($idPolice);
$police = $this->police->getPoliceId($idPolice);
$oldCodeTypeAvenant = $police['codeTypeAvenant'];
$typeavenant = $this->typeavenant->getListeSuite($oldCodeTypeAvenant);
$this->genererVue(array('police' => $police, 'typeavenant' => $typeavenant));
}
public function enregistrer()
{
$idPolice = $_SESSION['idPolice_C'];
$codeTypeAvenant = $this->requete->getParametreFormulaire("codeTypeAvenant");
$motifavenant = $this->requete->getParametreFormulaire("motifavenant");
$dateAvenant = $this->requete->getParametreDate("dateAvenant");
$_SESSION['dateAvenant_C'] = $dateAvenant;
$_SESSION['motifavenant_C'] = $motifavenant;
if($codeTypeAvenant=="RET")
{
$this->rediriger("Ficheretrait");
}
else
if($codeTypeAvenant=="INC")
{
$this->rediriger("Listeadherent");
}
}
}