<?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/utiljs.php");
opensession("Prof");
print "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">\n";
?>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
<title>Bandeau B2I prof</title>
<?php

//Jak  :  Recup des langues au moins pour le prof ?
if (empty($sess_tabcodelang)) {
      //récupérer les disciplines une fois pour toutes pour éviter les requêtes
      $res3=query("SELECT libelle,code_langue FROM disciplines ORDER BY disc_id");
      for ($i=1; list($sess_tablang[$i],$sess_tabcodelang[$i])=mysql_fetch_array($res3) ; $i++);
      session_puts('sess_tablang','sess_tabcodelang');
                         }
print "<link rel=\"stylesheet\" href=\"../themes/".$etab_theme."/b2i.css\">\n";
print "<script language='javascript'>\n";
print "function ouvrirfenetre(adr) { ";
print "//nouvelle fenêtre\n";
print "wliste=open(adr,'','dependent,top=100,left=300,height=250,width=450,resizable');";
print "}\n";
print "</script>\n";
print "    </head>\n";
print "    <body class=\"prof_header\">\n";


//définition des variables pour le tableau
//Dénomination EXCEL A1 A2 A3 B1 B2 B3 C1 C2 C3
$A1=date("d/m/Y")."&nbsp;<br><b>".$etab_nom."</b>";
$A2=$sess_civil." ".$sess_prenom." ".$sess_nom;
if ($disc_id>0) $A22="(".$sess_tablang[$disc_id].")"; else $A22="";

if (@$etab_pas_aide_prof==0) {
if (isset($etab_URL_aide_prof) AND ($etab_URL_aide_prof!="")) 
	 $A3="<a href=\"".$etab_URL_aide_prof."\" target=\"_blank\"><img src=\"../themes/".$etab_theme."/aide.gif\" Title=\"aide\" alt=\"aide\" border =\"0\"></a>";
elseif (isset($URL_AIDE_PROF) AND ($URL_AIDE_PROF!=""))
	$A3="<a href=\"".$URL_AIDE_PROF."\" target=\"_blank\"><img src=\"../themes/".$etab_theme."/aide.gif\" Title=\"aide\" alt=\"aide\" border =\"0\"></a>";
else  $A3="<img src=\"../themes/".$etab_theme."/aide.gif\"  border =\"0\">";
}
$sep = '&nbsp;';
// chgt de theme
if ($etab_chgt_theme==1) $A3.=$sep."<a href=\"javascript:ouvrirfenetre('../outils/choisir_theme.php?statut=Prof')\"><img src=\"../themes/".$etab_theme."/chgt_theme.gif\" Title=\"Changer le thème\" Alt=\"Changer le thème\"></a>";
/*************** Partie modifiée par Béa *****************************/

if ($sess_statut_prof & 2) { //admin-adjoint
    $c = base64_encode(serialize(array('d' => 1, 's' => 0)));
    $A3.= "$sep<a href=\"muer.php?c=$c\" target=\"_top\" class=\"muer\"><img src=\"../themes/".$etab_theme."/vers_admin.gif\" Title=\"Mode Admin-adjoint\" alt=\"Admin-adjoint\" border =\"0\"></a>";
}

if ($sess_statut_prof & 4) { //gestionnaire-adjoint
    $c = base64_encode(serialize(array('d' => 2, 's' => 0)));
    $A3.= $sep."<a href=\"muer.php?c=$c\" target=\"_top\" class=\"muer\"><img src=\"../themes/".$etab_theme."/vers_gestion.gif\" Title=\"Mode Gestionnaire-adjoint\" alt=\"Gest-adjoint\" border =\"0\"></a>";
}

/*************** Fin de partie modifiée par Béa *****************************/

$B1="../themes/".$etab_theme."/b2i_prof.gif";
$C1=oldsession();
$C2="";
$C3="";
?>
<table border="0" width="100%" align="center">
<!--   ligne 1  -->
   <tr class="titre_prof"  valign="top" height="60" >
        <td width='25%'>
            <span class="titre_prof_header"><?php echo $A1; ?></span>
        </td>
        <td rowspan="3" valign="top">
            <p style="text-align:center;">
            <a href="prof_ut.php" target=_top title="Retour accueil prof ALT + M" accesskey="M">
               <img src="<?php echo $B1; ?>" border="0" >
            </a></p>
        </td>
        <td >
            <?php print $C1 ?>
        </td>
    </tr>
<!--   ligne 2  -->
    <tr class="titre_prof" height="45" valign="top">
        <td ><strong><?php echo $A2; ?></strong><br><?php echo $A22;?>
        </td>
        <td style="text-align:right;">
               <?php
               if (($etab_typauth_id==3)and ($entree_SSO==1)) boutonlogin("$CAS_RETOUR");
               else boutonlogin("../login/login.php");
               ?>
        </td>
    </tr>
<!--   ligne 3  affichage barre d'outils prof-->
    <tr class="titre_prof" VALIGN="top" height="45">
        <td ><?php echo $A3;?>
        </td>
        <td >
            <p style="text-align:right;">
            <?php
            // outil dévalidation
            $outil="<a href=\"devalidation.php\" target=\"bas\" accesskey=\"E\"><img src='../themes/".$etab_theme."/devalid.gif' border=0 title =\"Annuler un accord donné récemment ALT + E\" alt=\"Annuler un accord donné récemment\"></a>";
            echo $outil;
            // outil gestion sa fiche prof
            if ($etab_fiche_profs==1) { //id=-1 signifie le prof lui-même (système anti-piratage)
            $outil="&nbsp;<a href=\"../admin/profs_form.php?id=-1&statut=Prof\" target=\"bas\" accesskey='O'><img src=\"../themes/".$etab_theme."/tools.gif\" border=\"0\" title =\"Options prof ALT + O\" alt=\"Options prof\"></a>";
            }   else $outil="";
            echo $outil;
            // outil gestion des groupes : pour tous mais le prof-admin peut en plus (suivant option génér) y créer et supprimer des groupes...
            if ($sess_statut_prof >0) {
            $outil="&nbsp;<a href='../outils/liste_classes.php?&statut=Prof' target=\"bas\" accesskey='G'><img src='../themes/".$etab_theme."/group.gif' border=0 title ='Gestion des groupes ALT + G' alt='Gestion des groupes'></a>";
            echo $outil;
            }
            //outil état avancement des classes
            if ($etab_stats_profs==1) {
            $outil="&nbsp;<a href='../gestion/result_classes_gest.php?id=".$sess_mec_id."&statut=Prof' target=\"bas\" accesskey='A'><img src='../themes/".$etab_theme."/stats.gif' border=0 title ='Avancement classes ALT + A' alt='Avancement classes'></a>";
            }   else $outil="";
            echo $outil;
            ///outil validation partielle sans demande
            if (($etab_valid_profs==1) && ($sess_statut_prof >0)) {
            $outil="&nbsp;<a href='choix_item.php?id=".$sess_mec_id."&statut=Prof' target=\"bas\" accesskey='V'><img src='../themes/".$etab_theme."/magie.gif' border=0 title ='Validation partielle sans demande ALT + V'alt='Validation partielle sans demande'accesskey='V'></a>";
            }   else $outil="";
            echo $outil;
            // outil accès aux résultats par élève.
            if (($etab_result_profs==1) && ($sess_statut_prof >0)) { //prof admin
            $outil="&nbsp;<a href='../gestion/gest_etats_eleves.php?statut=Prof&id=".$sess_mec_id."' target=\"bas\" accesskey='R'><img src='../themes/".$etab_theme."/result.gif' border=0 title='Résultats par élève ALT + R' alt='Résultats par élève'></a>";
            }   else $outil="";
            echo $outil; ?>

            </p>
        </td>
    </tr>
</table>

</body>

</html>