a
This commit is contained in:
89
Controleur/ControleurCreeravenant.php
Normal file
89
Controleur/ControleurCreeravenant.php
Normal file
@@ -0,0 +1,89 @@
|
||||
<?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=="RES")
|
||||
{
|
||||
$this->rediriger("Ficheresiliation");
|
||||
}
|
||||
else
|
||||
if($codeTypeAvenant=="RET")
|
||||
{
|
||||
$this->rediriger("Ficheretrait");
|
||||
}
|
||||
else
|
||||
if($codeTypeAvenant=="REN")
|
||||
{
|
||||
$dateEcheanceRen = $this->requete->getParametreDate("dateEcheanceRen");
|
||||
$_SESSION['dateEcheanceRen_C'] = $dateEcheanceRen;
|
||||
$this->rediriger("Ficherenouvellement");
|
||||
}
|
||||
else
|
||||
if($codeTypeAvenant=="ADL")
|
||||
{
|
||||
$this->rediriger("Fichelimiteadditionnelle");
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->police->creeravenant($idPolice, $codeTypeAvenant, $motifavenant, $dateAvenant);
|
||||
|
||||
$this->police->getContexteAjaxPolice($idPolice);
|
||||
|
||||
if($codeTypeAvenant=="INC")
|
||||
{
|
||||
/*
|
||||
if($_SESSION['codeTypeContrat']=="G")
|
||||
{
|
||||
$this->rediriger("Importassure");
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->rediriger("Listeadherent");
|
||||
}
|
||||
*/
|
||||
$this->rediriger("Fichepolice");
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->rediriger("Fichepolice");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user