";
$classements .= "\n";
if ($utilise) {
$compte = "num_classement" ;
if ($type=="BAN") {
$from = " classements, bannettes " ;
$clause = " where id_classement=num_classement and type_classement='BAN' " ;
} else {
$from = " classements, equations " ;
$clause = " where id_classement=num_classement and type_classement='EQU' " ;
}
} else {
$compte = "id_classement" ;
if ($type=="BAN") {
$from = " classements " ;
$clause = " where type_classement='BAN' " ;
} else {
$from = " classements " ;
$clause = " where type_classement='EQU' " ;
}
}
$query = "SELECT count($compte) as util, id_classement, nom_classement from $from $clause group by id_classement, nom_classement order by nom_classement, id_classement ";
$result = pmb_mysql_query($query, $dbh);
while ($temp = @pmb_mysql_fetch_object($result)) {
$classements .= "\n";
}
$classements .= "" ;
return $classements ;
}
function gen_liste_classement($type_classement="BAN", $id_classement=0, $onchange="") {
global $msg ;
return gen_liste ("select id_classement, nom_classement from classements where id_classement=1 UNION select id_classement, nom_classement from classements where type_classement='$type_classement' order by nom_classement", "id_classement", "nom_classement", "id_classement", $onchange, $id_classement, "", "",0,$msg['dsi_all_classements'],0) ;
}