<?php
#G
#=
/****************************************************************************
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

****************************************************************************/

//define("NBCOLS",8);      //pour les classes et les compétences
include("../include/vars_adm.php");
include("../include/util.inc.php");
include("../include/utiljs.php");
include("../include/get.inc.php");
include("../include/eleve.inc.php");

opensession("Admin",false);
$statut=$sess_statut;
?><!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>Caractéristiques d'un élève</title>
<link rel="stylesheet" href="<?php echo "../themes/".$etab_theme."/b2i.css" ?>" />

<script language="javascript">
function eleveestbon() { //vérifie le formulaire avant envoi
 var frm=document.form1;
 if (!frm.nom.value) {
     alert("Le champ nom est absent.");
     return false;
 }
 if (!frm.login.value) {
     alert("Le champ login est absent.");
     return false;
 }
 return true;
}

function confirmer() {
    return (confirm('ATTENTION ! La suppression d\'un élève et de ses résultats est irréversible.\nPensez que d\'autres établissements peuvent le récupérer et réutiliser ses résultats.\n\nVoulez-vous VRAIMENT SUPPRIMER cet élève ?\n\n'));
}

</script>
</head>

<body class="arialadmin" onload="if (document.form1==undefined) ; else document.form1.nom.focus();">
<?php
//trouver tous les DIVCOD
$sqlclasses="SELECT * FROM classes WHERE etab_id=$etab_id AND divgro='D' ORDER BY divcod;";
$resultclasses=query ($sqlclasses);

//trouver toutes les langues
$res=query("SELECT disc_id,libelle FROM disciplines ORDER BY libelle");
while (list($disc_id,$libelle)=mysql_fetch_array($res)) {
        $tablang[$disc_id]=$libelle;
        }

print "\n<form name='form1' method='post' action='eleves_traiter.php?id=0'
          onsubmit='return eleveestbon();'>";
?>
<div align='center'><table border = "0" class='encadre_pres' width="98%"><tr class = "paire"><td >
<table border = "0" cellpadding="3" cellspacing="0" width="100%">
    <tr>
        <td width="40%">
        <p><input type="text" name="nom" size=25 value=""> Nom </p>
        </td>
        <td width="40%">
        <p><input type="text" name="prenom" size="20" value=""> Pr&eacute;nom</p>
        </td>
    </tr>
    <tr>
        <td width="40%">
        <p> <br />
        <select name=civilite>
                <option value="M." > M.</option>
                <option value="Mme" > Mme</option>
                <option value="Mlle" > Mlle</option>
        </select>
        </p>
        </td>
        <td width="40%">
        <p><br />
        <select name="newclasse_id" size="1">
            <?php
             //l'option sélectionnée se retrouvera dans $newclasse_id
             //afficher les classes dans une combo-box, avec la classe de l'élève sélectionnée
             while ($rowclasses=mysql_fetch_array($resultclasses)) {
                  $classeact=$rowclasses["classe_id"];
                  print "<option  value='$classeact'>";
                  print $rowclasses["divcod"].
                        "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;". //pour élargir la combo-box
                        "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
                  print "</option>\n";
              	}
             mysql_free_result($resultclasses);
            ?>
        </select> Classe
        </p>
        </td>
    </tr>
    <tr>
        <td width="40%">
         <p><br /><input type="text" name="login"  size=22 maxlength=22   value="" /> Login de base</p>
        </td>
        <td width="40%">
        <p><br /><input type="text" name="dnaiss" size="20" value='' /> Date de naissance </p>
        </td>

    </tr>
    <tr>
        <td width="40%">
        <p><br /><input type="checkbox" name="mdpinit"> Réinitialiser le mot de passe (d. de naiss.)</p>
        </td>
        <td width="40%">
        <p><br /><input type="text" name="uid"  size="20" maxlength="11"   value="" /> INE	</p> 
		
		</td></tr></table>
        </td></tr></table></div>
         <br />
         <?php
		  //Affichage des langues vivantes à réserver pour Melia
		  if ($MODULE=="Melia") {
				?>
				<div align='center'><table border = "1" width="98%"><tr class = "impaire"><td >
				<center><table border="0">
				<tr><td>
				<p align="center" class="rubrique">Langues vivantes : </p><td height="40"></td></td></tr>
				<tr>
				<td>
				<?php
				for ($r=1; $r<=3; $r++) {
					print "<select name=\"combolangue[$r]\" size=\"1\" >\n";
					//remplir les combo
					print "<option value=\"-1\">";  //valeur vide
					print "</option>\n";
					for ($ilangue=0; $ilangue<count($tablang); $ilangue++) {
					    print "<option value=\"$ilangue\" >";
					    print $tablang[$ilangue];
					    print "</option>";
					}
					print "</select>\n&nbsp;&nbsp;";
					//print_r($tablang);
					}
        		?>
        		</td>
    			</tr>

 		</table></center>
   		</td></tr>
		</table>
		</div>

 <?php
  //Fin affichage tableau des langues vivantes pour Melia
  }
?>


<input type='hidden' name='oldclasse_id' value='0' />
<input type='hidden' name='oldlogin' value='' />
<div align="center"><table border="0"><tr><td>
<input type="submit" class="coul"  name="enregistrer" value="Envoi des modifications" />
<input type="reset" class="coul" name="Annuler" value="Annuler" />
</div>
</form>

</body>
</html>