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