<?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,false);
//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>Suppression des Gest-admins</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
if (!isset($id)) {
	//arrivée avant le choix d'une action
	print "</body></html>\n";
	exit();
	}

if (!isset($choix_fait)) {
$login=$_SESSION['temp']['suplogin'][$id];
//En-tête pour impression
Print "<p class='sous_titre'>Suppression d'un compte :</p><hr>";
Print "</br><p align = \"center\">Voulez-vous vraiment supprimer le compte <b>".stripslashes($login)."</b> ?";
$sql_query=urlencode("DELETE FROM comptes WHERE login=\"$login\" AND etab_id=$etab_id");

?>
<center><table><tr><td>
<form name="form_supp" action="supp_gest.php" method="post" enctype="application/x-www-form-urlencoded">
    <input type="hidden" name="sql_query" value="<?php echo $sql_query; ?>">
    <input type="hidden" name="choix_fait" value="oui">
    <input type="hidden" name="nom_util" value="<?php echo $login; ?>">
    <input type="hidden" name="stat" value="<?php echo $stat; ?>">
    <input type="hidden" name="statut" value="Admin">
    <input type="hidden" name="id" value="<?php echo $id; ?>">    
    <input type="submit" class="coul" name="btnDrop" value="Oui" />
    <input type="submit" class="coul" name="btnDrop" value="Non" />
</form> </td></tr></table>

<?php

} else {

if ($btnDrop=="Oui") {
  print "</br><p align = \"center\">Suppression en cours.......";
  $sql_query=urldecode($sql_query);
  $conn  = connecte($host,$user,$mdp,$db);
  $res=query ($sql_query);
  if ($res) print "Suppression effectuée</p>";
}
$stat_l=strtolower($stat);
$action="liste_".$stat_l.".php";

?>
<center><table><tr><td>
<form action="<?php echo $action; ?>" method="post">
     <input type ="submit" class="coul" name="btn_retour" value="Retour liste">
     <input type="hidden" name="statut" value="<?php echo $statut ?>">
</form></td></tr></table>


<?php

}

?>
</body>
</html>
