Example #1
0
?>
    <title><?php 
echo $this->page;
?>
 - Dynamo</title>
  </head>
  <body>
    <?php 
$this->showInstant();
?>
    <?php 
require_once 'assets/images/icons.svg';
?>
    <?php 
// affiche le header de l'utilisateur connecté
if (Router::isLoggedIn()) {
    require 'view/template/header-priv.php';
} else {
    require 'view/template/header.php';
}
?>
    <?php 
require $this->fichier;
?>
    <?php 
$this->loadScript($this->script);
?>
    <?php 
require 'view/template/footer.php';
?>
    <script src="/assets/js/ajaxsearch.js" charset="utf-8"></script>
Example #2
0
 public function routerRequete()
 {
     try {
         switch ($this->page) {
             // Accueil
             case 'accueil':
                 if (Router::isLoggedIn()) {
                     $this->ctr['Accueil']->accueil_logged();
                 } else {
                     $this->ctr['Accueil']->accueil();
                 }
                 break;
             case 'recherche':
                 $this->ctr['Accueil']->recherche();
                 break;
             case 'search-ajax':
                 $this->ctr['Accueil']->ajaxSearch();
                 break;
             case 'langue':
                 $this->ctr['Accueil']->langue();
                 break;
             case 'aide':
                 $this->ctr['Accueil']->aide();
                 break;
                 // Forum
             // Forum
             case 'forum':
                 $this->ctr['Forum']->forum();
                 break;
             case 'forumDiscussion':
                 $this->ctr['Forum']->forumDiscussion($this->params['id']);
                 break;
             case 'forumNewDiscussion':
                 if (Router::isLoggedIn()) {
                     $this->ctr['Forum']->forumNewDiscussion($this->params['id']);
                 } else {
                     $this->redirect();
                 }
                 break;
             case 'topic':
                 $this->ctr['Forum']->Topic($this->params['id']);
                 break;
                 // Groupe
             // Groupe
             case 'liste-groupe':
                 if (Router::isLoggedIn()) {
                     $this->ctr['Group']->liste();
                 } else {
                     $this->redirect();
                 }
                 break;
             case 'creation-groupe':
                 if (Router::isLoggedIn()) {
                     $this->ctr['Group']->creation();
                 } else {
                     $this->redirect();
                 }
                 break;
             case 'groupe':
                 if (Router::isLoggedIn()) {
                     $this->ctr['Group']->modificationEnTete($this->params['id']);
                     $this->ctr['Group']->informations($this->params['id']);
                 } else {
                     $this->redirect();
                 }
                 break;
             case 'discussion-groupe':
                 if (Router::isLoggedIn()) {
                     $this->ctr['Group']->discussion($this->params['id']);
                 } else {
                     $this->redirect();
                 }
                 break;
             case 'groupe-message':
                 if (Router::isLoggedIn()) {
                     $this->ctr['Group']->message($this->params);
                 } else {
                     $this->redirect();
                 }
                 break;
             case 'membres-groupe':
                 if (Router::isLoggedIn()) {
                     $this->ctr['Group']->membres($this->params['id']);
                 } else {
                     $this->redirect();
                 }
                 break;
             case 'planning-groupe':
                 if (Router::isLoggedIn()) {
                     $this->ctr['Group']->planning($this->params['id']);
                 } else {
                     $this->redirect();
                 }
                 break;
             case 'reglage-groupe':
                 if (Router::isLoggedIn()) {
                     $this->ctr['Group']->reglage($this->params['id']);
                 } else {
                     Router::redirect();
                 }
                 break;
                 // Sport
             // Sport
             case 'SportClub':
                 $this->ctr['Sport']->SportClub($this->params['id']);
                 break;
             case 'SportGroupe':
                 $this->ctr['Sport']->SportGroupe($this->params['id']);
                 break;
             case 'typeSport':
                 $this->ctr['Sport']->TypeSport($this->params['id']);
                 break;
                 // Club
             // Club
             case 'club':
                 $this->ctr['Sport']->club($this->params['id']);
                 break;
                 // Profile
             // Profile
             case 'profile':
                 if (Router::isLoggedIn()) {
                     $this->ctr['User']->profile();
                 } else {
                     Router::redirect();
                 }
                 break;
             case 'profile-planning':
                 if (Router::isLoggedIn()) {
                     $this->ctr['User']->profilePlanning();
                 } else {
                     Router::redirect();
                 }
                 break;
             case 'profile-reglage':
                 if (Router::isLoggedIn()) {
                     $this->ctr['User']->profileReglage();
                 } else {
                     Router::redirect();
                 }
                 break;
                 // Inscription
             // Inscription
             case 'inscription':
                 $this->ctr['User']->inscription();
                 break;
             case 'inscription-verif':
                 $this->ctr['User']->verifinscription($this->params['token']);
                 break;
                 // Login
             // Login
             case 'login':
                 $this->ctr['User']->login();
                 break;
             case 'forgot':
                 $this->ctr['User']->forgot();
                 break;
             case 'forgot-verif':
                 $this->ctr['User']->resetPwd($this->params['token']);
                 break;
             case 'logout':
                 $this->ctr['User']->logout();
                 break;
             case 'backoffice-user':
                 if (Router::isAdmin()) {
                     $this->ctr['Backoffice']->user();
                 } else {
                     Router::redirect();
                 }
                 break;
             case 'backoffice-group':
                 if (Router::isAdmin()) {
                     $this->ctr['Backoffice']->group();
                 } else {
                     Router::redirect();
                 }
                 break;
             case 'backoffice-sport':
                 if (Router::isAdmin()) {
                     $this->ctr['Backoffice']->sport();
                 } else {
                     Router::redirect();
                 }
                 break;
             case 'backoffice-forum':
                 if (Router::isAdmin()) {
                     $this->ctr['Backoffice']->forum();
                 } else {
                     Router::redirect();
                 }
                 break;
             case 'backoffice-help':
                 if (Router::isAdmin()) {
                     $this->ctr['Backoffice']->help();
                 } else {
                     Router::redirect();
                 }
                 break;
             default:
                 throw new Exception("Page non valide");
                 break;
         }
     } catch (PDOException $e) {
         Router::erreur($e->getMessage());
     } catch (Exception $e) {
         Router::erreur($e->getMessage());
     }
 }