Import initial du projet Production
This commit is contained in:
46
Controleur/ControleurTbmodifiernaturepiece.php
Normal file
46
Controleur/ControleurTbmodifiernaturepiece.php
Normal file
@@ -0,0 +1,46 @@
|
||||
<?php
|
||||
require_once 'Framework/Controleur.php';
|
||||
require_once 'Modele/Naturepiece.php';
|
||||
require_once 'Modele/Menuvueutilisateur.php';
|
||||
|
||||
class ControleurTbmodifiernaturepiece extends Controleur {
|
||||
private $menuvue;
|
||||
private $naturepiece;
|
||||
|
||||
public function __construct() {
|
||||
$this->menuvue = new Menuvueutilisateur();
|
||||
$this->menuvue->getMenuTbajout('naturepiece');
|
||||
|
||||
$this->naturepiece = new naturepiece();
|
||||
}
|
||||
|
||||
public function index() {
|
||||
$id = $this->requete->getParametre("id");
|
||||
$naturepiece = $this->naturepiece->getnaturepiece($id);
|
||||
|
||||
$chemin = $this->menuvue->getChemin('Dossiercons');
|
||||
|
||||
$this->genererVue(array('naturepiece' => $naturepiece, 'chemin' => $chemin));
|
||||
}
|
||||
|
||||
public function reafficher() {
|
||||
$this->genererVue();
|
||||
}
|
||||
|
||||
public function modifier() {
|
||||
$id = $this->requete->getParametre("idnaturepiece");
|
||||
$oldcodeNaturePiece = $this->requete->getParametre("oldcodeNaturePiece");
|
||||
$codeNaturePiece = $this->requete->getParametre("codeNaturePiece");
|
||||
$libelle = $this->requete->getParametre("libelle");
|
||||
// Début contrôle doublon
|
||||
$doublon = false;
|
||||
$doublon = (($codeNaturePiece!=$oldcodeNaturePiece) && ($this->naturepiece->existeligne($codeNaturePiece)));
|
||||
if (!$doublon) {
|
||||
$codeNaturePiece = strtoupper($codeNaturePiece);
|
||||
$libelle = ucfirst($libelle);
|
||||
|
||||
$this->naturepiece->modifier($id, $codeNaturePiece, $libelle);
|
||||
}
|
||||
$this->rediriger("Tblistenaturepiece");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user