38 lines
1.1 KiB
PHP
Executable File
38 lines
1.1 KiB
PHP
Executable File
<?php
|
|
require_once 'Framework/Controleur.php';
|
|
require_once 'Modele/Garantiepolice.php';
|
|
|
|
|
|
class ControleurAjaxgarantiespolice extends Controleur {
|
|
private $garantie;
|
|
|
|
public function __construct() {
|
|
$this->garantie = new Garantiepolice();
|
|
}
|
|
|
|
public function index() {
|
|
$idPolice=$_SESSION['idPolice_C'];
|
|
|
|
$garantiesbase = $this->garantie->getGarBasePolice($idPolice);
|
|
$garoptionnelles = $this->garantie->getGarOptPolice($idPolice);
|
|
$garoptacquises = $this->garantie->getGarOptPoliceAcq($idPolice);
|
|
|
|
$this->genererVueAjax(array('garantiesbase' => $garantiesbase, 'garoptionnelles' => $garoptionnelles, 'garoptacquises' => $garoptacquises));
|
|
}
|
|
|
|
public function ajoutergarantie()
|
|
{
|
|
$idPolice=$_SESSION['idPolice_C'];
|
|
$codeGarantie = $this->requete->getParametre("codeGarantie");
|
|
|
|
$this->garantie->ajouter($idPolice, $codeGarantie);
|
|
$this->executerAction("index");
|
|
}
|
|
|
|
public function supprimergarantie()
|
|
{
|
|
$idGarantie = $this->requete->getParametre("idGarantie");
|
|
$this->garantie->supprimer($idGarantie);
|
|
$this->executerAction("index");
|
|
}
|
|
} |