link = './catalog.php?categ=isbd&id=!!id!!'; $sc->link_expl = './catalog.php?categ=edit_expl&id=!!notice_id!!&cb=!!expl_cb!!&expl_id=!!expl_id!!'; $sc->link_expl_bull = './catalog.php?categ=serials&sub=bulletinage&action=expl_form&bul_id=!!bulletin_id!!&expl_id=!!expl_id!!'; $sc->link_explnum = './catalog.php?categ=edit_explnum&id=!!notice_id!!&explnum_id=!!explnum_id!!'; $sc->link_serial = './catalog.php?categ=serials&sub=view&serial_id=!!id!!'; $sc->link_analysis = './catalog.php?categ=serials&sub=bulletinage&action=view&bul_id=!!bul_id!!&art_to_show=!!id!!'; $sc->link_bulletin = './catalog.php?categ=serials&sub=bulletinage&action=view&bul_id=!!id!!'; $sc->link_explnum_serial = "./catalog.php?categ=serials&sub=analysis&action=explnum_form&bul_id=!!bul_id!!&analysis_id=!!analysis_id!!&explnum_id=!!explnum_id!!"; switch ($sub) { case "launch": if ((string)$page=="") { $_SESSION["CURRENT"]=count($_SESSION["session_history"]); $_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_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) "; mysql_query($requete, $dbh); $requete = "delete from $table using $table, exemplaires, 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) "; 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)"; mysql_query($requete, $dbh); } $start_page=$nb_per_page_search*$page; $requete="select count(1) from $table"; $res = mysql_query($requete); if($res) $nb_results=mysql_result(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 > $sc->nb_per_page ) { $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=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 " \"".$msg["histo_add_to_cart"]."\" "; // if ($nb_results<=$pmb_nb_max_tri) print $affich_tris_result_liste; } } } else print "
".$msg["1915"]." "; print ""; // transformation de la recherche en multicritères: on reposte tout avec mode=6 print " "; print "
"; foreach($_POST as $key =>$val) { if($val) { if(is_array($val)) { foreach($val as $cle=>$val_array) { if(is_array($val_array)){ foreach($val_array as $valeur){ print ""; } } else print ""; } } else print ""; } } print "
"; $recherche_ajax_mode=0; $nb=0; if($resultat){ while ($r=mysql_fetch_object($resultat)) { $requete2="SELECT expl_bulletin FROM exemplaires WHERE expl_id='".$r->expl_id."'"; $res=mysql_query($requete2); if($res && mysql_num_rows($res) && mysql_result($res,0,0)){ $nt = new mono_display_expl('',$r->expl_id, 6, $sc->link_bulletin, $option_show_expl, $sc->link_expl_bull, '', $sc->link_explnum,1, 0, 1, !$option_show_notice_fille, "", 1); }else{ $nt = new mono_display_expl('',$r->expl_id, 6, $sc->link, $option_show_expl, $sc->link_expl, '', $sc->link_explnum,1, 0, 1, !$option_show_notice_fille, "", 1); } echo "
".$nt->result.$aff."
"; } } //Gestion de la pagination if ($nb_results) { $n_max_page=ceil($nb_results/$nb_per_page_search); if (!$page) $page_en_cours=0 ; else $page_en_cours=$page ; // affichage du lien précédant si nécessaire if ($page>0) { $nav_bar .= ""; $nav_bar .= "[".$msg[48]."]"; $nav_bar .= ""; } $deb = $page_en_cours - 10 ; if ($deb<0) $deb=0; for($i = $deb; ($i < $n_max_page) && ($i<$page_en_cours+10); $i++) { if($i==$page_en_cours) $nav_bar .= "".($i+1).""; else { $nav_bar .= ""; $nav_bar .= ($i+1); $nav_bar .= ""; } if($i<$n_max_page) $nav_bar .= " "; } if(($page+1)<$n_max_page) { $nav_bar .= ""; $nav_bar .= "[".$msg[49]."]"; $nav_bar .= ""; } else $nav_bar .= ""; $nav_bar = "
$nav_bar
"; echo $nav_bar ; } } ?>