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/Tabville.php';
|
|
|
|
class ControleurAjaxtblisterville extends Controleur {
|
|
private $ville;
|
|
|
|
public function __construct() {
|
|
$this->ville = new Tabville();
|
|
}
|
|
|
|
public function index() {
|
|
$tabville = $this->ville->getlisterville();
|
|
$existeselection = $this->ville->existeSelection();
|
|
|
|
$this->genererVueAjax(array(
|
|
'ville' => $tabville,
|
|
'existeselection' => $existeselection
|
|
));
|
|
}
|
|
|
|
public function supprimer(){
|
|
$id = $this->requete->getParametreFormulaire('id');
|
|
|
|
$this->ville->supprimerville($id);
|
|
|
|
}
|
|
|
|
////////////////////////////////////////////////////////////
|
|
|
|
public function selectionneun(){
|
|
|
|
$id = $this->requete->getParametreFormulaire('id');
|
|
$villedonnee = $this->ville->getid($id);
|
|
|
|
if($villedonnee['choix']=='0'){
|
|
$this->ville->selectionnerune($id);
|
|
}else{
|
|
$this->ville->deselectionnerune($id);
|
|
}
|
|
}
|
|
|
|
public function selectionnetout(){
|
|
$existeselection = $this->ville->existeSelection();
|
|
if($existeselection){
|
|
$this->ville->deselectionnertoutes();
|
|
}else{
|
|
$this->ville->selectionnertoutes();
|
|
}
|
|
}
|
|
|
|
public function supprimerTout(){
|
|
|
|
$this->ville->supprimertoutes();
|
|
|
|
}
|
|
|
|
public function supprimerChoix(){
|
|
|
|
$this->ville->supprimerchoix();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|