64 lines
1.4 KiB
PHP
64 lines
1.4 KiB
PHP
<?php
|
|
require_once 'Framework/Controleur.php';
|
|
require_once 'Modele/Tabgarantie.php';
|
|
|
|
class ControleurAjaxtblistergarantie extends Controleur {
|
|
private $garantie;
|
|
|
|
public function __construct() {
|
|
$this->garantie = new Tabgarantie();
|
|
}
|
|
|
|
public function index() {
|
|
$tabgarantie = $this->garantie->getlistergarantie();
|
|
$existeselection = $this->garantie->existeSelection();
|
|
|
|
$this->genererVueAjax(array(
|
|
'garantie' => $tabgarantie,
|
|
'existeselection' => $existeselection
|
|
));
|
|
}
|
|
|
|
public function selectionneun(){
|
|
|
|
$id = $this->requete->getParametreFormulaire('id');
|
|
$garantiedonnee = $this->garantie->getid($id);
|
|
|
|
if($garantiedonnee['choix']=='0'){
|
|
$this->garantie->selectionnerune($id);
|
|
}else{
|
|
$this->garantie->deselectionnerune($id);
|
|
}
|
|
}
|
|
|
|
public function selectionnetout(){
|
|
$existeselection = $this->garantie->existeSelection();
|
|
if($existeselection){
|
|
$this->garantie->deselectionnertoutes();
|
|
}else{
|
|
$this->garantie->selectionnertoutes();
|
|
}
|
|
}
|
|
|
|
|
|
|
|
public function supprimer(){
|
|
$id = $this->requete->getParametreFormulaire('id');
|
|
$this->garantie->supprimergarantie($id);
|
|
}
|
|
|
|
public function supprimerTout(){
|
|
|
|
$this->garantie->supprimertoutes();
|
|
|
|
}
|
|
|
|
public function supprimerChoix(){
|
|
|
|
$this->garantie->supprimerchoix();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|