<?php
#=
/****************************************************************************
Copyright 2002, Daniel Deycard, Jacques Messines, Alain Pomirol
(CATICE Académie de Bordeaux)

This file is part of Gibii.

Gibii 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; either version 2 of the License, or
(at your option) any later version.

Gibii 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 Gibii; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA

****************************************************************************/
include("../include/vars_adm.php");
include("../include/util.inc.php");
include("../include/eleve.inc.php");
$statut=$_REQUEST['statut'];
opensession($statut,false);

?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
       <title>Recherche des réponses des profs</title>
       <link rel="stylesheet" href="<?php echo "../themes/".$etab_theme."/b2i.css" ?>">
</head>
<body>
<?php


if ((!isset($item_id)) || (!isset($typeres))) exit();
$link=connecte($host,$user,$mdp,$db);

//Récupération des infos
//----------------------
//récupération de la demande pour le message introductif
$resdemande=query("SELECT quand as ddate, commentaire as dcomment ".
               "FROM demandes d ".
               "WHERE eleve_id=$eleve_id AND item_id=$item_id;");
$rowdemande=mysql_fetch_array($resdemande);
$ddate=$rowdemande["ddate"];
$dcomment=$rowdemande["dcomment"];

//récupération de la rubrique et de l'item concernés
$resitem=query("SELECT rub_no, s_rub_no ".
               "FROM items ".
               "WHERE item_id=$item_id;");
$rowitem=mysql_fetch_array($resitem);
$rubrique=$rowitem["rub_no"];

$resrub=query("SELECT libelle FROM rubriques WHERE rub_no=$rubrique;");
$rowrub=mysql_fetch_array($resrub);

$resitemlib=query("SELECT inst FROM libelles WHERE item_id=$item_id;");
$rowitemlib=mysql_fetch_array($resitemlib);

//Affichage préliminaire
//----------------------
print "<h3>Rubrique ".$rowitem["rub_no"].
      ", sous-rubrique ".$rowitem["s_rub_no"].
      ", item $item_id demandé le $ddate</h3><br>";
print "<h4>".$rowrub["libelle"]."</h4>";
print "<p>".$rowitemlib["inst"]."</p>";

print "<p><b><i><font color='red'>";
switch ($typeres) {
    case "a"  : // item acquis
         print "Item acquis";
         break;
    case "on" : // item avec des oui et des non
         print "Pas suffisamment de réponses positives";
         break;
    case "ec" : // item demandé mais sans réponse
         print "Pas de réponse des professeurs";
         break;
    case "ei" : // item impossible à demander : interdit
         print "Item interdit";
         break;
}
print "</font></i></b></p>";
afficherreponses($eleve_id,$item_id);
print "<p><a href='#' onclick='window.history.back;'>Retour</a></p>\n";
?>
</body>
</html>
