53 lines
1.2 KiB
PHP
Executable File
53 lines
1.2 KiB
PHP
Executable File
<?php
|
|
require_once 'Framework/Controleur.php';
|
|
require_once 'Modele/Tabaffection.php';
|
|
|
|
class ControleurAjaxtblisteraffection extends Controleur {
|
|
private $aff;
|
|
|
|
public function __construct() {
|
|
$this->aff = new Tabaffection();
|
|
}
|
|
|
|
public function index() {
|
|
$tabaff = $this->aff->getlisteraffection();
|
|
$existeselection = $this->aff->existeSelection();
|
|
|
|
$this->genererVueAjax(array(
|
|
'affection' => $tabaff,
|
|
'existeselection' => $existeselection
|
|
));
|
|
}
|
|
|
|
public function selectionneun(){
|
|
|
|
$id = $this->requete->getParametreFormulaire('id');
|
|
$affdonnee = $this->aff->getid($id);
|
|
|
|
if($affdonnee['choix']=='0'){
|
|
$this->aff->selectionnerune($id);
|
|
}else{
|
|
$this->aff->deselectionnerune($id);
|
|
}
|
|
}
|
|
|
|
public function selectionnetout(){
|
|
$existeselection = $this->aff->existeSelection();
|
|
if($existeselection){
|
|
$this->aff->deselectionnertoutes();
|
|
}else{
|
|
$this->aff->selectionnertoutes();
|
|
}
|
|
}
|
|
|
|
public function supprimer(){
|
|
$id = $this->requete->getParametreFormulaire('id');
|
|
|
|
$this->aff->supprimeraffection($id);
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|