init_links();
switch ($sub) {
case "launch":
if ((string)$page=="") {
$_SESSION["CURRENT"]= (is_countable($_SESSION["session_history"]) ? count($_SESSION["session_history"]) : 0);
$_SESSION["session_history"][$_SESSION["CURRENT"]]["QUERY"]["URI"]="./catalog.php?categ=search&mode=8";
$_SESSION["session_history"][$_SESSION["CURRENT"]]["QUERY"]["POST"]=$_POST;
$_SESSION["session_history"][$_SESSION["CURRENT"]]["QUERY"]["GET"]=$_GET;
$_SESSION["session_history"][$_SESSION["CURRENT"]]["QUERY"]["GET"]["sub"]="";
$_SESSION["session_history"][$_SESSION["CURRENT"]]["QUERY"]["POST"]["sub"]="";
$_SESSION["session_history"][$_SESSION["CURRENT"]]["QUERY"]["HUMAN_QUERY"]=$sc->make_human_query();
$_SESSION["session_history"][$_SESSION["CURRENT"]]["QUERY"]["HUMAN_TITLE"]=$msg["search_exemplaire"];
$_SESSION["session_history"][$_SESSION["CURRENT"]]["QUERY"]["SEARCH_TYPE"]="EXPL";
$_POST["page"]=0;
$page=0;
}
$table=$sc->get_results("./catalog.php?categ=search&mode=8&sub=launch","./catalog.php?categ=search&mode=8&option_show_notice_fille=$option_show_notice_fille&option_show_expl=$option_show_expl",true);
print_results($sc,$table,"./catalog.php?categ=search&mode=8&sub=launch&option_show_notice_fille=$option_show_notice_fille&option_show_expl=$option_show_expl","./catalog.php?categ=search&mode=8&option_show_notice_fille=$option_show_notice_fille&option_show_expl=$option_show_expl",true);
if ($_SESSION["CURRENT"]!==false) {
$_SESSION["session_history"][$_SESSION["CURRENT"]]["EXPL"]["URI"]="./catalog.php?categ=search&mode=8";
$_SESSION["session_history"][$_SESSION["CURRENT"]]["EXPL"]["POST"]=$_POST;
$_SESSION["session_history"][$_SESSION["CURRENT"]]["EXPL"]["GET"]=$_GET;
$_SESSION["session_history"][$_SESSION["CURRENT"]]["EXPL"]["PAGE"]=$page+1;
$_SESSION["session_history"][$_SESSION["CURRENT"]]["EXPL"]["HUMAN_QUERY"]=$sc->make_human_query();
$_SESSION["session_history"][$_SESSION["CURRENT"]]["EXPL"]["SEARCH_TYPE"]="expl";
$_SESSION["session_history"][$_SESSION["CURRENT"]]["EXPL"]['TEXT_LIST_QUERY']='';
$_SESSION["session_history"][$_SESSION["CURRENT"]]["EXPL"]["TEXT_QUERY"]="";
}
break;
default:
print $sc->show_form("./catalog.php?categ=search&mode=8&option_show_notice_fille=$option_show_notice_fille&option_show_expl=$option_show_expl","./catalog.php?categ=search&mode=8&sub=launch");
break;
}
function print_results($sc,$table,$url,$url_to_search_form,$hidden_form=true,$search_target="") {
global $dbh;
global $begin_result_liste;
global $nb_per_page_search;
global $page;
global $charset;
global $search;
global $msg;
global $pmb_nb_max_tri;
global $affich_tris_result_liste;
global $pmb_allow_external_search;
global $show_results_data;
global $option_show_expl,$option_show_notice_fille;
global $gestion_acces_active, $gestion_acces_user_notice;
global $PMBuserid;
global $explr_invisible, $pmb_droits_explr_localises;
//droits d'acces lecture notice
if ($gestion_acces_active==1 && $gestion_acces_user_notice==1) {
$ac= new acces();
$dom_1= $ac->setDomain(1);
$usr_prf = $dom_1->getUserProfile($PMBuserid);
$requete = "delete from $table using $table, exemplaires, acces_res_1 ";
$requete.= "where ";
$requete.= "$table.expl_id=exemplaires.expl_id ";
$requete.= "and expl_bulletin=0 ";
$requete.= "and expl_notice = res_num ";
$requete.= "and usr_prf_num=".$usr_prf." and (((res_rights ^ res_mask) & 4)=0) ";
pmb_mysql_query($requete, $dbh);
$requete = "delete from $table using $table, exemplaires, bulletins, acces_res_1 ";
$requete.= "where ";
$requete.= "$table.expl_id=exemplaires.expl_id ";
$requete.= "and expl_notice=0 ";
$requete.= "and expl_bulletin=bulletin_id ";
$requete.= "and bulletin_notice=res_num ";
$requete.= "and usr_prf_num=".$usr_prf." and (((res_rights ^ res_mask) & 4)=0) ";
pmb_mysql_query($requete, $dbh);
}
//visibilité des exemplaires
if ($pmb_droits_explr_localises && $explr_invisible) {
$requete = "delete from $table using $table, exemplaires ";
$requete.= "where ";
$requete.= "$table.expl_id=exemplaires.expl_id ";
$requete.= "and expl_location in ($explr_invisible)";
pmb_mysql_query($requete, $dbh);
}
$start_page=$nb_per_page_search*$page;
$requete="select count(1) from $table";
$res = pmb_mysql_query($requete);
if($res)
$nb_results=pmb_mysql_result(pmb_mysql_query($requete),0,0);
else $nb_results=0;
$requete="select $table.* from ".$table.", exemplaires where exemplaires.expl_id=$table.expl_id";
if ( $nb_results > $nb_per_page_search ) {
$requete .= " limit ".$start_page.", ".$nb_per_page_search;
}
//Y-a-t-il une erreur lors de la recherche ?
if ($sc->error_message) {
error_message_history("", $sc->error_message, 1);
exit();
}
if ($hidden_form) print $sc->make_hidden_search_form($url);
$resultat=pmb_mysql_query($requete,$dbh);
$human_requete = $sc->make_human_query();
print "".$msg["search_search_exemplaire"]." : ".$human_requete ;
if ($nb_results) {
print " => ".$nb_results." ".$msg["search_expl_nb_result"]."
\n";
print $begin_result_liste;
if ($sc->rec_history) {
//Affichage des liens paniers et impression
$current=$_SESSION["CURRENT"];
if ($current!==false) {
print " ";
// if ($nb_results<=$pmb_nb_max_tri) print $affich_tris_result_liste;
}
}
} else print "
".$msg["1915"]." ";
print searcher::get_quick_actions("EXPL");
print "
";
// transformation de la recherche en multicritères: on reposte tout avec mode=6
print " ";
print searcher::get_check_uncheck_all_buttons();
print "