Example #1
0
 public function loadADiscussion($id_topic, $id_discussion)
 {
     if (!empty($_POST)) {
         if (isset($_POST['PostMessage'])) {
             $verification = new Verification($_POST);
             $verification->notEmpty('titre', "Veuillez donner un titre à votre message.");
             $verification->notEmpty('reponse', "Vous ne pouvez poster un message vide.");
             $error .= $verification->error;
             if ($verification->isValid()) {
                 $this->forum->postMessage($id_topic, $id_discussion);
                 $succes = "Message posté!";
             }
         }
         if (isset($_POST['Modify'])) {
             $modification = 1;
             $id_modif = $_POST['id'];
             $titre_modif = $_POST['titre'];
             $reponse_modif = $_POST['reponse'];
         }
         if (isset($_POST['ModifyMessage'])) {
             $verification = new Verification($_POST);
             $verification->notEmpty('titre', "Veuillez donner un titre à votre message.");
             $verification->notEmpty('reponse', "Vous ne pouvez poster un message vide.");
             $error .= $verification->error;
             $id_publication = $_POST['id_message'];
             if ($verification->isValid()) {
                 $this->forum->UpdateMessage($id_topic, $id_discussion, $id_publication);
                 $succes = "Message modifié!";
             }
         }
         if (isset($_POST['Delete'])) {
             $this->forum->deleteMessage($id_topic, $id_discussion);
             $succes = "Message effacé avec succès!";
         }
     }
     $views = $this->forum->AddView($id_topic, $id_discussion);
     //compteur +1
     $topic = $this->forum->getTopic($id_topic)->fetch();
     $discussion = $this->forum->getDiscussion($id_topic, $id_discussion)->fetch();
     $messages = $this->forum->getMessages($id_topic, $id_discussion)->fetchAll();
     $nbTotalMessageUsers = $this->forum->countAllMessage();
     $pseudouser = $this->user->getPseudoAndId();
     $vue = new Vue("Discussion", "Forum", ['stylesheet.css']);
     $vue->loadpage(['discussion' => $discussion, 'topic' => $topic, 'modification' => $modification, 'messages' => $messages, 'nbTotalMessageUsers' => $nbTotalMessageUsers, 'error' => $error, 'succes' => $succes, 'id_modif' => $id_modif, 'titre_modif' => $titre_modif, 'reponse_modif' => $reponse_modif, 'pseudouser' => $pseudouser]);
 }
 public function loadMessagePrive()
 {
     $error = '';
     $succes = '';
     if (!empty($_POST)) {
         $verification = new Verification($_POST);
         $verification->notEmpty('destinataire', "Précisez pour qui ce message est destiné.");
         $verification->notEmpty('objet', "Veuillez compléter le champ objet.");
         $verification->notEmpty('message', "Précisez votre message.");
         $error = $verification->error;
         if ($verification->isValid()) {
             //} && $verificationPhoto->isValid()){
             $donneesuser = $this->user->getDataUser($_POST['destinataire'])->fetch();
             $_POST['destinataire'] = $donneesuser['id'];
             $this->accueil->sendMessage();
             $succes = 'Message envoyé avec succès!';
         }
     }
     $vue = new Vue("MessagePrive", "Accueil", ['stylesheet.css'], ['RechercheUser.js']);
     $vue->loadpage(['error' => $error, 'succes' => $succes]);
 }
Example #3
0
 public function LoadAUser($pseudo_user)
 {
     //Profil des autres
     $pseudouser = str_replace(' ', '-', $pseudo_user);
     $dataUser = $this->user->getDataUser($pseudo_user)->fetch();
     $groupUser = $this->user->getDataGroupeAUser($pseudo_user);
     $ville = $this->groupe->getVilleById($dataUser['id_ville'])->fetch();
     $nomville = $ville['name'];
     $array = [];
     foreach ($groupUser as $key => $value) {
         if ($value['public'] == 1) {
             array_push($array, 'Groupes/Profil/' . str_replace(' ', '-', $value['nom_groupe']) . '.jpg');
         }
     }
     $vue = new Vue("ProfilUnUtilisateur", "User", ['stylesheet.css']);
     // dans le fichier view/User, chercher Vue"Inscription", et load la page css stylesheet.css .
     $vue->loadpage(['dataUser' => $dataUser, 'groupUser' => $groupUser, 'pseudouser' => $pseudouser, 'array' => $array, 'nomville' => $nomville]);
 }
 public function loadClub($id_club)
 {
     $dataclub = $this->groupe->getClub($id_club)->fetch();
     $ville = $this->groupe->getVilleById($dataclub['id_ville'])->fetch();
     $nomclub = str_replace(' ', '-', $dataclub['nom']);
     $vue = new Vue("Club", "Groupe", ['stylesheet.css']);
     $vue->loadpage(['dataclub' => $dataclub, 'ville' => $ville, 'nomclub' => $nomclub]);
 }