Esempio n. 1
0
 public function topic($topic)
 {
     $discussions = $this->forum->getDiscussions($topic)->fetchAll();
     $topicName = $this->forum->getTopicName($topic);
     $vue = new Vue("Topic", "Forum");
     $vue->setTitle('Topic');
     $vue->render(['topicName' => $topicName, 'discussions' => $discussions, 'topic' => $topic]);
 }
Esempio n. 2
0
 public function accueil_logged()
 {
     $head_infos = $this->group->getNextEventsForUser();
     $sel_group = $this->group->selectionGroup($_SESSION['auth']->id)->fetchAll();
     $near_group = $this->group->nearGroup()->fetchAll();
     $types_sports = $this->sport->getSportList();
     $vue = new Vue("AccueilInscrit", "Accueil");
     $vue->setTitle('Accueil');
     $vue->render(['today_group' => $head_infos[0], 'tmw_group' => $head_infos[1], 'fy_group' => $sel_group, 'ny_group' => $near_group, 'types_sports' => $types_sports]);
 }
Esempio n. 3
0
 public function creation()
 {
     $ListeSports = $this->sport->getSportsSortedByType();
     $ListeClub = $this->group->listClub();
     $vue = new Vue("GroupeCreation", "Groupe");
     if (!empty($_POST)) {
         //Router::debug($_POST);
         $validate = new Validate($_POST);
         // TODO: Il faut ajouter celui qui crée le groupe au groupe et le mettre en leader,
         // envoyer des invitations par mail aux personnes invitées.
         $validate->notEmpty('name_grp', "Veuiller rentrer un nom de groupe");
         $validate->notEmpty('membre', "Ne restez pas seul, ajoutez des amis !");
         $validate->notEmpty('sport', "Vous n'avez pas ajouté de sport à votre groupe");
         $validate->isVille('lieu', "Votre localisation n'est pas valide");
         $validate->notEmpty('nbr_membre', "Selectionner le nombre maximum de membres dans votre groupe");
         $validate->notEmpty('description_grp', "Ajoutez une description à votre groupe");
         if ($validate->isValid()) {
             $id = $this->group->creerGroupe($_POST);
             Router::redirect("groupe", ['id' => $id]);
         } else {
             $vue->render(['errors' => $validate->errors, 'ListeSports' => $ListeSports, 'ListeClub' => $ListeClub]);
         }
     } else {
         $vue->setScript('list.js');
         $vue->setTitle('Créer un groupe');
         $vue->render(['ListeSports' => $ListeSports, 'ListeClub' => $ListeClub]);
     }
 }
Esempio n. 4
0
 public function club($id)
 {
     $vue = new Vue("Club", "Sport");
     $vue->setTitle('Club');
     $vue->render(['id' => $id]);
 }