Initial commit for newdesigngestionnaire project
This commit is contained in:
49
Controleur/ControleurModifierprofil.php
Executable file
49
Controleur/ControleurModifierprofil.php
Executable file
@@ -0,0 +1,49 @@
|
||||
<?php
|
||||
require_once 'Framework/Controleur.php';
|
||||
require_once 'Modele/ProfilSysteme.php';
|
||||
require_once 'Modele/Profil.php';
|
||||
require_once 'Modele/Menuvueutilisateur.php';
|
||||
|
||||
class ControleurModifierprofil extends Controleur {
|
||||
private $menuvue;
|
||||
private $profil;
|
||||
|
||||
public function __construct() {
|
||||
$this->menuvue = new Menuvueutilisateur();
|
||||
$this->menuvue->getMenuVue('Modifierprofil');
|
||||
|
||||
$this->profil = new Profil();
|
||||
$this->profilsysteme = new ProfilSysteme();
|
||||
}
|
||||
|
||||
public function index() {
|
||||
$id = $this->requete->getParametre("id");
|
||||
$profil = $this->profil->getProfil($id);
|
||||
$profilsysteme = $this->profilsysteme->getListe();
|
||||
$chemin = $this->menuvue->getChemin('Modifierprofil');
|
||||
|
||||
$this->genererVue(array('profil' => $profil, 'profilsysteme' => $profilsysteme ,'chemin' => $chemin
|
||||
));
|
||||
}
|
||||
|
||||
public function reafficher() {
|
||||
$this->genererVue();
|
||||
}
|
||||
|
||||
public function modifier() {
|
||||
$id = $this->requete->getParametre("idprofil");
|
||||
|
||||
$oldcodeType = $this->requete->getParametre("oldcodeProfil");
|
||||
$codeProfil = $this->requete->getParametre("codeProfil");
|
||||
$libelle = $this->requete->getParametre("libelle");
|
||||
$codeProfilSysteme= $this->requete->getParametre("codeProfilSysteme");
|
||||
// Début contrôle doublon
|
||||
$doublon = false;
|
||||
$doublon = (($codeProfil!=$oldcodeType) && ($this->profil->existeligne($codeProfil)));
|
||||
if (!$doublon) {
|
||||
$this->profil->modifier($id, $codeProfil, $libelle, $codeProfilSysteme);
|
||||
}
|
||||
$this->rediriger("Listeprofil");
|
||||
// Fin contrôle doublon
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user