Import initial du projet Production
This commit is contained in:
41
Controleur/ControleurTbajouterbanque.php
Normal file
41
Controleur/ControleurTbajouterbanque.php
Normal file
@@ -0,0 +1,41 @@
|
||||
<?php
|
||||
require_once 'Framework/Controleur.php';
|
||||
require_once 'Modele/Banque.php';
|
||||
require_once 'Modele/Menuvueutilisateur.php';
|
||||
|
||||
class ControleurTbajouterbanque extends Controleur {
|
||||
private $menuvue;
|
||||
private $banque;
|
||||
|
||||
public function __construct() {
|
||||
$this->menuvue = new Menuvueutilisateur();
|
||||
$this->menuvue->getMenuTbajout('banque');
|
||||
|
||||
$this->banque = new banque();
|
||||
}
|
||||
public function index()
|
||||
{
|
||||
$chemin = $this->menuvue->getChemin('banque');
|
||||
|
||||
$this->genererVue(array('chemin' => $chemin));
|
||||
}
|
||||
|
||||
|
||||
public function ajouter() {
|
||||
$codeSociete = $this->requete->getSession()->getAttribut('codeSociete');
|
||||
$codebanque = $this->requete->getParametre("codebanque");
|
||||
// Début contrôle doublon
|
||||
if (!$this->banque->existeligne($codebanque)) {
|
||||
$libelle = $this->requete->getParametre("libelle");
|
||||
|
||||
$codebanque = strtoupper($codebanque);
|
||||
$libelle = ucfirst($libelle);
|
||||
|
||||
$this->banque->ajouter($codeSociete, $codebanque, $libelle);
|
||||
$this->executerAction("index");
|
||||
}
|
||||
else
|
||||
$this->genererVue(array('msgErreur' => 'Ce code existe déjà!'), "index");
|
||||
// Fin contrôle doublon
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user