<?php
#=
/****************************************************************************
Copyright 2002, Daniel Deycard, Jacques Messines, Stéphanie Roussel, Jean-Marie Treins
(CATICE Académie de Bordeaux)

This file is part of GiBii/Melia.

GiBii/Melia 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/Melia 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/Melia; 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");

//$statut est passé en paramètre de l'URL
$statut=$_GET['statut'];
opensession($statut);

?>
<!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>nom1</TITLE>
<BASE TARGET="form">
<link rel="stylesheet" href="<?php echo "../themes/".$etab_theme."/b2i.css" ?>">

</HEAD>
<BODY class="arialadmin">
<p class="titre_petit">Gérer les profs</p>
<form name="nouveau_prof" method="post" target="form" action="profs_ajout1.php?id=0&statut=<?php echo $statut; ?>">
    <p align="center"><input type="submit" class="coul" name="nouveau" value="Ajouter..."></p>
</form>
<?php
if ($MODULE!='Melia') {
	?>
    <form name="demandeperime" method="post" target="form" action="profs_dem1an.php?id=0&statut=<?php echo $statut; ?>">
         <p align="center"><input type= "submit" class='coul' name="perime" value="Demandes longues..."></p>
    </form>
    <?php
    }
?>
<p>
<?php
//print "etab_id=$etab_id<br>";
$sql="SELECT * FROM profs WHERE etab_id=$etab_id and annee='$sess_ascol' and tag<=0 ORDER BY nom";
$result=query ($sql);
Print "<table border='0' width='100%'>";
$id=1;
$_SESSION['temp']['prof']=array();
while($row=mysql_fetch_array($result)) {   //$row["CIVIL"] ??
    print "<tr class=\"petit\">\n";
    $prof_id=$row["prof_id"];
    $fadm=$row['admin'];
    $longues=$row['opt_dem1an'];
    $cell1="<a href='profs_form.php?id=$id&statut=$statut' target='form'>".
    		stripslashes($row["nom"])." ".stripslashes($row["prenom"]).
			"</a>";
	$_SESSION['temp']['prof'][$id]=$prof_id;	
	$id++;	
    $adm="";
    if ($fadm & 1) $adm.="PA";
    if ($fadm & 2) {
        if ($adm) $adm.="-";
        $adm.="AA";
        }

/*************** Partie modifiée par Béa *****************************/
    if ($fadm & 4) {
        if ($adm) $adm.="-";
        $adm.="GA";
        }
/***********************************************************************/

	if ($longues) {
		if ($adm) $adm.="-";
		$adm.="dl";
		}
		
    $cell2="<span class='warning tout_petit' ><b>$adm</b></span>";
    print "<td width='85%'>$cell1</td><td>$cell2<br>\n";
    print "</tr>";
}
print "</table>";

mysql_free_result($result);
//mysql_close($conn);
?>
</p>

</BODY>

</HTML>