Import initial du projet Production
This commit is contained in:
49
Controleur/ControleurTbmodifiertitre.php
Normal file
49
Controleur/ControleurTbmodifiertitre.php
Normal file
@@ -0,0 +1,49 @@
|
||||
<?php
|
||||
require_once 'Framework/Controleur.php';
|
||||
require_once 'Modele/Titre.php';
|
||||
require_once 'Modele/Menuvueutilisateur.php';
|
||||
|
||||
class ControleurTbmodifiertitre extends Controleur {
|
||||
private $menuvue;
|
||||
private $titre;
|
||||
|
||||
public function __construct() {
|
||||
$this->menuvue = new Menuvueutilisateur();
|
||||
$this->menuvue->getMenuTbajout('titre');
|
||||
|
||||
$this->titre = new titre();
|
||||
}
|
||||
|
||||
public function index() {
|
||||
$id = $this->requete->getParametre("id");
|
||||
$titre = $this->titre->gettitre($id);
|
||||
|
||||
$chemin = $this->menuvue->getChemin('titre');
|
||||
|
||||
$this->genererVue(array('titre' => $titre, 'chemin' => $chemin));
|
||||
}
|
||||
|
||||
public function reafficher() {
|
||||
$this->genererVue();
|
||||
}
|
||||
|
||||
public function modifier() {
|
||||
$id = $this->requete->getParametre("idtitre");
|
||||
$oldcodeTitre = $this->requete->getParametre("oldcodeTitre");
|
||||
$codeTitre = $this->requete->getParametre("codeTitre");
|
||||
$libelle = $this->requete->getParametre("libelle");
|
||||
$titreCourrier = $this->requete->getParametre("titreCourrier");
|
||||
// Début contrôle doublon
|
||||
$doublon = false;
|
||||
$doublon = (($codeTitre!=$oldcodeTitre) && ($this->titre->existeligne($codeTitre)));
|
||||
if (!$doublon) {
|
||||
$codeTitre = strtoupper($codeTitre);
|
||||
$libelle = ucfirst($libelle);
|
||||
$titreCourrier = ucwords($titreCourrier);
|
||||
|
||||
$this->titre->modifier($id, $codeTitre, $libelle, $titreCourrier);
|
||||
}
|
||||
$this->rediriger("Tblistetitre");
|
||||
// Fin contrôle doublon
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user