43 lines
1.4 KiB
PHP
Executable File
43 lines
1.4 KiB
PHP
Executable File
<?php
|
|
require_once 'Framework/Controleur.php';
|
|
require_once 'Modele/Exclusion.php';
|
|
require_once 'Modele/Menuvueutilisateur.php';
|
|
|
|
class ControleurTbmodifierexclusion extends Controleur {
|
|
private $menuvue;
|
|
private $exclusion;
|
|
public function __construct() {
|
|
$this->menuvue = new Menuvueutilisateur();
|
|
$this->menuvue->getMenuTbajout('exclusion');
|
|
|
|
$this->exclusion = new exclusion();
|
|
}
|
|
|
|
public function index() {
|
|
$id = $this->requete->getParametre("id");
|
|
$exclusion = $this->exclusion->getexclusion($id);
|
|
$this->genererVue(array('exclusion' => $exclusion));
|
|
}
|
|
|
|
public function reafficher() {
|
|
$this->genererVue();
|
|
}
|
|
|
|
public function modifier() {
|
|
$id = $this->requete->getParametre("idexclusion");
|
|
$oldcodeExclusion = $this->requete->getParametre("oldcodeExclusion");
|
|
$codeExclusion = $this->requete->getParametre("codeExclusion");
|
|
$libelle = $this->requete->getParametre("libelle");
|
|
// Début contrôle doublon
|
|
$doublon = false;
|
|
$doublon = (($codeExclusion!=$oldcodeExclusion) && ($this->exclusion->existeligne($codeExclusion)));
|
|
if (!$doublon) {
|
|
$codeExclusion = strtoupper($codeExclusion);
|
|
$libelle = ucfirst($libelle);
|
|
|
|
$this->exclusion->modifier($id, $codeExclusion, $libelle);
|
|
}
|
|
$this->rediriger("Tblisteexclusion");
|
|
// Fin contrôle doublon
|
|
}
|
|
} |