0))
{
$meth_1_2 = var_courante ("meth_1_2", 0, null) ;
$resultats = SQL_commande ("SELECT * FROM eleves WHERE exterieur='0' ORDER BY ".$meth_1_1, $id_sql) ;
$nombre_maj = SQL_nbr_lignes ($resultats) ;
For ($i = 0 ; $i < $nombre_maj ; $i++)
{
$r = SQL_tableau_associatif ($resultats, "") ;
If (StrPos ($r ["$meth_1_1"], "0") == 0)
{ $nom = SubStr ($r ["$meth_1_1"], 1, StrLen ($r ["$meth_1_1"])-1) ; }
Else
{ $nom = $r ["$meth_1_1"] ; }
$ok = SQL_commande ("UPDATE eleves SET photo='".$nom.$meth_1_2."' WHERE id_eleve='".$r ["id_eleve"]."' LIMIT 1", $id_sql) ;
}
$maj = 1 ;
}
Else
{
$meth_2_1 = var_courante ("meth_2_1", 0, null) ;
$meth_2_2 = var_courante ("meth_2_2", 0, null) ;
$meth_2_3 = var_courante ("meth_2_3", 0, null) ;
$meth_2_4 = var_courante ("meth_2_4", 0, null) ;
$meth_2_5 = var_courante ("meth_2_5", 0, null) ;
$resultats = SQL_commande ("SELECT * FROM eleves WHERE exterieur='0'", $id_sql) ;
$nombre_maj = SQL_nbr_lignes ($resultats) ;
For ($i = 0 ; $i < $nombre_maj ; $i++)
{
$r = SQL_tableau_associatif ($resultats, "") ;
$nom = "" ;
If ($meth_2_1) { $nom .= $r ["$meth_2_1"] ; }
If (($sep_1) And ($nom != "")) { $nom .= $sep_1 ; }
If ($meth_2_2) { $nom .= $r ["$meth_2_2"] ; }
If (($sep_2) And ($nom != "")) { $nom .= $sep_2 ; }
If ($meth_2_3) { $nom .= $r ["$meth_2_3"] ; }
If (($sep_3) And ($nom != "")) { $nom .= $sep_3 ; }
If ($meth_2_4) { $nom .= $r ["$meth_2_4"] ; }
$ext = $meth_2_5 ;
If ($min) { $nom_photo = StrToLower ($nom.$ext) ; }
Else { $nom_photo = $nom.$ext ; }
$nom_photo = Str_Replace (" ", "_", $nom_photo) ;
$ok = SQL_commande ("UPDATE eleves SET photo='".$nom_photo."' WHERE id_eleve='".$r ["id_eleve"]."' LIMIT 1", $id_sql) ;
}
$maj = 1 ; ;
}
Break ;
// Professeurs
Case 2 : If (IsSet ($meth_1_1) And ($meth_1_1 > 0))
{
$meth_1_2 = var_courante ("meth_1_2", 0, null) ;
$resultats = SQL_commande ("SELECT * FROM utilisateurs WHERE droits='".$droit_prof."' ORDER BY ".$meth_1_1, $id_sql) ;
$nombre_maj = SQL_nbr_lignes ($resultats) ;
For ($i = 0 ; $i < $nombre_maj ; $i++)
{
$r = SQL_tableau_associatif ($resultats, "") ;
If (StrPos ($r ["$meth_1_1"], "0") == 0)
{ $nom = SubStr ($r ["$meth_1_1"], 1, StrLen ($r ["$meth_1_1"])-1) ; }
Else
{ $nom = $r ["$meth_1_1"] ; }
$ok = SQL_commande ("UPDATE utilisateurs SET photo='".$nom.$meth_1_2."' WHERE id_utilisateur='".$r ["id_utilisateur"]."' LIMIT 1", $id_sql) ;
}
$maj = 1 ; ;
}
Else
{
$meth_2_1 = var_courante ("meth_2_1", 0, null) ;
$meth_2_2 = var_courante ("meth_2_2", 0, null) ;
$meth_2_3 = var_courante ("meth_2_3", 0, null) ;
$meth_2_4 = var_courante ("meth_2_4", 0, null) ;
$meth_2_5 = var_courante ("meth_2_5", 0, null) ;
$resultats = SQL_commande ("SELECT * FROM utilisateurs WHERE droits='".$droit_prof."' ORDER BY nom,prenom", $id_sql) ;
$nombre_maj = SQL_nbr_lignes ($resultats) ;
For ($i = 0 ; $i < $nombre_maj ; $i++)
{
$r = SQL_tableau_associatif ($resultats, "") ;
$nom = "" ;
If ($meth_2_1) { $nom .= $r ["$meth_2_1"] ; }
If (($sep_1) And ($nom != "")) { $nom .= $sep_1 ; }
If ($meth_2_2) { $nom .= $r ["$meth_2_2"] ; }
If (($sep_2) And ($nom != "")) { $nom .= $sep_2 ; }
If ($meth_2_3) { $nom .= $r ["$meth_2_3"] ; }
If (($sep_3) And ($nom != "")) { $nom .= $sep_3 ; }
If ($meth_2_4) { $nom .= $r ["$meth_2_4"] ; }
$ext = $meth_2_5 ;
If ($min) { $nom_photo = StrToLower ($nom.$ext) ; }
Else { $nom_photo = $nom.$ext ; }
$nom_photo = Str_Replace (" ", "_", $nom_photo) ;
$ok = SQL_commande ("UPDATE utilisateurs SET photo='".$nom_photo."' WHERE id_utilisateur='".$r ["id_utilisateur"]."' LIMIT 1", $id_sql) ;
}
$maj = 1 ;
}
Break ;
}
}
$resultats = SQL_commande ("SELECT * FROM menus WHERE numero='$droit_courant' AND ordre='0'", $id_sql) ;
$l = SQL_tableau_associatif ($resultats, "") ;
Echo "\n" ;
Echo "
\n" ;
entete_html ("Garennes - Menu", "", 1) ;
Echo styles ("none", "none", "none", $l ["lien"], "none") ;
Echo " \n" ;
Echo " \n" ;
Echo " Attribution d'un nom de photo générique aux " ;
Switch ($utils)
{
Case 1 : Echo "élèves" ;
If ($maj == 1) { $utils = 3 ; } Else { $utils = 1 ; }
Break ;
Case 2 : Echo "professeurs" ;
If ($maj == 1) { $utils = 3 ; } Else { $utils = 2 ; }
Break ;
Default : Echo "élèves" ; $utils = 1 ; Break ;
}
Echo " \n" ;
Switch ($utils)
{
Case 1 : Echo "" ;
Break ;
Case 2 : Echo "" ;
Break ;
Case 3 : Echo "" ;
Echo "" ;
Echo "" ;
Echo " Rapport d'attribution des photo | " ;
Echo " | " ;
Echo "" ;
Echo " Nombre d'attribution : | " ;
Echo " ".$nombre_maj." noms de photos | " ;
Echo " " ;
Echo " | " ;
Echo " " ;
Echo " |
" ;
Break ;
}
Echo " " ;
Echo "" ;
?>