";
$r.="";
$requete="select location_libelle,idlocation from docs_location where location_visible_opac=1";
$result = mysql_query($requete, $dbh);
if (mysql_numrows($result)){
while ($loc = mysql_fetch_object($result)) {
$selected="";
if ($cnl_bibli==$loc->idlocation) {$selected="selected='selected'";}
$r.= "";
}
}
$r.="";
return $r;
}
function search_other_function_get_values(){
global $cnl_bibli;
return $cnl_bibli;
}
function search_other_function_clause() {
global $cnl_bibli;
$cnl_bibli+=0;
if ($cnl_bibli) {
$r = "select distinct notice_id from notices where notice_id in ( ";
//notices de mono dont un exemplaire est localise a $cnl_bibli
$r.= "select expl_notice from exemplaires where expl_bulletin='0' AND expl_location='$cnl_bibli' ";
//notices de pério dont un exemplaire de bulletin est localise a $cnl_bibli
$r.= "UNION select DISTINCT bulletin_notice from bulletins join exemplaires on expl_bulletin=bulletin_id AND expl_notice=0 where expl_location='$cnl_bibli' ";
//notices de bulletins dont un exemplaire est localise a $cnl_bibli
$r.= "UNION select DISTINCT num_notice from bulletins join exemplaires on expl_bulletin=bulletin_id AND expl_notice=0 where expl_location='$cnl_bibli' ";
//notices d'articles rattachées a des bulletins dont un exemplaire est localise a $cnl_bibli
$r.= "UNION select analysis_notice from analysis join bulletins on analysis_bulletin=bulletin_id join exemplaires on expl_bulletin=bulletin_id AND expl_notice=0 where expl_location='$cnl_bibli' ";
//notices de mono/périodique/article dont un exemplaire numérique est localise a $cnl_bibli ou dans toutes les localisations
$r.= "UNION select DISTINCT explnum_notice from explnum LEFT JOIN explnum_location ON explnum_id=num_explnum WHERE explnum_bulletin='0' AND (num_location='$cnl_bibli' OR num_location IS NULL) ";
//notices de bulletin dont un exemplaire numérique est localise a $cnl_bibli ou dans toutes les localisations
$r.= "UNION select DISTINCT num_notice from bulletins JOIN explnum ON explnum_bulletin=bulletin_id AND explnum_notice='0' LEFT JOIN explnum_location ON explnum_id=num_explnum WHERE num_location='$cnl_bibli' OR num_location IS NULL ";
$r.= ")";
}
return $r;
}
function search_other_function_has_values() {
global $cnl_bibli;
if ($cnl_bibli) return true;
else return false;
}
function search_other_function_rec_history($n) {
global $cnl_bibli;
$_SESSION["cnl_bibli".$n]=$cnl_bibli;
}
function search_other_function_get_history($n) {
global $cnl_bibli;
$cnl_bibli=$_SESSION["cnl_bibli".$n];
}
function search_other_function_human_query($n) {
global $dbh,$msg,$charset;
global $cnl_bibli;
$r="";
$cnl_bibli=$_SESSION["cnl_bibli".$n];
if ($cnl_bibli) {
$r=htmlentities($msg["search_loc_mpba_bib"],ENT_QUOTES,$charset)." : ";
$requete="select location_libelle from docs_location where idlocation='".$cnl_bibli."' limit 1";
$res=mysql_query($requete);
$r.=@mysql_result($res,0,0);
}
return $r;
}
function search_other_function_post_values() {
global $cnl_bibli;
return "\n";
}