proceed(); function show_results($user_input,$nbr_lignes=0,$page=0){ global $nb_per_page; global $base_url; global $caller; global $msg; global $charset; global $idaction; global $current_note; $user_input = str_replace('*','%',$user_input); if($user_input == ""){ $req_count = "select count(1) from demandes_notes where num_action='".$idaction."' and id_note !='".$current_note."'"; } else { $req_count = "select count(1) from demandes_notes where num_action='".$idaction."' and contenu like '%".$user_input."%' and id_note !='".$current_note."'"; } $res = pmb_mysql_query($req_count); $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 == ""){ $req = "select id_note, date_note, CONCAT(SUBSTRING(contenu,1,50),'','...') as note from demandes_notes where num_action='".$idaction."' and id_note !='".$current_note."'"; } else { $req = "select id_note, date_note, CONCAT(SUBSTRING(contenu,1,50),'','...') as note from demandes_notes where num_action='".$idaction."' and contenu like '%".$user_input."%' and id_note !='".$current_note."'"; } $res = pmb_mysql_query($req); while(($note = pmb_mysql_fetch_object($res))){ print "
"; } pmb_mysql_free_result($res); // constitution des liens $nbepages = ceil($nbr_lignes/$nb_per_page); $suivante = $page+1; $precedente = $page-1; } print "