menuvue = new Menuvueutilisateur(); $this->menuvue->getMenuTbajout('ville'); $this->ville = new Ville(); $this->pays = new Pays(); } public function index() { $id = $this->requete->getParametre("id"); $ville = $this->ville->getville($id); $pays = $this->pays->getListe($_SESSION['codePaysSociete']); $this->genererVue(array('ville' => $ville, 'pays' => $pays)); } public function reafficher() { $this->genererVue(); } public function modifier() { $id = $this->requete->getParametre("idville"); $oldcodeVille = $this->requete->getParametre("oldcodeVille"); $codeVille = $this->requete->getParametre("codeVille"); $libelle = $this->requete->getParametre("libelle"); $codePays = $this->requete->getParametre("codePays"); // Début contrôle doublon $doublon = false; $doublon = (($codeVille!=$oldcodeVille) && ($this->ville->existeligne($codeVille))); if (!$doublon) { $codeVille = strtoupper($codeVille); $libelle = ucfirst($libelle); $this->ville->modifier($id, $codeVille, $libelle, $codePays); } $this->rediriger("Tblisteville"); // Fin contrôle doublon } }