8d6c578c04703d9422b0fb1a39f95010566dc02f
[cl7.git] / index.php
1 <?php # coding: utf-8
2
3 if (!isset($page)) $page="acceuil"; #la page par défaut
4
5 /* Pour déterminer si en LAN !?
6 $IP_SERVEUR = '192.168.1.1';
7 $MASK_RESEAU = '255.255.255.0';
8 if($titre[1] && (ip2long($REMOTE_ADDR) & ip2long($MASK_RESEAU)) != (ip2long($IP_SERVEUR) & ip2long($MASK_RESEAU)))
9 */
10
11 include_once("config.php");
12 include_once("class_participant.php");
13 include_once("connexion.php");
14 include_once("controller.php");
15
16 $MENU = array(
17 'acceuil' => 'Accueil',
18 'jeux_joues' => 'Jeux joués',
19 'inscription' => 'Inscription',
20 'inscrits' => 'Inscrits',
21 'http://www.euphorik.ch/#page=&quot;minichat&quot;;conv=[1642]' => 'Chat',
22 'contacts' => 'Contacts',
23 #'mods' => 'Mods',
24 #'cracks' => 'Cracks',
25 #'pizzas' => 'Pizza',
26 );
27
28 echo '<?xml version="1.0" encoding="UTF-8"?>';
29 ?>
30
31 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
32 "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
33 <html xmlns="http://www.w3.org/1999/xhtml">
34 <head>
35 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
36 <title>Corcelles-Lan 7</title>
37 <link rel="stylesheet" href="css/style.css" type="text/css" media="screen" ></link>
38 <script type="text/javascript" src="js/jquery-1.2.6.min.js"></script>
39 <script type="text/javascript" src="js/betterjs.js"></script>
40 <script type="text/javascript" src="js/cl7.js"></script>
41 <script type="text/javascript" src="js/util.js"></script>
42 </head>
43 <body>
44 <div id="info" style="display:none" ><div id="icone"></div><div class="fermer" ></div><div class="message" ></div><div class="boutons"></div></div>
45 <div id="container">
46 <div id="cadre">
47 <div id="titre">
48 <div id="nbPlacesRestantes">
49 <?php
50 $nb_places_libres = Participant::nombre_place_restante();
51 if ($nb_places_libres <= 0)
52 {
53 echo "Il n'y a plus de places libres";
54 }
55 else
56 {
57 $s = $nb_places_libres > 1 ? 's' : '';
58 echo "Il reste <em>", $nb_places_libres, "</em> place", $s, " libre", $s;
59 }
60 ?>
61 </div>
62 Corcelles-Lan 7
63 </div>
64 <ul id="menu">
65 <?php
66 # affichage du menu
67 foreach($MENU as $p => $titre )
68 {
69 $lien_externe = substr($p, 0, 4) == 'http';
70 echo '<li' . ($p == $page ? ' class="courante"' : '') . '><a href="'.($lien_externe ? $p : $p.'.html').'" '.($lien_externe ? 'class="externe"' : '').'>' . $titre . '</a></li>';
71 }
72 ?>
73 </ul>
74 <div id="contenu">
75 <div id="informations"><?php include("menu_droit.php") ?></div>
76 <?php
77 switch ($page)
78 {
79 case 'acceuil':
80 include("tx_informations.php");
81 break;
82 case 'jeux_joues' :
83 include("tx_jeux_joues.php");
84 break;
85 case 'inscription' :
86 if (Participant::nombre_participant_max_atteint() && !$le_participant->valide)
87 echo 'Nous sommes désolés, il n\'y a plus de places libres';
88 else
89 include("tx_inscription.php");
90 break;
91 case 'inscrits' :
92 include("tx_inscrits.php");
93 break;
94 case 'tournoi' :
95 include("tx_tournoi.php");
96 break;
97 case 'intranet' :
98 include("tx_intranet.php");
99 break;
100 case 'bienvenue' :
101 include("tx_bienvenue.php");
102 break;
103 case 'contacts' :
104 include("tx_contacts.php");
105 break;
106 case 'photos' :
107 include("tx_photos.php");
108 break;
109 case 'pizzas':
110 include("pizzas.php");
111 break;
112 default :
113 echo 'erreur, page introuvable';
114 break;
115 }
116 ?>
117 </div>
118 <div id="pieddepage">
119 ~ site codé en PHP avec les pieds ~
120 </div>
121 </div>
122 </div>
123 </body>
124 </html>