66 lines
1.4 KiB
PHP
Executable File
66 lines
1.4 KiB
PHP
Executable File
<?php
|
|
require_once 'Framework/Controleur.php';
|
|
require_once 'Modele/Tabpays.php';
|
|
|
|
class ControleurAjaxtblisterpays extends Controleur {
|
|
private $pays;
|
|
|
|
public function __construct() {
|
|
$this->pays = new Tabpays();
|
|
}
|
|
|
|
public function index() {
|
|
$tabpays = $this->pays->getlisterpays();
|
|
$existeselection = $this->pays->existeSelection();
|
|
|
|
$this->genererVueAjax(array(
|
|
'pays' => $tabpays,
|
|
'existeselection' => $existeselection
|
|
));
|
|
}
|
|
|
|
public function supprimer(){
|
|
$id = $this->requete->getParametreFormulaire('id');
|
|
|
|
$this->pays->supprimerpays($id);
|
|
|
|
}
|
|
|
|
////////////////////////////////////////////////////////////
|
|
|
|
public function selectionneun(){
|
|
|
|
$id = $this->requete->getParametreFormulaire('id');
|
|
$paysdonnee = $this->pays->getid($id);
|
|
|
|
if($paysdonnee['choix']=='0'){
|
|
$this->pays->selectionnerune($id);
|
|
}else{
|
|
$this->pays->deselectionnerune($id);
|
|
}
|
|
}
|
|
|
|
public function selectionnetout(){
|
|
$existeselection = $this->pays->existeSelection();
|
|
if($existeselection){
|
|
$this->pays->deselectionnertoutes();
|
|
}else{
|
|
$this->pays->selectionnertoutes();
|
|
}
|
|
}
|
|
|
|
public function supprimerTout(){
|
|
|
|
$this->pays->supprimertoutes();
|
|
|
|
}
|
|
|
|
public function supprimerChoix(){
|
|
|
|
$this->pays->supprimerchoix();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|