<?php
#########################################################################################
# Entête php pour l'affichage de Pnyx #
# Auteur : V. Blais #
# Création : 2008-03-26 #
# Modification : 2008-08-29 #
# #
# Pnyx - une application Web (PHP/MySQL) d'élections virtuelles conçue pour des élèves #
# du primaire et du secondaire, dans lequel ils sont amenés à faire des propositions #
# en ligne et voter pour leur favorite, sous la supervision d'un enseignant. #
# #
# Copyright (C) <2008 - 2009> #
# <Service national du RÉCIT de l'univers social de la Commission scolaire de la #
# Pointe-de-l'Île> #
# #
# This program is free software; you can redistribute it and/or modify it under the #
# terms of the GNU General Public License as published by the Free Software Foundation. #
# This program is distributed in the hope that it will be useful, but WITHOUT ANY #
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A #
# PARTICULAR PURPOSE. See the GNU General Public License for more details. #
# You should have received a copy of the GNU General Public License along with this #
# program as the file LICENSE.txt; if not, please see #
# http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt. #
# #
# Service national du RÉCIT de l'univers social #
# http://www.recitus.qc.ca #
# Contact e-mail : steve-hide@address.com #
#########################################################################################
#aller chercher les fichiers php nécessaires
if(!file_exists("lib/constantes.php")){
header("Location: install.php");
}
else{
require "lib/constantes.php";
}
require "lib/fonctions.php";
# démarrer la session
session_name("pnyx");
@session_start();
# connection à la base de données
bd_connexion();
# vérification de la session et de l'utilisateur
verifier_session();
# initialisation des variables nécessaires
if(isset($HTTP_SESSION_VARS['SESSION']['periode'])){
$periode = $HTTP_SESSION_VARS['SESSION']['periode'];
}
else{
$periode = "";
}
$niveau = $HTTP_SESSION_VARS['SESSION']['niveau'];
if(isset($HTTP_SESSION_VARS['SESSION']['projet'])){
$projet = $HTTP_SESSION_VARS['SESSION']['projet'];
}
else{
$projet = 0;
}
if(isset($HTTP_SESSION_VARS['SESSION']['projet_admin'])){
$projet_admin = $HTTP_SESSION_VARS['SESSION']['projet_admin'];
}
else{
$projet_admin = "";
}
if(isset($_GET['onglet'])){
$onglet = $_GET['onglet'];
}
else{
$onglet = $HTTP_SESSION_VARS['SESSION']['onglet'];
}
$date = date("Y-m-d");
$HTTP_SESSION_VARS['SESSION']['onglet'] = 0;
if($niveau == "resp"){
$usager = $HTTP_SESSION_VARS['SESSION']['usager_id'];
if(isset($HTTP_SESSION_VARS['SESSION']['nom_complet'])){
$nom_resp = $HTTP_SESSION_VARS['SESSION']['nom_complet'];
}
else{
$nom_resp = "";
}
} else if ($niveau == "eleve"){
$usager = $HTTP_SESSION_VARS['SESSION']['usager_id'];
if(isset($HTTP_SESSION_VARS['SESSION']['nom_complet'])){
$nom_eleve = $HTTP_SESSION_VARS['SESSION']['nom_complet'];
}
else{
$nom_eleve = "";
}
}
?>