Ejemplo n.º 1
0
 public function inscription_3()
 {
     if (isset($_SESSION['user'])) {
         $this->redirectToRoute('accueil');
         // si ok envoie page 2
     }
     if (isset($_POST['valider'])) {
         $_SESSION['reseaux_socialInsc'] = $_POST['reseaux_social'];
         $_SESSION['reseaux_proInsc'] = $_POST['reseaux_pro'];
         $_SESSION['reseaux_divertissementInsc'] = $_POST['reseaux_divertissement'];
         //nettoyage des espace en debut et fin de chaine de caractére
         $_SESSION['wuserInsc'] = array_map('trim', $_SESSION['wuserInsc']);
         $_SESSION['diplomeInsc'] = array_map('trim', $_SESSION['diplomeInsc']);
         $_SESSION['experience_proInsc'] = array_map('trim', $_SESSION['experience_proInsc']);
         $_SESSION['fil_actuInsc'] = array_map('trim', $_SESSION['fil_actuInsc']);
         $_SESSION['portfolioInsc'] = array_map('trim', $_SESSION['portfolioInsc']);
         $_SESSION['reseaux_socialInsc'] = array_map('trim', $_SESSION['reseaux_socialInsc']);
         $_SESSION['reseaux_proInsc'] = array_map('trim', $_SESSION['reseaux_proInsc']);
         $_SESSION['reseaux_divertissementInsc'] = array_map('trim', $_SESSION['reseaux_divertissementInsc']);
         // ajout d'un $key => $value (ex :role => membre)
         $_SESSION['wuserInsc']['role'] = 'membre';
         $_SESSION['wuserInsc']['validation_inscription'] = 'false';
         $manager = new UserManager();
         // insert formulaire 1
         $manager->insert($_SESSION['wuserInsc'], $stripTags = true);
         //enregistrement membre dans BDD
         $mail = $_SESSION['wuserInsc']['mail'];
         // recuperation du mail dans une variable
         //suite insert formulaire 1
         $manager = new GeneralManager();
         $membre = $manager->findMail($mail);
         //recuperation du membre dans la table wusers via le mail
         $id = $membre['id'];
         // insert page formulaire 2
         $_SESSION['diplomeInsc']['id_wuser'] = $id;
         // ajout d'une $key id_wuser dans la SESSION['diplome']
         $manager = new DiplomeManager();
         //selection de la table Diplome
         $manager->insert($_SESSION['diplomeInsc'], $stripTags = true);
         $_SESSION['experience_proInsc']['id_wuser'] = $id;
         // ajout d'une $key id_wuser dans la SESSION['experience_pro']
         $manager = new Experience_proManager();
         //selection de la table experience_pros
         $manager->insert($_SESSION['experience_proInsc'], $stripTags = true);
         $_SESSION['competenceInsc']['id_wuser'] = $id;
         // ajout d'une $key id_wuser dans la SESSION['competence']
         $manager = new CompetenceManager();
         //selection de la table competences
         $manager->insert($_SESSION['competenceInsc'], $stripTags = true);
         $_SESSION['fil_actuInsc']['id_wuser'] = $id;
         // ajout d'une $key id_wuser dans la SESSION['fil_actu']
         $manager = new Fil_actuManager();
         //selection de la table fil_actus
         $manager->insert($_SESSION['fil_actuInsc'], $stripTags = true);
         $_SESSION['portfolioInsc']['id_wuser'] = $id;
         // ajout d'une $key id_wuser dans la SESSION['portfolio']
         $manager = new PortfolioManager();
         //selection de la table portfolios
         $manager->insert($_SESSION['portfolioInsc'], $stripTags = true);
         // insert page formulaire 3
         $_SESSION['reseaux_socialInsc']['id_wuser'] = $id;
         // ajout d'une $key id_wuser dans la SESSION['reseaux_social']
         $manager = new Reseaux_socialManager();
         //selection de la table reseaux_socials
         $manager->insert($_SESSION['reseaux_socialInsc'], $stripTags = true);
         $_SESSION['reseaux_proInsc']['id_wuser'] = $id;
         // ajout d'une $key id_wuser dans la SESSION['reseaux_pro']
         $manager = new Reseaux_proManager();
         //selection de la table reseaux_pros
         $manager->insert($_SESSION['reseaux_proInsc'], $stripTags = true);
         $_SESSION['reseaux_divertissementInsc']['id_wuser'] = $id;
         // ajout d'une $key id_wuser dans la SESSION['reseaux_divertissement']
         $manager = new Reseaux_divertissementManager();
         //selection de la table reseaux_divertissements
         $manager->insert($_SESSION['reseaux_divertissementInsc'], $stripTags = true);
         Helper::mail("*****@*****.**", "Une demande d'inscritption à été effectué sur LOTL", "Veuillez valider ou non l'inscritpion.");
         // l'envoi de mail vers la BAL de l'admin pour toute nouvelle demande d'inscription sur le site
         //destruction des SESSION INSCRIPTION
         $manager = new GeneralManager();
         $manager->logInscrOut();
         $this->redirectToRoute('validation');
     } elseif (isset($_POST['precedent2'])) {
         $_SESSION['inscription_3'] = $_POST['inscription_3'];
         $this->redirectToRoute('inscription2');
         // si précédent retour page 2
     }
     $this->show('inscription/inscription3');
 }