menuvue = new Menuvueutilisateur(); $this->menuvue->getMenuTbajout('apporteur'); $this->apporteur = new Apporteur(); $this->typeapporteur = (new Typeapporteur())->getListe(); $this->bureau = (new Bureau())->getListe(); } public function index() { $this->genererVue(array('typeapporteur' => $this->typeapporteur, 'bureau' => $this->bureau)); } public function ajouter() { $codeSociete = $this->requete->getSession()->getAttribut('codeSociete'); $codeApporteur = $this->requete->getParametre("codeApporteur"); // Début contrôle doublon if (!$this->apporteur->existeligne($codeApporteur)) { $libelle = $this->requete->getParametre("libelle"); $codeTypeApporteur = $this->requete->getParametre("codeTypeApporteur"); $telephone = $this->requete->getParametreFormulaire("telephone"); $email = $this->requete->getParametreFormulaire("email"); $adresseGeo = $this->requete->getParametreFormulaire("adresseGeo"); $adressePost = $this->requete->getParametreFormulaire("adressePost"); $nomResponsable = $this->requete->getParametreFormulaire("nomResponsable"); $codeBureau = $this->requete->getParametre("codeBureau"); $codeApporteur = strtoupper($codeApporteur); $libelle = ucfirst($libelle); $nomResponsable = ucwords($nomResponsable); $this->apporteur->ajouter($codeSociete, $codeApporteur, $libelle, $codeTypeApporteur, $telephone, $email, $adresseGeo, $adressePost, $nomResponsable, $codeBureau); $this->executerAction("index"); } else $this->genererVue(array('typeapporteur' => $this->typeapporteur, 'bureau' => $this->bureau, 'msgErreur' => 'Ce code existe déjà!'), "index"); // Fin doublon } }