proceed(); function show_results ($user_input, $nbr_lignes=0, $page=0, $id = 0) { global $nb_per_page; global $base_url; global $caller; global $msg; global $no_display ; global $charset; // on récupére le nombre de lignes qui vont bien if($user_input=="") { $requete = "SELECT COUNT(1) FROM bulletins where bulletin_id!='".$no_display."' "; } else { $requete = "SELECT COUNT(1) FROM bulletins , notices where bulletin_notice=notice_id and (bulletin_numero like '%".str_replace("*","%",$user_input)."%' or tit1 like '%".str_replace("*","%",$user_input)."%' ) and bulletin_id!='".$no_display."' "; } $res = pmb_mysql_query($requete); $nbr_lignes = @pmb_mysql_result($res, 0, 0); if(!$page) $page=1; $debut =($page-1)*$nb_per_page; if ($nbr_lignes) { // on lance la vraie requête if($user_input=="") $requete = "SELECT tit1, mention_date, date_date,bulletin_titre,bulletin_id , if(bulletin_titre is not null and bulletin_titre!='',concat(bulletin_titre,' - ',bulletin_numero),bulletin_numero) as bulletin_numero FROM bulletins, notices where bulletin_notice=notice_id and bulletin_id!=".$no_display." ORDER BY tit1, date_date LIMIT $debut,$nb_per_page "; else $requete = "SELECT tit1, mention_date,bulletin_titre,bulletin_id, if(bulletin_titre is not null and bulletin_titre!='',concat(bulletin_titre,' - ',bulletin_numero),bulletin_numero) as bulletin_numero FROM bulletins, notices where bulletin_notice=notice_id and (bulletin_numero like '%".str_replace("*","%",$user_input)."%' or tit1 like '%".str_replace("*","%",$user_input)."%' ) and bulletin_id!=".$no_display." ORDER BY tit1, date_date LIMIT $debut,$nb_per_page "; $res = @pmb_mysql_query($requete); print "
bulletin_id', '".htmlentities(addslashes($bull->tit1.' / '.$bull->bulletin_numero),ENT_QUOTES,$charset)."' )\">".htmlentities( $bull->tit1.' / '.$bull->bulletin_numero,ENT_QUOTES,$charset)." | $notice_entry | "; print "