"; } //Action switch($action){ case 'add': 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; require_once("$class_path/author.class.php"); $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))) { if($author->author_rejete) $author_entry = $author->author_name.', '.$author->author_rejete; else $author_entry = $author->author_name; if($author->author_date) $author_entry .= " ($author->author_date)"; if($author->author_numero) $author_entry .= " ".$author->author_numero; if($author->author_lieu)$author_entry.=" ".$author->author_lieu; if($author->author_ville)$author_entry.=" ".$author->author_ville; if($author->author_pays)$author_entry.=" ".$author->author_pays; if($author->author_subdivision)$author_entry.=" ".$author->author_subdivision; $author_voir="" ; // gestion des voir : if($author->author_see) { // récupération des données de l'auteur cible $temp_requete = "SELECT * FROM authors WHERE author_id='$author->author_see' "; $temp_res = mysql_query($temp_requete, $dbh); $see = mysql_fetch_object($temp_res); if($see->author_rejete) $author_voir = $see->author_name.', '.$see->author_rejete; else $author_voir = $see->author_name; if($see->author_date) $author_voir .= " ($see->author_date)"; $author_voir = "author_id', '".htmlentities(addslashes($author_voir),ENT_QUOTES, $charset)."','$callback')\">".htmlentities($author_voir,ENT_QUOTES, $charset).""; $author_voir = ". - $msg[210] : ".$author_voir; } print "