X-Git-Url: http://git.euphorik.ch/?p=cl7.git;a=blobdiff_plain;f=index.php;h=ebe978138028791861376ed2293c07f51a69deca;hp=363de7a6fae7f94503fd191ed9f02e20742d2da0;hb=HEAD;hpb=474845951b5f5c2ebedaffc05d5bf396c878fdc4 diff --git a/index.php b/index.php index 363de7a..ebe9781 100644 --- a/index.php +++ b/index.php @@ -1,22 +1,7 @@ 'Accueil', + 'accueil' => 'Accueil', # la page par défaut 'jeux_joues' => 'Jeux joués', 'inscription' => 'Inscription', 'inscrits' => 'Inscrits', @@ -27,7 +12,25 @@ $MENU = array( #'pizzas' => 'Pizza', ); +include_once("php/participant.php"); +include_once("php/connexion.php"); +include_once("php/config.php"); +include_once("php/controller.php"); +include_once("php/panel.php"); + +# Différents objets, sont accessibles directement par les pages (voir dossier '/php/pages/'). +$page = isset($_GET['page']) ? $_GET['page'] : 'accueil'; +$connexion = new Connexion(); +$config = new Config(); +$participant = $connexion->participant; +$controller = new Controller($participant, $config); +$panel = new Panel($participant); + +if ($controller->nouvel_inscrit) + $page = "bienvenue"; + echo ''; + ?> '; - '; - + if ($controller->message_utilisateur) + echo ''; + else if ($connexion->message_utilisateur) + echo ''; + # Des constantes stockées en BD accessible par le javascript. echo ''; echo ''; - $nbPeriodes = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM periodes")); + $nbPeriodes = pg_fetch_array(pg_query("SELECT COUNT(*) FROM periodes")); echo ''; + echo ''; ?> Corcelles-Lan 8 @@ -91,7 +98,7 @@ echo ''; '; - include("php/menu_droit.php"); + $panel->rendre(); echo ''; } @@ -104,7 +111,7 @@ echo ''; include("php/pages/jeux_joues.php"); break; case 'inscription' : - if (Participant::nombre_participant_max_atteint() && !$le_participant->valide) + if (Participant::nombre_participant_max_atteint() && !$participant->valide) echo 'Nous sommes désolés, il n\'y a plus de places libres'; else include("php/pages/inscription.php"); @@ -128,7 +135,7 @@ echo ''; include("php/pages/photos.php"); break; case 'pizzas': - include("php/pizzas.php"); + include("php/pages/pizzas.php"); break; default : echo 'erreur, page introuvable';