diff --git a/Controleur/ControleurCreerclient.php b/Controleur/ControleurCreerclient.php index 75117441..47b9badc 100644 --- a/Controleur/ControleurCreerclient.php +++ b/Controleur/ControleurCreerclient.php @@ -4,13 +4,13 @@ require_once 'Modele/Pays.php'; require_once 'Modele/Ville.php'; require_once 'Modele/Titre.php'; require_once 'Modele/Secteuractivite.php'; -// require_once 'Modele/Gestionnaire.php'; require_once 'Modele/Client.php'; require_once 'Modele/Menuvueutilisateur.php'; require_once 'Modele/Typeclient.php'; require_once 'Modele/Sexe.php'; require_once 'Modele/Localite.php'; require_once 'Modele/Langue.php'; +require_once 'Modele/Ouinon.php'; class ControleurCreerclient extends Controleur { private $client; @@ -35,6 +35,7 @@ class ControleurCreerclient extends Controleur { $this->secteuractivite = (new Secteuractivite())->getListe(); $this->localite = new Localite(); $this->langue = new Langue(); + $this->ouinonstoploss = (new Ouinon())->getListe(); $_SESSION['modeDevis'] = "0"; } @@ -44,7 +45,7 @@ class ControleurCreerclient extends Controleur { $this->genererVue(array('pays' => $this->pays, 'ville' => $this->ville, 'titre' => $this->titre, 'secteuractivite' => $this->secteuractivite, 'sexe' => $this->sexe, 'typeclient' => $this->typeclient, - 'listelocalite' => $this->localite, 'langue' => $langue)); + 'listelocalite' => $this->localite, 'langue' => $langue, 'ouinonstoploss' => $this->ouinonstoploss)); } public function ajouter($prenoms=null) @@ -84,6 +85,8 @@ class ControleurCreerclient extends Controleur { $registreCommerce = $this->requete->getParametreFormulaire("registreCommerce"); $codeLangueClient = $this->requete->getParametreFormulaire("codeLangueUser"); + + $notificationLimiteConsommation = $this->requete->getParametreFormulaire("notificationLimiteConsommation"); $dernierNumeroClient = $this->client->getDenierNumeroClient(); $dernierNumeroClient=$dernierNumeroClient+1; @@ -97,7 +100,8 @@ class ControleurCreerclient extends Controleur { $id = $this->client->ajouter($codeSociete, $numeroClient, $typeClient, $codeTitre, $nom, $prenoms, $adresseGeo, $boitepostale, $codeVille, $codePays, $telephoneBureau, $telephonedomicile, $telephonePortable, $fax, $email, $sexe, $dateNaissance, $codeSecteur, $codeGestionnaire, $nomMandataire, $telephoneFixemandataire, - $telephonePortablemandataire, $emailMandataire, $dateCre, $user, $codeLocalite, $registreCommerce, $codeLangueClient); + $telephonePortablemandataire, $emailMandataire, $dateCre, $user, $codeLocalite, $registreCommerce, + $codeLangueClient, $notificationLimiteConsommation); $this->client->setDenierNumeroClient($numeroClient); $_SESSION['idClientAjax'] = $id; diff --git a/Controleur/ControleurModifierclient.php b/Controleur/ControleurModifierclient.php index 3438fb76..061faabc 100644 --- a/Controleur/ControleurModifierclient.php +++ b/Controleur/ControleurModifierclient.php @@ -10,6 +10,7 @@ require_once 'Modele/Client.php'; require_once 'Modele/Menuvueutilisateur.php'; require_once 'Modele/Localite.php'; require_once 'Modele/Langue.php'; +require_once 'Modele/Ouinon.php'; class ControleurModifierclient extends Controleur { private $client; @@ -30,6 +31,7 @@ class ControleurModifierclient extends Controleur { $this->typeclient = (new Typeclient())->getListe(); $this->secteuractivite = (new Secteuractivite())->getListe(); $this->langue = new Langue(); + $this->ouinonstoploss = (new Ouinon())->getListe(); } public function index() { $codeSociete = $this->requete->getSession()->getAttribut('codeSociete'); @@ -45,7 +47,7 @@ class ControleurModifierclient extends Controleur { $this->genererVue(array('client' => $client, 'pays' => $this->pays, 'ville' => $this->ville, 'titre' => $this->titre, 'secteuractivite' => $this->secteuractivite, 'sexe' => $this->sexe, 'typeclient' => $this->typeclient, - 'listelocalite' => $this->localite, 'langue' => $langue)); + 'listelocalite' => $this->localite, 'langue' => $langue, 'ouinonstoploss' => $this->ouinonstoploss)); } public function modifier($prenoms=null) { @@ -81,13 +83,16 @@ class ControleurModifierclient extends Controleur { $registreCommerce = $this->requete->getParametreFormulaire("registreCommerce"); $codeLangueClient = $this->requete->getParametreFormulaire("codeLangueUser"); + $notificationLimiteConsommation = $this->requete->getParametreFormulaire("notificationLimiteConsommation"); + $nom = strtoupper($nom); $prenoms = ucwords($prenoms); $this->client->modifier($id, $typeClient, $codeTitre, $nom, $prenoms, $adresseGeo, $boitepostale, $codeVille, $codePays, $telephoneBureau, $telephonedomicile, $telephonePortable, $fax, $email, $sexe, $dateNaissance, $codeSecteur, $codeGestionnaire, $nomMandataire, $telephoneFixemandataire, - $telephonePortablemandataire, $emailMandataire, $codeLocalite, $registreCommerce, $codeLangueClient); + $telephonePortablemandataire, $emailMandataire, $codeLocalite, $registreCommerce, + $codeLangueClient, $notificationLimiteConsommation); $_SESSION['idClientAjax'] = $id; // $this->rediriger("Ficheclient/".$id); diff --git a/Modele/Client.php b/Modele/Client.php index 1017da95..9c7ed7ef 100644 --- a/Modele/Client.php +++ b/Modele/Client.php @@ -153,18 +153,21 @@ class Client extends Modele { public function ajouter($codeSociete, $numeroClient, $typeClient, $codeTitre, $nom, $prenoms, $adresseGeo, $boitepostale, $codeVille, $codePays, $telephoneBureau, $telephonedomicile, $telephonePortable, $fax, $email, $sexe, $dateNaissance, $codeSecteur, $codeGestionnaire, $nomMandataire, $telephoneFixemandataire, - $telephonePortablemandataire, $emailMandataire, $dateCre, $user, $codeLocalite, $registreCommerce, $codeLangueClient) + $telephonePortablemandataire, $emailMandataire, $dateCre, $user, $codeLocalite, $registreCommerce, + $codeLangueClient, $notificationLimiteConsommation) { $sql = 'INSERT INTO clients (codeSociete, numeroClient, typeClient, codeTitre, nom, prenoms, adresseGeo, boitepostale, codeVille, codePays, telephoneBureau, telephonedomicile, telephonePortable, fax, email, sexe, dateNaissance, codeSecteur, codeGestionnaire, nomMandataire, telephoneFixemandataire, - telephonePortablemandataire, emailMandataire, dateCre, user, codeLocalite, registreCommerce, codeLangueClient) - VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)'; + telephonePortablemandataire, emailMandataire, dateCre, user, codeLocalite, registreCommerce, + codeLangueClient, notificationLimiteConsommation) + VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)'; $this->executerRequete($sql, array($codeSociete, $numeroClient, $typeClient, $codeTitre, $nom, $prenoms, $adresseGeo, $boitepostale, $codeVille, $codePays, $telephoneBureau, $telephonedomicile, $telephonePortable, $fax, $email, $sexe, $dateNaissance, $codeSecteur, $codeGestionnaire, $nomMandataire, $telephoneFixemandataire, - $telephonePortablemandataire, $emailMandataire, $dateCre, $user, $codeLocalite, $registreCommerce, $codeLangueClient)); + $telephonePortablemandataire, $emailMandataire, $dateCre, $user, $codeLocalite, $registreCommerce, + $codeLangueClient, $notificationLimiteConsommation)); return $this->dernierId(); } @@ -172,18 +175,21 @@ class Client extends Modele { public function modifier($id, $typeClient, $codeTitre, $nom, $prenoms, $adresseGeo, $boitepostale, $codeVille, $codePays, $telephoneBureau, $telephonedomicile, $telephonePortable, $fax, $email, $sexe, $dateNaissance, $codeSecteur, $codeGestionnaire, $nomMandataire, $telephoneFixemandataire, - $telephonePortablemandataire, $emailMandataire, $codeLocalite, $registreCommerce, $codeLangueClient) + $telephonePortablemandataire, $emailMandataire, $codeLocalite, $registreCommerce, + $codeLangueClient, $notificationLimiteConsommation) { $sql = 'UPDATE clients SET typeClient=?, codeTitre=?, nom=?, prenoms=?, adresseGeo=?, boitepostale=?, codeVille=?, codePays=?, telephoneBureau=?, telephonedomicile=?, telephonePortable=?, fax=?, email=?, sexe=?, dateNaissance=?, codeSecteur=?, codeGestionnaire=?, nomMandataire=?, telephoneFixemandataire=?, - telephonePortablemandataire=?, emailMandataire=?, codeLocalite=? , registreCommerce=? , codeLangueClient=? + telephonePortablemandataire=?, emailMandataire=?, codeLocalite=? , registreCommerce=? , + codeLangueClient=? , notificationLimiteConsommation=? where (id=?)'; $this->executerRequete($sql, array($typeClient, $codeTitre, $nom, $prenoms, $adresseGeo, $boitepostale, $codeVille, $codePays, $telephoneBureau, $telephonedomicile, $telephonePortable, $fax, $email, $sexe, $dateNaissance, $codeSecteur, $codeGestionnaire, $nomMandataire, $telephoneFixemandataire, - $telephonePortablemandataire, $emailMandataire, $codeLocalite, $registreCommerce, $codeLangueClient, $id)); + $telephonePortablemandataire, $emailMandataire, $codeLocalite, $registreCommerce, + $codeLangueClient, $notificationLimiteConsommation, $id)); } public function supprimer($idClient) { diff --git a/Vue/Creerclient/index.php b/Vue/Creerclient/index.php index 12f8a088..98f4ba2d 100644 --- a/Vue/Creerclient/index.php +++ b/Vue/Creerclient/index.php @@ -35,6 +35,14 @@ + + + + + +