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

58 lines
1.8 KiB
PHP
Executable File

<?php
require_once 'Framework/Controleur.php';
require_once 'Modele/Adherent.php';
class ControleurAjaxtmadherentgarantieprestataire 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->ad->trouverAdherentId($idAdherent);
}
$tmadherent = $this->adherent->getTmadherentgarantieprestataire();
$this->genererVueAjax(array('tmadherent' => $tmadherent));
}
public function controle()
{
$idAdherent = $this->requete->getParametreFormulaire("idAdherent");
$codeGarantie = $this->requete->getParametreFormulaire("codeGarantie");
$codePrestataire = $this->requete->getParametreFormulaire("codePrestataire");
$maxDateEffetTmAdherent = $this->adherent->getMaxDateEffetTmAdherentgarantieprestataire($idAdherent, $codeGarantie, $codePrestataire);
$this->genererVueAjax(array('maxDateEffetTmAdherent' => $maxDateEffetTmAdherent));
}
public function inserer()
{
$idAdherent = $this->requete->getParametreFormulaire("idAdherent");
$dateEffet = $this->requete->getParametreDate("dateEffet");
$tm = $this->requete->getParametreFormulaire("tm");
$codeGarantie = $this->requete->getParametreFormulaire("codeGarantie");
$codePrestataire = $this->requete->getParametreFormulaire("codePrestataire");
$this->adherent->insererTmadherentgarantieprestataire($idAdherent, $dateEffet, $tm, $codeGarantie, $codePrestataire);
}
public function supprimer()
{
$idTm = $this->requete->getParametreFormulaire("idTm");
$this->adherent->supprimerTmadherentgarantieprestataire($idTm);
}
}