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

****************************************************************************/
?>
<!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 disciplines</title>
<?php
include("../include/util.inc.php");
$etab_theme=$_GET['etab_theme'];
//$disc_id=$_POST["disc_id"];
$statut=$_GET['statut'];
?>

<link rel="stylesheet" href="<?php echo "../themes/".$etab_theme."/b2i.css" ?>">
</head>
<script language='javascript'>
function envoyer(accord) {
    if (accord) {
        var box=document.liste.discipline;
        var fpere=window.opener.document.form1;
        //alert(fpere.name);
        fpere.discipline.value=box.options[box.selectedIndex].text;
        fpere.disc_id.value=box.options[box.selectedIndex].value;//box.selectedIndex + 1;
    }
    //alert('envoi de ' + fpere.disc_id.value); //Envoi OK
    window.close();
    }
    
function e() {
    envoyer(true);
    }

</script>
<?php
if ($statut=="Prof") echo "<BODY class='arialprof'>";
elseif ($statut=="Admin") echo "<BODY class='arialadmin'>";
?>

<div align='center'>
<form name='liste' method='post' >
<select name='discipline' size=24>
<?php
include("../include/vars_adm.php");
include("../include/util.inc.php");

//$disc_id est passé en paramètre
$conn  = connecte($host,$user,$mdp,$db);
$resldisc=query("SELECT * FROM disciplines ORDER BY libelle;");
print "\n";
//print "<script language='javascript'>\n";
$event="onDblClick=\"e();\" ";
while ($rowldisc=mysql_fetch_object($resldisc)) {
    $id=$rowldisc->disc_id;
    $selected=($disc_id==$id) ? "selected" : "";
    print "\t<option value='".$id."' $event>".$rowldisc->libelle;
    print "\t</option>\n";
}
?>
</select>
<p align='center'>
<input type='button' class='coul' name='vabene' value='  OK  ' onclick='envoyer(true)'>
&nbsp;&nbsp;&nbsp;
<input type='button' class='coul' name='annuler' value='Annuler' onclick='envoyer(false)'>
</p>
</form>
</div>
</body>
</html>