menuvue = new Menuvueutilisateur(); $this->menuvue->getMenuTbajout('prestataire'); $this->prestataire = new Prestataire(); $this->typeprestataire = (new Typeprestataire())->getListe(); $this->natureprestataire = (new Natureprestataire())->getListe(); $this->gestionnaire = (new Gestionnaire())->getListe(); $this->localite = new Localite(); $this->pays = (new Pays())->getListe($_SESSION['codePaysSociete']); $this->ville = (new Ville())->getListe($_SESSION['codePaysSociete']); } public function index() { $this->genererVue(array('typeprestataire' => $this->typeprestataire, 'listelocalite' => $this->localite, 'pays' => $this->pays, 'listeville' => $this->ville, 'gestionnaire' => $this->gestionnaire, 'natureprestataire' => $this->natureprestataire)); } public function ajouter() { $codeSociete = $this->requete->getSession()->getAttribut('codeSociete'); $codePrestataire = $this->requete->getParametre("codePrestataire"); // Début contrôle doublon /* id, codeSociete, codeTypePrestataire, codePrestataire, libelle, codePays, codeVille, codeLocalite, adresseGeo, adressePost, telephoneFixe, telephonePortable, email, nomResponsable, contactResponsable, emailResponsable, nomInterlocuteur, contactInterlocuteur, emailInterlocuteur, numeroCompte, codeGestionnaire, codeNaturePrestataire */ if (!$this->prestataire->existeligne($codePrestataire)) { $libelle = $this->requete->getParametre("libelle"); $codeTypePrestataire = $this->requete->getParametre("codeTypePrestataire"); $codePays = $this->requete->getParametre("codePays"); $codeVille = $this->requete->getParametre("codeVille"); $codeLocalite = $this->requete->getParametre("codeLocalite"); $adresseGeo = $this->requete->getParametreFormulaire("adresseGeo"); $adressePost = $this->requete->getParametreFormulaire("adressePost"); $telephoneFixe = $this->requete->getParametreFormulaire("telephoneFixe"); $telephonePortable = $this->requete->getParametreFormulaire("telephonePortable"); $email = $this->requete->getParametre("email"); $nomResponsable = $this->requete->getParametre("nomResponsable"); $contactResponsable = $this->requete->getParametre("contactResponsable"); $emailResponsable = $this->requete->getParametre("emailResponsable"); $nomInterlocuteur = $this->requete->getParametre("nomInterlocuteur"); $contactInterlocuteur = $this->requete->getParametre("contactInterlocuteur"); $emailInterlocuteur = $this->requete->getParametre("emailInterlocuteur"); $numeroCompte = $this->requete->getParametreFormulaire("numeroCompte"); $codeGestionnaire = $this->requete->getParametre("codeGestionnaire"); $codeNaturePrestataire = $this->requete->getParametre("codeNaturePrestataire"); $codePrestataire = strtoupper($codePrestataire); $libelle = ucfirst($libelle); $nomResponsable = ucwords($nomResponsable); $nomInterlocuteur = ucwords($nomInterlocuteur); $this->prestataire->ajouter($codeSociete, $codeTypePrestataire, $codePrestataire, $libelle, $codePays, $codeVille, $codeLocalite, $adresseGeo, $adressePost, $telephoneFixe, $telephonePortable, $email, $nomResponsable, $contactResponsable, $emailResponsable, $nomInterlocuteur, $contactInterlocuteur, $emailInterlocuteur, $numeroCompte, $codeGestionnaire, $codeNaturePrestataire); $this->executerAction("index"); } else $this->genererVue(array('typeprestataire' => $this->typeprestataire, 'listelocalite' => $this->localite, 'pays' => $this->pays, 'listeville' => $this->ville, 'gestionnaire' => $this->gestionnaire, 'natureprestataire' => $this->natureprestataire, 'msgErreur' => 'Ce code existe déjà!'), "index"); // $this->genererVue(array('typeprestataire' => $this->typeprestataire, 'bureau' => $this->bureau, 'msgErreur' => 'Ce code existe déjà!'), "index"); // Fin doublon } }