";
if ($id_classement>0) $requete = "select distinct id_equation, num_classement, nom_equation, comment_equation, proprio_equation from equations left join bannette_equation on num_equation=id_equation where proprio_equation=0 and num_classement='$id_classement' order by nom_equation " ;
elseif ($id_classement==0) $requete = "select distinct id_equation, num_classement, nom_equation, comment_equation, proprio_equation from equations left join bannette_equation on num_equation=id_equation where proprio_equation=0 order by nom_equation " ;
elseif ($id_classement==-1) $requete = "select distinct id_equation, num_classement, nom_equation, comment_equation, proprio_equation from equations, bannette_equation where num_bannette=$id_bannette and num_equation=id_equation and proprio_equation=0 order by nom_equation " ;
$res = mysql_query($requete, $dbh) or die ($requete) ;
$parity = 0;
$equ_trouvees = mysql_num_rows($res) ;
while ($equa=mysql_fetch_object($res)) {
$equations .= "'' ";
$mail_abon_checked = "checked=checked";
} else {
$restrict_mail = "";
$mail_abon_checked = "";
}
$url_base = "./dsi.php?categ=bannettes&sub=pro&id_bannette=$id_bannette&suite=affect_lecteurs";
$url_modif = "./dsi.php?categ=bannettes&sub=pro&id_bannette=$id_bannette&suite=acces";
if ($quoi == 'groups') {
if (!$id_groupe) $id_groupe=0;
$id_categorie=0;
if ($id_groupe>0) $requete = "select id_empr, empr_cb, concat(empr_nom, ' ', empr_prenom) as nom_prenom, empr_mail from empr,empr_groupe where id_empr=empr_id and groupe_id='$id_groupe' and empr_nom like '$lect_query' $restrict_loc $restrict_mail order by nom_prenom, empr_cb $limit_nb" ;
elseif ($id_groupe==0) $requete = "select id_empr, empr_cb, concat(empr_nom, ' ', empr_prenom) as nom_prenom, empr_mail from empr where empr_nom like '$lect_query' $restrict_loc $restrict_mail order by nom_prenom, empr_cb $limit_nb " ;
elseif ($id_groupe==-1) $requete = "select id_empr, empr_cb, concat(empr_nom, ' ', empr_prenom) as nom_prenom, empr_mail from empr, bannette_abon where num_bannette='$id_bannette' and id_empr=num_empr and empr_nom like '$lect_query' $restrict_loc $restrict_mail order by nom_prenom, empr_cb $limit_nb" ;
$res = mysql_query($requete, $dbh) or die ($requete) ;
} else {
if (!$id_categorie) $id_categorie = 0;
$id_groupe=0;
if ($id_categorie>0) $requete = "select id_empr, empr_cb, concat(empr_nom, ' ', empr_prenom) as nom_prenom, empr_mail from empr where empr_categ='$id_categorie' and empr_nom like '$lect_query' $restrict_loc $restrict_mail order by nom_prenom, empr_cb $limit_nb" ;
elseif ($id_categorie==0) $requete = "select id_empr, empr_cb, concat(empr_nom, ' ', empr_prenom) as nom_prenom, empr_mail from empr where empr_nom like '$lect_query' $restrict_loc $restrict_mail order by nom_prenom, empr_cb $limit_nb " ;
elseif ($id_categorie==-1) $requete = "select id_empr, empr_cb, concat(empr_nom, ' ', empr_prenom) as nom_prenom, empr_mail from empr, bannette_abon where num_bannette='$id_bannette' and id_empr=num_empr and empr_nom like '$lect_query' $restrict_loc $restrict_mail order by nom_prenom, empr_cb $limit_nb" ;
$res = mysql_query($requete, $dbh) or die ($requete) ;
}
$parity = 0;
$lec_trouvees = mysql_num_rows($res) ;
$lecteurs="";
if($lec_trouvees){
$lecteurs="
";
while ($lec=mysql_fetch_object($res)) {
$requete_affect = "SELECT * FROM bannette_abon where num_empr='$lec->id_empr' and num_bannette='$id_bannette' ";
$res_affect = mysql_query($requete_affect, $dbh);
$checked= "";
if (mysql_num_rows($res_affect)){
$abon=mysql_fetch_object($res_affect);
$checked= "checked";
}
$sel_mail="";
if ($lec->empr_mail){
$destinataires = explode(";",$lec->empr_mail) ;
if(count($destinataires)>1){
$sel_mail="";
}
}
$lecteurs.="