"; } //Action switch($action){ case 'add': $author_form = str_replace("!!deb_saisie!!", htmlentities(stripslashes($f_user_input),ENT_QUOTES,$charset), $author_form); print $author_form; break; case 'update': $value['type'] = $author_type; $value['name'] = $author_name; $value['rejete'] = $author_rejete; $value['date'] = $date; $value['voir_id'] = 0; $value['lieu'] = $lieu; $value['ville'] = $ville; $value['pays'] = $pays; $value['subdivision']= $subdivision; $value['numero'] = $numero; $auteur = new auteur(); $auteur->update($value); $sel_search_form = str_replace("!!bouton_ajouter!!", $bouton_ajouter, $sel_search_form); $sel_search_form = str_replace("!!deb_rech!!", htmlentities(stripslashes($f_user_input),ENT_QUOTES,$charset), $sel_search_form); print $sel_search_form; print $jscript; show_results($dbh, $author_name, 0, 0,$auteur->id); break; default: $sel_search_form = str_replace("!!bouton_ajouter!!", $bouton_ajouter, $sel_search_form); $sel_search_form = str_replace("!!deb_rech!!", htmlentities(stripslashes($f_user_input),ENT_QUOTES,$charset), $sel_search_form); print $sel_search_form; print $jscript; show_results($dbh, $user_input, $nbr_lignes, $page, 0); break; } print $sel_footer; // function d'affichage function show_results($dbh, $user_input, $nbr_lignes=0, $page=0, $id = 0) { global $nb_per_page; global $base_url; global $caller; global $callback; global $class_path; global $no_display; global $charset; global $msg ; global $libelleReq; global $id_type_autorite; if (!$id) { // on récupére le nombre de lignes if($user_input=="") { $requete = "SELECT COUNT(1) FROM authors where author_id!='$no_display' ".$libelleReq; } else { $aq=new analyse_query(stripslashes($user_input)); if ($aq->error) { error_message($msg["searcher_syntax_error"],sprintf($msg["searcher_syntax_error_desc"],$aq->current_car,$aq->input_html,$aq->error_message)); exit; } $requete=$aq->get_query_count("authors","concat(author_name,', ',author_rejete) ","index_author","author_id","author_id!='$no_display'"); $requete.=$libelleReq; } $res = mysql_query($requete, $dbh); $nbr_lignes = @mysql_result($res, 0, 0); } else { $nbr_lignes=1; } if(!$page) $page=1; $debut =($page-1)*$nb_per_page; if($nbr_lignes) { // on lance la vraie requête if (!$id) { if($user_input=="") { $requete = "SELECT * FROM authors where author_id!='$no_display' $libelleReq ORDER BY author_name, author_rejete LIMIT $debut,$nb_per_page "; } else { $members=$aq->get_query_members("authors","concat(author_name,', ',author_rejete)","index_author","author_id"); $requete="select *,".$members["select"]." as pert from authors where ".$members["where"]." and author_id!='$no_display' $libelleReq group by author_id order by pert desc,index_author limit $debut,$nb_per_page"; } } else { $requete="select * from authors where author_id='".$id."'".$libelleReq; } $res = @mysql_query($requete, $dbh); while(($author=mysql_fetch_object($res))) { $auteur = new auteur($author->author_id); $author_voir="" ; // gestion des voir : if($author->author_see) { $auteur_see = new auteur($author->author_see); $author_voir = "author_see', '".htmlentities(addslashes($auteur_see->isbd_entry),ENT_QUOTES, $charset)."','$callback')\">".htmlentities($auteur_see->isbd_entry,ENT_QUOTES, $charset).""; $author_voir = ". - $msg[210] : ".$author_voir; } print "
"; print pmb_bidi("author_id', '".htmlentities(addslashes($auteur->isbd_entry),ENT_QUOTES, $charset)."','$callback')\">$auteur->isbd_entry"); print pmb_bidi($author_voir ); print "
"; } mysql_free_result($res); // constitution des liens $nbepages = ceil($nbr_lignes/$nb_per_page); $suivante = $page+1; $precedente = $page-1; // affichage du lien précédent si nécéssaire print "
 
"; $url_base = $base_url."&rech_regexp=$rech_regexp&user_input=".rawurlencode(stripslashes($user_input))."&id_type_autorite=".$id_type_autorite; $nav_bar = aff_pagination ($url_base, $nbr_lignes, $nb_per_page, $page, 10, false, true) ; print $nav_bar; print "
"; } else { print $msg["no_author_found"]; } }