$requete"); $nbr_lignes = @mysql_result($res, 0, 0); } if (!$page) $page=1; $debut = ($page-1)*$nb_per_page; if ($nbr_lignes == 1) { // on lance la vraie requête $requete = "SELECT distinct id_empr as id FROM empr join bannette_abon on id_empr=num_empr $form_restrict_priv, empr_categ $clause $where_restrict_priv "; $res = @mysql_query($requete, $dbh); $id = @mysql_result($res, '0', 'id'); if($id) { $retour['id_empr'] = $id ; $retour['message'] = $msg[dsi_encours_de_dev]." // lecteur trouvé à partir du nom..."; return $retour ; } } else if($nbr_lignes) { // on lance la vraie requête $requete = "SELECT distinct libelle, empr_cb, empr_nom, empr_prenom, id_empr FROM empr join bannette_abon on id_empr=num_empr $form_restrict_priv, empr_categ $clause $where_restrict_priv ORDER BY empr_nom, empr_prenom LIMIT $debut,$nb_per_page "; $res = mysql_query($requete, $dbh) or die (mysql_error().$requete); $parity = 0; while(($empr=mysql_fetch_object($res))) { if ($parity % 2) $pair_impair = "even"; else $pair_impair = "odd"; $tr_javascript=" onmouseover=\"this.className='surbrillance'\" onmouseout=\"this.className='$pair_impair'\" onmousedown=\"document.location='./dsi.php?categ=bannettes&sub=abo&id_empr=$empr->id_empr&suite=acces';\" "; $empr_list .= ""; $empr_list .= " $empr->empr_cb $empr->empr_nom $empr->empr_prenom $empr->libelle "; $parity += 1; } mysql_free_result($res); // affichage de la barre de navig $url_base = "$PHP_SELF?categ=bannettes&sub=abo&suite=search&form_cb=".rawurlencode($form_cb)."&ban_priv_seuls=$ban_priv_seuls&empr_location_id=$empr_location_id" ; $nav_bar = aff_pagination ($url_base, $nbr_lignes, $nb_per_page, $page, 10, false, true) ; $dsi_list_tmpl = str_replace("!!cle!!", $form_cb, $dsi_list_tmpl); $dsi_list_tmpl = str_replace("!!list!!", $empr_list, $dsi_list_tmpl); $dsi_list_tmpl = str_replace("!!nav_bar!!", $nav_bar, $dsi_list_tmpl); $dsi_list_tmpl = str_replace("!!message_trouve!!", $msg['dsi_empr_trouves'], $dsi_list_tmpl); $retour['id_empr'] = 0 ; $retour['message'] = $dsi_list_tmpl; return $retour ; } else { $retour['id_empr'] = 0 ; $retour['message'] = $msg[dsi_lect_aucun_trouve] ; return $retour ; } } // fonction affichant les bannettes privées d'un abonné function dsi_list_bannettes_abo($id_empr=0) { global $dbh, $msg, $charset; global $page, $nbr_lignes; global $dsi_list_tmpl; global $form_cb; $clause = "WHERE proprio_bannette='$id_empr' " ; $requete = "SELECT id_bannette FROM bannettes $clause ORDER BY nom_bannette, id_bannette "; $res = @mysql_query($requete, $dbh); $bann_list .= ""; $bann_list .= " ".htmlentities($msg[dsi_ban_form_nom],ENT_QUOTES, $charset).""; $bann_list .= " ".htmlentities($msg[dsi_ban_list_equ],ENT_QUOTES, $charset)." "; $bann_list .= " ".htmlentities($msg[dsi_ban_nb_notices],ENT_QUOTES, $charset)." "; $bann_list .= " ".htmlentities($msg[dsi_ban_date_last_envoi],ENT_QUOTES, $charset)."
(".htmlentities($msg[dsi_ban_date_last_remp],ENT_QUOTES, $charset).") "; $bann_list .= ""; $parity = 0; $ban_trouvees = mysql_num_rows($res) ; while(($ban=mysql_fetch_object($res))) { $bann = new bannette($ban->id_bannette) ; if ($parity % 2) $pair_impair = "even"; else $pair_impair = "odd"; $tr_javascript=" onmouseover=\"this.className='surbrillance'\" onmouseout=\"this.className='$pair_impair'\" "; $bann_list .= ""; $td_javascript=" onmousedown=\"document.location='./dsi.php?categ=bannettes&sub=abo&id_bannette=$bann->id_bannette&suite=modif&id_empr=$id_empr';\" "; $bann_list .= " ".htmlentities($bann->nom_bannette,ENT_QUOTES, $charset).""; $requete = "select id_equation, num_classement, nom_equation, comment_equation, proprio_equation, num_bannette from equations, bannette_equation where num_equation=id_equation and proprio_equation=$id_empr and num_bannette='$bann->id_bannette' order by nom_equation " ; $resequ = mysql_query($requete, $dbh) or die ($requete) ; $equ_trouvees = mysql_num_rows($resequ) ; $equations = "" ; while ($equa=mysql_fetch_object($resequ)) { $eq_form= new equation($equa->id_equation) ; $equations .= "
  • ".$equa->nom_equation.$eq_form->make_hidden_search_form("","PRI", $id_empr)."
  • "; } $td_javascript=" onmousedown= \"document.modif_requete_form_$eq_form->id_equation.submit();\" "; $bann_list .= ""; $bann_list .= "$bann->nb_notices"; $td_javascript=" onmousedown=\"document.location='./dsi.php?categ=diffuser&sub=lancer';\" "; $bann_list .= " ".htmlentities($bann->aff_date_last_envoi,ENT_QUOTES, $charset).""; if ($bann->alert_diff) $bann_list .= "
    (".htmlentities($bann->aff_date_last_remplissage,ENT_QUOTES, $charset).")"; else $bann_list .= "
    (".htmlentities($bann->aff_date_last_remplissage,ENT_QUOTES, $charset).")" ; $bann_list .= ""; $bann_list .= ""; $parity += 1; } $nav_bar = "" ; $dsi_list_tmpl = str_replace("!!cle!!", $form_cb, $dsi_list_tmpl); $dsi_list_tmpl = str_replace("!!list!!", $bann_list, $dsi_list_tmpl); $dsi_list_tmpl = str_replace("!!nav_bar!!", $nav_bar, $dsi_list_tmpl); $dsi_list_tmpl = str_replace("!!message_trouve!!", $msg['dsi_ban_abo_trouvees'], $dsi_list_tmpl); return $dsi_list_tmpl; }