<?php
#=
/****************************************************************************
Copyright 2002, Daniel Deycard, Jacques Messines, Alain Pomirol
(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=$_REQUEST['statut'];
opensession($statut);
//print_r($_SESSION);

?>
<!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>Liste des Admin</title>
<link rel="stylesheet" href="<?php echo "../themes/".$etab_theme."/b2i.css" ?>">
</head>
<body class="arialadmin" bgcolor="white" text="black" link="blue" vlink="purple" alink="red">


<?php


Print "<p class='libelle_admin'>".$etab_nom."&nbsp;&nbsp;&nbsp;&nbsp;".
                 $etab_adresse."&nbsp;&nbsp;&nbsp;&nbsp;".$etab_codepostal.
                 "&nbsp;&nbsp;".$etab_ville;
Print "<hr>";

print "<p class='sous_titre'>Liste des comptes \"Administrateur\".</p>";

$conn  = connecte($host,$user,$mdp,$db);
$sql="SELECT *  FROM comptes ".
             "WHERE statut='Admin' and etab_id=$etab_id";
$resprofs=query ($sql);
//print"<br>$sql";
$nbprofs=0;

//début du tableau
print "<div  align='center'><table border='1'>\n";
print "<tr class='rubrique'>\n";
print "\t<td>Login</td><td>Mot de passe</td><td width='100'>Action</td></tr>\n";

//Get indirect
$_SESSION['temp']['suplogin']=array();
$id=1;
while ($rowprof=mysql_fetch_array($resprofs)) {
     $nbprofs++;
     $login=$rowprof["login"];
     $mdp=$rowprof["mdp"];
//Affichage d'une ligne
     print "\t<tr>\n";
     print "\t<td>&nbsp;&nbsp;$login&nbsp;&nbsp;</td>\n";
     print "\t<td>&nbsp;&nbsp;*************&nbsp;&nbsp;</td>\n";
     print "\t<td align='center'>&nbsp;";
     if ($login != 'admin' ) {
         print "<a href=\"supp_gest.php?id=$id&statut=Admin&stat=Admin\">";
         print "Supprimer&nbsp;";
         print "</a>";
     }  else if ($sess_statut=='Sadmin') {
         print "<a href=\"admin_initmdp.php?id=$id&statut=Admin&stat=Admin\">";
         print "Initialiser le mot de passe&nbsp;";
         print "</a>";
             }
	 $_SESSION['temp']['suplogin'][$id]=$login;	
	 $id++;	
     print "</td>\n";
     print "\t</tr>\n";
}

 print "</table></div><br>\n";
 print "<p align = \"center\">";
 print $nbprofs;
 print ($nbprofs>1) ? " comptes \"Administrateur\"." : " compte \"Administrateur\"." ;
?>
</p>
</body>
</html>