65 lines
1.5 KiB
PHP
65 lines
1.5 KiB
PHP
<?php
|
|
require_once 'Framework/Controleur.php';
|
|
require_once 'Modele/Tabcommerciaux.php';
|
|
|
|
class ControleurAjaxtblistercommerciaux extends Controleur {
|
|
private $commer;
|
|
|
|
public function __construct() {
|
|
$this->commer = new Tabcommerciaux();
|
|
}
|
|
|
|
public function index() {
|
|
$tabcommer = $this->commer->getlistercommerciaux();
|
|
$existeselection = $this->commer->existeSelection();
|
|
|
|
$this->genererVueAjax(array(
|
|
'commerciaux' => $tabcommer,
|
|
'existeselection' => $existeselection
|
|
));
|
|
}
|
|
|
|
public function supprimer(){
|
|
$id = $this->requete->getParametreFormulaire('id');
|
|
|
|
$this->commer->supprimercommerciaux($id);
|
|
|
|
}
|
|
|
|
////////////////////////////////////////////////////////////
|
|
|
|
public function selectionneun(){
|
|
|
|
$id = $this->requete->getParametreFormulaire('id');
|
|
$commerdonnee = $this->commer->getid($id);
|
|
|
|
if($commerdonnee['choix']=='0'){
|
|
$this->commer->selectionnerune($id);
|
|
}else{
|
|
$this->commer->deselectionnerune($id);
|
|
}
|
|
}
|
|
|
|
public function selectionnetout(){
|
|
$existeselection = $this->commer->existeSelection();
|
|
if($existeselection){
|
|
$this->commer->deselectionnertoutes();
|
|
}else{
|
|
$this->commer->selectionnertoutes();
|
|
}
|
|
}
|
|
|
|
public function supprimerTout(){
|
|
|
|
$this->commer->supprimertoutes();
|
|
|
|
}
|
|
|
|
public function supprimerChoix(){
|
|
|
|
$this->commer->supprimerchoix();
|
|
|
|
}
|
|
}
|
|
|
|
|