<?php
#=
/****************************************************************************
Copyright 2002, Daniel Deycard, Jacques Messines, Alain Pomirol
(CATICE Académie de Bordeaux)

This file is part of Gibii.

Gibii 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 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; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA

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

//outils pour get2gibii.inc.php
//vérifier les fonctions qui font double emploi dans util.inc.php
//---------------------------------------------------------------
function gettab_discipline_discid() { //retourne un tableau t tel que t["EDUCATION"]=6
$res=query("SELECT disc_id,libelle FROM disciplines;");
while (list($disc_id,$libelle)=mysql_fetch_array($res))
      $tabd["$libelle"]=$disc_id;
return $tabd;  //tous les index ne sont pas remplis
}

function gettab_discid_discipline() { //retourne un tableau t tel que t[6]="EDUCATION"
//les libellés sont personnalisés par rapport à ceux du GEP
$res=query("SELECT disc_id,libelle FROM disciplines;");
while (list($disc_id,$libelle)=mysql_fetch_array($res))
      $tabd[$disc_id]=$libelle;
return $tabd;  //tous les index ne sont pas remplis
}

function gettab_disco_discid() { //retourne un tableau t tel que t["0030X"]=6
$res=query("SELECT disc_id,gep_id FROM disc_gep;");
while (list($disc_id,$gep_id)=mysql_fetch_array($res)) {
      //print "$gep_id ~> $disc_id<br>";
      $t["$gep_id"]=$disc_id;
}
return $t;
}

function gettab_divcod_classeid() {  //permet d'avoir tabid["4G3"]=6 par exemple
global $etab_id;
$res=query("SELECT classe_id,divcod FROM classes where etab_id=$etab_id;");
while (list($classe_id,$divcod)=mysql_fetch_array($res))
      $tabid["$divcod"]=$classe_id;
return $tabid;
}

function gettab_classeid_divcod() {  //permet d'avoir tabdivcod[6]="4G3" par exemple
global $etab_id;
$res=query("SELECT classe_id,divcod FROM classes where etab_id=$etab_id;");
while (list($classe_id,$divcod,)=mysql_fetch_array($res))
      $tabdivcod[$classe_id]=$divcod;
return $tabdivcod;
}



?>