menuvue = new Menuvueutilisateur(); $this->menuvue->getMenuTbajout('localite'); $this->localite = new Localite(); $this->pays = (new Pays())->getListe($_SESSION['codePaysSociete']); $this->ville = (new Ville())->getListe($_SESSION['codePaysSociete']); } public function index() { $this->genererVue(array('pays' => $this->pays, 'ville' => $this->ville)); } public function ajouter() { $codeSociete = $this->requete->getSession()->getAttribut('codeSociete'); $codeLocalite = $this->requete->getParametre("codeLocalite"); // Début contrôle doublon if (!$this->localite->existeligne($codeLocalite)) { $libelle = $this->requete->getParametre("libelle"); $codePays = $this->requete->getParametre("codePays"); $codeVille = $this->requete->getParametre("codeVille"); $codeLocalite = strtoupper($codeLocalite); $libelle = ucfirst($libelle); $this->localite->ajouter($codeSociete, $codeLocalite, $libelle, $codePays, $codeVille); $this->executerAction("index"); } else $this->genererVue(array('pays' => $this->pays, 'ville' => $this->ville, 'msgErreur' => 'Ce code existe déjà!'), "index"); // Fin doublon } }