prestation/Controleur/ControleurAjaxtblistertitre.php
2025-12-01 18:54:33 +00:00

66 lines
1.4 KiB
PHP

<?php
require_once 'Framework/Controleur.php';
require_once 'Modele/Tabtitre.php';
class ControleurAjaxtblistertitre extends Controleur {
private $titre;
public function __construct() {
$this->titre = new Tabtitre();
}
public function index() {
$tabtitre = $this->titre->getlistertitre();
$existeselection = $this->titre->existeSelection();
$this->genererVueAjax(array(
'titre' => $tabtitre,
'existeselection' => $existeselection
));
}
public function supprimer(){
$id = $this->requete->getParametreFormulaire('id');
$this->titre->supprimertitre($id);
}
////////////////////////////////////////////////////////////
public function selectionneun(){
$id = $this->requete->getParametreFormulaire('id');
$titredonnee = $this->titre->getid($id);
if($titredonnee['choix']=='0'){
$this->titre->selectionnerune($id);
}else{
$this->titre->deselectionnerune($id);
}
}
public function selectionnetout(){
$existeselection = $this->titre->existeSelection();
if($existeselection){
$this->titre->deselectionnertoutes();
}else{
$this->titre->selectionnertoutes();
}
}
public function supprimerTout(){
$this->titre->supprimertoutes();
}
public function supprimerChoix(){
$this->titre->supprimerchoix();
}
}