prestation/Controleur/ControleurFicherenouvellement.php
2025-12-01 18:54:33 +00:00

44 lines
1.4 KiB
PHP

<?php
require_once 'Framework/Controleur.php';
require_once 'Modele/Police.php';
require_once 'Modele/College_temp.php';
require_once 'Modele/Menuvueutilisateur.php';
class ControleurFicherenouvellement extends Controleur {
private $menuvue;
private $avenant;
private $college_temp;
public function __construct() {
$this->menuvue = new Menuvueutilisateur();
$this->menuvue->getMenuVue("Ficherenouvellement");
$this->avenant = new Police();
$this->college_temp = new College_temp();
}
public function index() {
$user = $_SESSION['login'];
$idPolice = $_SESSION['idPolice_C'];
$dateEcheance = $_SESSION['dateEcheance_C'];
$dateAvenant = $_SESSION['dateAvenant_C'];
$dateEcheanceRen = $_SESSION['dateEcheanceRen_C'];
$this->avenant->initrerenouvellement($idPolice);
$emission = $this->avenant->getEmissionTemp($idPolice);
$avenant = $this->avenant->getAvenantTemp($idPolice);
$sppolice = $this->avenant->getRapportSpPolice($idPolice, $dateEcheance);
$colleges = $this->college_temp->getCollegeTempPoliceRen($idPolice, $user) ;
$this->genererVue(array('colleges' => $colleges, 'emission' => $emission, 'avenant' => $avenant, 'sppolice' => $sppolice));
}
public function enregistrerrenouvellement()
{
$this->avenant->enregistrerrenouvellement();
$this->rediriger("Fichepolice");
}
}