production/Controleur/ControleurAjaxtmadherentacte.php
2025-12-02 11:29:44 +00:00

57 lines
1.7 KiB
PHP
Executable File

<?php
require_once 'Framework/Controleur.php';
require_once 'Modele/Adherent.php';
class ControleurAjaxtmadherentacte extends Controleur {
private $adherent;
public function __construct()
{
$this->adherent = new Adherent();
}
public function index()
{
$idAdherent = isset($_SESSION['idAdherent_C'])? $_SESSION['idAdherent_C']:"0";
if($idAdherent > "0")
{
$adh = $this->adherent->trouverAdherentId($idAdherent);
}
$tmadherent = $this->adherent->getTmadherentacte();
$this->genererVueAjax(array('tmadherent' => $tmadherent));
}
public function controle()
{
$idAdherent = $this->requete->getParametreFormulaire("idAdherent");
$codeActe = $this->requete->getParametreFormulaire("codeActe");
$codeGarantie = $this->requete->getParametreFormulaire("codeGarantie");
$maxDateEffetTmAdherent = $this->adherent->getMaxDateEffetTmAdherentacte($idAdherent, $codeActe, $codeGarantie);
$this->genererVueAjax(array('maxDateEffetTmAdherent' => $maxDateEffetTmAdherent));
}
public function inserer()
{
$idAdherent = $this->requete->getParametreFormulaire("idAdherent");
$dateEffet = $this->requete->getParametreDate("dateEffet");
$tm = $this->requete->getParametreFormulaire("tm");
$codeActe = $this->requete->getParametreFormulaire("codeActe");
$codeGarantie = $this->requete->getParametreFormulaire("codeGarantie");
$this->adherent->insererTmadherentacte($idAdherent, $dateEffet, $tm, $codeActe, $codeGarantie);
}
public function supprimer()
{
$idTm = $this->requete->getParametreFormulaire("idTm");
$this->adherent->supprimerTmadherentacte($idTm);
}
}