<?
#########################################################################################
# Impression d'une fiche élève de Pnyx #
# Auteur : V. Blais #
# Création : 2006-05-02 #
# Modification : 2008-09-10 #
# #
# 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 #
#########################################################################################
require "entete_php.php";
# ou verifier si la session est valide
# puis verifier si l'usager dispose des autorisations requises
# pour la saisie
verifier_session();
acces_eleve("ele_fiche.php");
/*$idp = $HTTP_SESSION_VARS[SESSION][projet];
$periode = $HTTP_SESSION_VARS[SESSION][periode];*/
if ($HTTP_GET_VARS['id_fiche'] != 0){
$requete_sql = "SELECT *
FROM fiche
WHERE fiche_id = '" . $_GET['id_fiche'] . "'
";
$reponse_fiche = bd_executer_sql($requete_sql);
$ligne_fiche = mysql_fetch_array($reponse_fiche);
$nb_fiche = mysql_num_rows($reponse_fiche);
}
$requete_sql = "SELECT titre
FROM site_parametres";
$reponse_titre = mysql_query($requete_sql);
$ligne_titre = mysql_fetch_array($reponse_titre);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title><?= $ligne_titre['titre'] ?></title>
<script type="text/javascript" src="lib/fonctions.js"></script>
<script src="http://www.google-analytics.com/urchin.js" type="text/javascript">
</script>
<script type="text/javascript">
_uacct = "UA-1684383-1";
urchinTracker();
</script>
</head>
<body>
<?
#if($ligne_fiche['eleve_id'] == $usager){
?>
<a name="haut" id="haut"></a>
<table width="580">
<tr>
<td>
<?
if ($HTTP_GET_VARS['id_fiche'] != 0){
?>
<h3>Impression de votre fiche</h3>
<table width="580" align="center" cellpadding="0" cellspacing="0">
<tr>
<td><p><strong>Slogan : </strong>
<?
if ($nb_fiche == 0){
echo "L'élève n'a pas défini de slogan.";
} else {
if ($ligne_fiche['slogan'] == ""){
echo "L'élève n'a pas défini de slogan.";
} else {
echo $ligne_fiche['slogan'];
}
}
?></p>
<p><strong>Pancarte électorale :</strong></p>
<?
if ($ligne_fiche['affiche'] == ""){
$affiche = "images/gen_affiche.jpg";
} else {
$affiche = $ligne_fiche['affiche'];
}
?>
<br />
<div align="center"><img src="<?= $affiche ?>" alt="affiche" /></div></td>
</tr>
<tr>
<td align="center">
<?
if($ligne_fiche['aff_source'] != ""){
?>
<strong>Source de l'image :</strong><?= $ligne_fiche['aff_source'] ?>
<?
}
?>
</td>
</tr>
<?
if ($nb_fiche == 0){
echo "<tr>
<td valign=\"top\" colspan=\"2\"><strong>Il n'y a aucune proposition.</strong><br /></td>
</tr><tr>
<td colspan=\"2\"> </td>
</tr>";
} else {
?>
<tr><td>
<p><strong><br />
Proposition : <?= $ligne_fiche['slogan']?>
</strong></p>
<blockquote>
<p><strong>Niveau :</strong> <?= $ligne_fiche['niveau']?></p>
<?
$requete_sql = "SELECT nom
FROM categorie_prop
WHERE cat_id = \"$ligne_fiche[categorie]\"
";
$reponse_catNom = mysql_query($requete_sql);
$ligne_catNom = mysql_fetch_array($reponse_catNom);
?>
<p><strong>Catégorie :</strong> <?= $ligne_catNom['nom']?></p>
<p><strong>Explication :</strong></p> <?= nl2br($ligne_fiche['proposition'])?>
<p><strong>Appréciation :</strong>
<?
if ($ligne_fiche['app_moyenne'] < 0.50){
echo "<img src='images/etoile_0.jpg' alt='0' align='middle' />";
} else if ($ligne_fiche['app_moyenne'] < 0.99){
echo "<img src='images/etoile_0_5.jpg' alt='0,5' align='middle' />";
} else if ($ligne_fiche['app_moyenne'] < 1.50){
echo "<img src='images/etoile_1.jpg' alt='1' align='middle' />";
} else if ($ligne_fiche['app_moyenne'] < 2.00){
echo "<img src='images/etoile_1_5.jpg' alt='1,5' align='middle' />";
} else if ($ligne_fiche['app_moyenne'] < 2.50){
echo "<img src='images/etoile_2.jpg' alt='2' align='middle' />";
} else if ($ligne_fiche['app_moyenne'] < 3.00){
echo "<img src='images/etoile_2_5.jpg' alt='2,5' align='middle' />";
} else if ($ligne_fiche['app_moyenne'] < 3.50){
echo "<img src='images/etoile_3.jpg' alt='3' align='middle' />";
} else if ($ligne_fiche['app_moyenne'] < 4.00){
echo "<img src='images/etoile_3_5.jpg' alt='3,5' align='middle' />";
} else if ($ligne_fiche['app_moyenne'] < 4.50){
echo "<img src='images/etoile_4.jpg' alt='4' align='middle' />";
} else if ($ligne_fiche['app_moyenne'] < 5.00){
echo "<img src='images/etoile_4_5.jpg' alt='4,5' align='middle' />";
} else {
echo "<img src='images/etoile_5.jpg' alt='5' align='middle' />";
}
?>
/
<?
if ($ligne_fiche['app_nb'] > 1){
echo " ".$ligne_fiche['app_nb']." appréciations";
} else if ($ligne_fiche['app_nb'] == 1){
echo " ".$ligne_fiche['app_nb']." appréciation";
}
?>
</p>
<?
if ($periode == "fin_vote" || periode == "vote"){
$requete_sql = "SELECT E.nb_votes FROM election E
WHERE E.projet_id = $projet
AND E.final_id = '".$ligne_loc['fiche_id']."'
";
$reponse_fin = bd_executer_sql($requete_sql);
$nb_fin = mysql_num_rows($reponse_fin);
if ($nb_fin >0){
$fin = mysql_fetch_array($reponse_fin);
?>
<p>
<strong>Nombre de votes :</strong>
<?=$fin['app_nb']?>
</p>
<?
}
}
}
?>
</blockquote></td></tr></table>
<?
}
else{
?>
<p>Vous n'êtes pas le propriétaire de cette fiche.</p>
<?
}
mysql_close();
?>
</body>
</html>