Initial commit for newdesigngestionnaire project
This commit is contained in:
47
Controleur/ControleurTbmodifiertypeaffection.php
Executable file
47
Controleur/ControleurTbmodifiertypeaffection.php
Executable file
@@ -0,0 +1,47 @@
|
||||
<?php
|
||||
require_once 'Framework/Controleur.php';
|
||||
require_once 'Modele/Typeaffection.php';
|
||||
require_once 'Modele/Menuvueutilisateur.php';
|
||||
|
||||
class ControleurTbmodifiertypeaffection extends Controleur {
|
||||
private $menuvue;
|
||||
private $typeaffection;
|
||||
|
||||
public function __construct() {
|
||||
$this->menuvue = new Menuvueutilisateur();
|
||||
$this->menuvue->getMenuTbajout('typeaffection');
|
||||
|
||||
$this->typeaffection = new typeaffection();
|
||||
}
|
||||
|
||||
public function index() {
|
||||
$id = $this->requete->getParametre("id");
|
||||
$typeaffection = $this->typeaffection->gettypeaffection($id);
|
||||
|
||||
$chemin = $this->menuvue->getChemin('typeaffection');
|
||||
|
||||
$this->genererVue(array('typeaffection' => $typeaffection, 'chemin' => $chemin));
|
||||
}
|
||||
|
||||
public function reafficher() {
|
||||
$this->genererVue();
|
||||
}
|
||||
|
||||
public function modifier() {
|
||||
$id = $this->requete->getParametre("idtypeaffection");
|
||||
$oldcodeType = $this->requete->getParametre("oldcodeType");
|
||||
$codeType = $this->requete->getParametre("codeType");
|
||||
$libelle = $this->requete->getParametre("libelle");
|
||||
// Début contrôle doublon
|
||||
$doublon = false;
|
||||
$doublon = (($codeType!=$oldcodeType) && ($this->typeaffection->existeligne($codeType)));
|
||||
if (!$doublon) {
|
||||
$codeType = strtoupper($codeType);
|
||||
$libelle = ucfirst($libelle);
|
||||
|
||||
$this->typeaffection->modifier($id, $codeType, $libelle);
|
||||
}
|
||||
$this->rediriger("Tblistetypeaffection");
|
||||
// Fin contrôle doublon
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user