66 lines
1.5 KiB
PHP
Executable File
66 lines
1.5 KiB
PHP
Executable File
<?php
|
|
require_once 'Framework/Controleur.php';
|
|
require_once 'Modele/Tabservice.php';
|
|
|
|
class ControleurAjaxtblisterservice extends Controleur {
|
|
private $service;
|
|
|
|
public function __construct() {
|
|
$this->service = new Tabservice();
|
|
}
|
|
|
|
public function index() {
|
|
$tabservice = $this->service->getlisterservice();
|
|
$existeselection = $this->service->existeSelection();
|
|
|
|
$this->genererVueAjax(array(
|
|
'service' => $tabservice,
|
|
'existeselection' => $existeselection
|
|
));
|
|
}
|
|
|
|
public function supprimer(){
|
|
$id = $this->requete->getParametreFormulaire('id');
|
|
|
|
$this->service->supprimerservice($id);
|
|
|
|
}
|
|
|
|
////////////////////////////////////////////////////////////
|
|
|
|
public function selectionneun(){
|
|
|
|
$id = $this->requete->getParametreFormulaire('id');
|
|
$servicedonnee = $this->service->getid($id);
|
|
|
|
if($servicedonnee['choix']=='0'){
|
|
$this->service->selectionnerune($id);
|
|
}else{
|
|
$this->service->deselectionnerune($id);
|
|
}
|
|
}
|
|
|
|
public function selectionnetout(){
|
|
$existeselection = $this->service->existeSelection();
|
|
if($existeselection){
|
|
$this->service->deselectionnertoutes();
|
|
}else{
|
|
$this->service->selectionnertoutes();
|
|
}
|
|
}
|
|
|
|
public function supprimerTout(){
|
|
|
|
$this->service->supprimertoutes();
|
|
|
|
}
|
|
|
|
public function supprimerChoix(){
|
|
|
|
$this->service->supprimerchoix();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|