public function deleteProfil($id)
 {
     $this->allowTo('admin');
     $user_manager = new UserManager();
     $user = $user_manager->find($id);
     // recuperation du profil a supprimer
     $id_wuser = $user['id'];
     //debug($user);debug($id_wuser);die();
     $manager = new CompetenceManager();
     $manager->delete($id_wuser);
     $manager = new DiplomeManager();
     $manager->delete($id_wuser);
     $manager = new Experience_proManager();
     $manager->delete($id_wuser);
     $manager = new Fil_actuManager();
     $manager->delete($id_wuser);
     $manager = new PortfolioManager();
     $manager->delete($id_wuser);
     $manager = new Reseaux_socialManager();
     $manager->delete($id_wuser);
     $manager = new Reseaux_proManager();
     $manager->delete($id_wuser);
     $manager = new Reseaux_divertissementManager();
     $manager->delete($id_wuser);
     $manager = new UserManager();
     $manager->delete($id);
     //reflexion sur l'envoi de mail lors d'une validation d'un mail
     //Helper::mail($mail, "Votre inscription n'a  pas été validée sur LOTL", "Vous ne remplissez pas les conditions pour vous inscrire sur LOTL, vous pouvez toujours suivre notre communauté sur www.jesuistondev.fr");
     $this->redirectToRoute('administration');
 }
 public function postActu()
 {
     if (isset($_POST['actu'])) {
         $date = date("Y-m-d H:i:s");
         //debug($date);die();
         $manager = new Fil_actuManager();
         $manager->update(['message' => $_POST['texte_actu'], 'date' => $date], $_SESSION['user']['id'], $stripTags = true);
         $this->redirectToRoute('accueil');
     }
     $this->redirectToRoute('accueil');
 }
 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');
 }
 public function modif_profil3()
 {
     if (!isset($_SESSION['user'])) {
         $this->redirectToRoute('home');
         // si ok envoie page 2
     }
     if (isset($_POST['valider'])) {
         $_SESSION['reseaux_social'] = $_POST['reseaux_social'];
         $_SESSION['reseaux_pro'] = $_POST['reseaux_pro'];
         $_SESSION['reseaux_divertissement'] = $_POST['reseaux_divertissement'];
         //debug($_SESSION['updateUser']);debug($_SESSION['portfolio']);debug($_SESSION['reseaux_pro']);die();
         //nettoyage des espace en debut et fin de chaine de caractére
         $_SESSION['updateUser'] = array_map('trim', $_SESSION['updateUser']);
         $_SESSION['diplome'] = array_map('trim', $_SESSION['diplome']);
         $_SESSION['experience_pro'] = array_map('trim', $_SESSION['experience_pro']);
         $_SESSION['fil_actu'] = array_map('trim', $_SESSION['fil_actu']);
         $_SESSION['portfolio'] = array_map('trim', $_SESSION['portfolio']);
         $_SESSION['reseaux_social'] = array_map('trim', $_SESSION['reseaux_social']);
         $_SESSION['reseaux_pro'] = array_map('trim', $_SESSION['reseaux_pro']);
         $_SESSION['reseaux_divertissement'] = array_map('trim', $_SESSION['reseaux_divertissement']);
         //recuperation de l'id du profil
         $manager = new UserManager();
         $mail = $_SESSION['updateUser']['mail'];
         // recuperation du mail dans une variable
         $membre = $manager->findMail($mail);
         //recuperation du membre dans la table wusers via le mail
         $id = $membre['id'];
         //debug($membre);debug($id);die();
         // update formulaire 1
         $manager->update($_SESSION['updateUser'], $id, $stripTags = true);
         //enregistrement membre dans BDD
         // update page formulaire 2
         //debug($_SESSION['diplome']);die();
         $manager = new DiplomeManager();
         //selection de la table Diplome
         $manager->update($_SESSION['diplome'], $id, $stripTags = true);
         $manager = new Experience_proManager();
         //selection de la table experience_pros
         $manager->update($_SESSION['experience_pro'], $id, $stripTags = true);
         $manager = new CompetenceManager();
         //selection de la table competences
         $manager->update($_SESSION['competence'], $id, $stripTags = true);
         $manager = new Fil_actuManager();
         //selection de la table fil_actus
         $manager->update($_SESSION['fil_actu'], $id, $stripTags = true);
         $manager = new PortfolioManager();
         //selection de la table portfolios
         $manager->update($_SESSION['portfolio'], $id, $stripTags = true);
         // update page formulaire 3
         $manager = new Reseaux_socialManager();
         //selection de la table reseaux_socials
         $manager->update($_SESSION['reseaux_social'], $id, $stripTags = true);
         $manager = new Reseaux_proManager();
         //selection de la table reseaux_pros
         $manager->update($_SESSION['reseaux_pro'], $id, $stripTags = true);
         $manager = new Reseaux_divertissementManager();
         //selection de la table reseaux_divertissements
         $manager->update($_SESSION['reseaux_divertissement'], $id, $stripTags = true);
         $this->redirectToRoute('accueil');
     } elseif (isset($_POST['precedent2'])) {
         $_SESSION['inscription_3'] = $_POST['modif_profil3'];
         $this->redirectToRoute('modif_profil2');
         // si précédent retour page 2
     }
     $this->show('modif_profil/modif_profil3');
 }