<?php
#G
#=
/****************************************************************************
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");
include("../include/utiljs.php");
$statut=$_REQUEST['statut'];
opensession($statut,false);

?>
<!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="_self">
<link rel="stylesheet" href="<?php echo "../themes/".$etab_theme."/b2i.css" ?>">
</HEAD>
<?php
if ($statut=='Prof') {
          print "<body class=\"arialprof\">";
          print "<p class=\"sous_titre\" align=\"center\">Suppression d'un groupe</p>";
   }
    else {
          print "<body class=\"arialadmin\">";
          print "<p class=\"sous_titre\" align=\"center\">Suppression d'une classe ou d'un groupe</p>";
   }



connexion("$db");
//$conn  = mysql_connect($host, $user, $mdp);


//Suppression de la classe $classe_id   on vire aussi les liens eleves_classes aucas où
$sqllienec="DELETE FROM lien_eleves_classes
             WHERE classe_id=$classe_id;";
$ok1=query($sqllienec);

//Suppression de la classe $classe_id   on vire d'abord les liens profs_classes
$sqllienpc="DELETE FROM lien_profs_classes
             WHERE classe_id=$classe_id;";
$ok=$ok1 or query($sqllienpc);

if (!$ok) $mess="Erreur dans la suppression de la classe ou du groupe !";
   else {
        $sqlclasse="DELETE FROM classes ".
             "WHERE etab_id=$etab_id and classe_id=$classe_id ;";
        $ok=query($sqlclasse);
        if (!$ok) $mess="Erreur dans la suppression de la classe ou du groupe !";
           else $mess="$divcod : suppression réussie";
        }
print $mess."<br /><p align='center'>";

?>

<form name="formsup" method="post" action="liste_classes.php?statut=<?php echo $statut; ?>" >
<input type="submit" class="coul" name="btn_ret" value="Retour liste">
</p>
</body>
</html>