<?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

****************************************************************************/
?>
<?php
    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>Page super-administrateur GiSCCo</title>
</head>
<?php  //Cas d'un retour de prise en main seulement !

  include("../include/vars_adm.php");
  include("../include/util.inc.php");

function dropparams_etab($id) {
global $host,$user,$mdp,$db;
//récupération des paramètres de l'établissement à virer de la session,
//même s'ils ne sont pas tous utiles tout le temps.
connecte($host,$user,$mdp,$db);
$resparam=query("SELECT * FROM etablissements WHERE etab_id=$id;");
//Combien de champs ?
$nbfields=mysql_num_fields($resparam);
//DEBUG
//alert("nbfields=".$nbfields);
for ($i=0; $i<$nbfields; $i++) {
    $name=mysql_field_name($resparam,$i);
    $param_type=mysql_field_type($resparam,$i);
    //virer tous les champs en session (de noms etab_nomchamp)
    if (substr($name, 0, 4)!="etab") unset($_SESSION['etab_'.$name]);
    }//fin de lecture des champs

//rétablir les valeurs à conserver
$_SESSION['etab_id']=-1; //conventionnel pour sadmin
$_SESSION['etab_sess_timeout']=$_SESSION['SESS_TIMEOUT_MIN'];
}


if (isset($_GET['from']) && $_GET['from']=="admin") {
    $statut=$_GET['statut'];;
    opensession($statut);
    include("../include/utiljs.php");
    //On connaît l'ID de l'établissement $etab_id, on vire les variables en session
    dropparams_etab($etab_id);
    unset($from);
    }
?>


<frameset rows="170, *" cols="100%" frameborder="yes" framespacing="1" border="1">
<frame name="haut" scrolling="no"  marginwidth="10" marginheight="3"  src="sadmin_haut.php">
<frame name="bas" scrolling="auto" marginwidth="10" marginheight="4"  src="sadmin_bas.php">
</frameset>
<noframes>
<body bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#800080" alink="#FF0000">

<p>Cette page utilise des cadres. Pour pouvoir la consulter, votre navigateur doit supporter les cadres.</p>
</body>
</noframes>
</frameset>
</html>