This commit is contained in:
KANE LAZENI 2026-01-03 00:15:26 +00:00
parent b6cf9927ae
commit 9e0b170cab
2 changed files with 115 additions and 1 deletions

View 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");
}
}
}
}

View File

@ -1348,4 +1348,29 @@ function imprimer_cp(lienEtat)
{
}
});
}
}
function creer_avenant()
{
etat=$("#codeEtatPolice_C").val();
if (etat=="RE")
{
v_msg="Attention! Police résiliée!";
v_msgEng="Warning! Terminated policy!";
alert_ebene(v_msg, v_msgEng);
return;
}
if (etat=="AN")
{
v_msg="Attention! Police annulée!";
v_msgEng="Warning! Canceled policy!";
alert_ebene(v_msg, v_msgEng);
return;
}
window.location.assign($("#racineWeb" ).val()+"Creeravenant/");
}