<?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/eleve.inc.php");
include("../include/util.inc.php");
include("../include/utiljs.php");
$statut=$_REQUEST['statut'];
opensession($statut);
connecte($host,$user,$mdp,$db);

?>
<!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>
<?php



switch ($statut) {
       case "Prof":
           echo "<BODY class='arialprof'>";
           break;
       case "Admin":
           echo "<BODY class='arialadmin'>";
           break;
       case "Gest":
           echo "<BODY class='arialgest'>";
           break;
   }


if ((!isset($item_id)) || (!isset($message_id))) exit();


//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 ".
                  "WHERE message_id=$message_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 base 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["base"]."</p>";

print "<p><b>Commentaire fourni : </b>$dcomment</p>";

/*
print "<p><b><i><font color='red'>";
switch ($typeres) {
    case "a"  : // item acquis
         print "Tu as acquis cet item";
         break;
    case "on" : // item avec des oui et des non
         print "Le bilan des réponses des professeurs ne permet pas encore de t'accorder l'item";
         break;
    case "ec" : // item demandé mais sans réponse
         print "Pas encore de réponse des professeurs";
         break;
}
print "</font></i></b></p>";
  */
affrepmessage($message_id, true);
?>
<p>
<a href="javascript:window.history.back()">Retour</a>
</p>
</body>
</html>
