Lien de retour sur la sur-localisation * back_loc => Lien de retour sur la localisation * back_section_see => Lien de retour sur image (home) * */ //Attaques XSS et injection SQL if(isset($nc)){ $nc = intval($nc); } if(isset($lcote)){ $lcote = intval($lcote); } if(isset($ssub)){ $ssub = intval($ssub); } if(isset($plettreaut)){ $plettreaut=pmb_alphabetic("^a-z0-9A-Z\-\s","",$plettreaut); } if(isset($dcote)){ $req="SELECT count(expl_id) FROM exemplaires WHERE expl_cote LIKE '".addslashes($dcote)."%' "; $res=pmb_mysql_query($req); if(!$res || !pmb_mysql_result($res,0,0)){ $dcote=""; } } $location = intval($location); show_localisation::set_num_location($location); if (!$location) { //Il n'y a pas de localisation selectionnée, afficher les localisations print "
\n"; print "

".htmlentities($msg["l_browse_bibliotheques"],ENT_QUOTES,$charset)."

"; print "
\n"; print show_localisation::get_display_list(); } else { // id localisation fournie $requete="select location_libelle,surloc_num, location_pic, name, adr1, adr2, cp, town, state, country, phone, email, website, commentaire, show_a2z from docs_location where idlocation='$location' and location_visible_opac=1"; $resultat=pmb_mysql_query($requete); $objloc=pmb_mysql_fetch_object($resultat); if (isset($back_surloc) && $back_surloc) $param_surloc = "&back_surloc=".rawurlencode($back_surloc); else $param_surloc=""; $url_loc ="index.php?lvl=section_see&location=".$location; if (isset($back_section_see) && $back_section_see) $param_section_see = "&back_section_see=".$back_section_see; else $param_section_see=""; if (isset($back_loc) && $back_loc) $location_link=" ". htmlentities($objloc->location_libelle,ENT_QUOTES,$charset).""; else $location_link=" ".htmlentities($objloc->location_libelle,ENT_QUOTES,$charset); $sur_location_link=""; if ($opac_sur_location_activate==1){ $requete="select surloc_id, surloc_libelle, surloc_pic, surloc_css_style from sur_location where surloc_id='$objloc->surloc_num'"; $resultat=pmb_mysql_query($requete); if (pmb_mysql_num_rows($resultat)) { if ($r=pmb_mysql_fetch_object($resultat)) { if (!empty($back_surloc)) $url_surloc = $back_surloc; else $url_surloc = "index.php?lvl=section_see&surloc=".$r->surloc_id; $sur_location_link=" ". htmlentities( $r->surloc_libelle,ENT_QUOTES,$charset).""; } } } print "
\n"; if (isset($back_section_see) && $back_section_see) $url_section_see = $back_section_see; else $url_section_see = "index.php?lvl=section_see"; print "

home".$sur_location_link.$location_link."

"; if ($objloc->commentaire || $objloc->location_pic) { print "
"; if ($objloc->location_pic) print " location"; else print " "; print ""; if ($objloc->commentaire) print $objloc->commentaire; else print " "; print "
"; } $Fnm = "includes/mw_liste_type.inc.php"; if (file_exists($Fnm)) { include($Fnm);} print "
\n"; //Il n'y a pas de section sélectionnée $id = intval($id); show_localisation::set_num_section($id); if (!$id) { print show_localisation::get_display_sections_list(); if ($objloc->show_a2z) { require_once($base_path."/classes/perio_a2z.class.php"); $a2z=new perio_a2z(0,$opac_perio_a2z_abc_search,$opac_perio_a2z_max_per_onglet); print $perio_a2z=$a2z->get_form(); } } else { //enregistrement de l'endroit actuel dans la session rec_last_authorities(); $location = intval($location); if (!empty($back_surloc)) { $ajout_back = "&back_surloc=".rawurlencode($back_surloc)."&back_loc=".rawurlencode($url_loc).$param_section_see; } else { $ajout_back = ""; } $requete="select section_libelle, section_pic from docs_section where idsection=$id"; $section_libelle=pmb_mysql_result(pmb_mysql_query($requete),0,0); $section_pic=pmb_mysql_result(pmb_mysql_query($requete),0,1); if ($section_pic) $image_src = $section_pic ; else $image_src = get_url_icon("rayonnage-small.png") ; print "

"; if (!file_exists($Fnm)) { print "".$msg["l_rayons"]." "; } $requete="SELECT num_pclass FROM docsloc_section WHERE num_location='".$location."' AND num_section='".$id."' "; $res=pmb_mysql_query($requete); $type_aff_navigopac=0; if(pmb_mysql_num_rows($res)){ $type_aff_navigopac=pmb_mysql_result($res,0,0); } //droits d'acces emprunteur/notice show_localisation::init_query_restricts(); if($type_aff_navigopac == 0){//Pas de navigation print pmb_bidi($section_libelle); print "

\n"; print "
"; //On récupère les notices de monographie avec au moins un exemplaire dans la localisation et la section $requete="create temporary table temp_n_id ENGINE=MyISAM ( ".show_localisation::get_query_records_items('notice_id', '', 'notice_id')." )"; pmb_mysql_query($requete); //On récupère les notices de périodique avec au moins un exemplaire d'un bulletin dans la localisation et la section $requete="INSERT INTO temp_n_id ( ".show_localisation::get_query_serials_items('notice_id', '', 'notice_id')." )"; pmb_mysql_query($requete); @pmb_mysql_query("alter table temp_n_id add index(notice_id)"); $requete = "SELECT notices.notice_id FROM temp_n_id JOIN notices ON notices.notice_id=temp_n_id.notice_id GROUP BY notices.notice_id"; $nbr_lignes=pmb_mysql_num_rows(pmb_mysql_query($requete)); show_localisation::affiche_notice_navigopac($requete); }elseif($type_aff_navigopac == -1){//Navigation par auteurs //On récupère les notices de monographie avec au moins un exemplaire dans la localisation et la section $requete="create temporary table temp_n_id ENGINE=MyISAM ( ".show_localisation::get_query_records_items('notice_id', '', 'notice_id')." )"; pmb_mysql_query($requete); //On récupère les notices de périodique avec au moins un exemplaire d'un bulletin dans la localisation et la section $requete="INSERT INTO temp_n_id ( ".show_localisation::get_query_serials_items('notice_id', '', 'notice_id')." )"; pmb_mysql_query($requete); @pmb_mysql_query("alter table temp_n_id add index(notice_id)"); if(!$plettreaut){ $nb_auteur_max=18; //On a pas encore choisi de première lettre d'auteur print pmb_bidi($section_libelle); print " > ".$msg["navigopac_aut"]; print "\n"; //On va chercher tous les auteurs des notices $requete = "SELECT IF(SUBSTRING(TRIM(index_author),1,1) != '' ,SUBSTRING(TRIM(index_author),1,1),'vide') as plettre, COUNT(1) as nb FROM temp_n_id LEFT JOIN responsability ON responsability_notice=notice_id LEFT JOIN authors ON author_id=responsability_author GROUP BY IF(index_author IS NOT NULL and TRIM(index_author) !='',SUBSTRING(TRIM(index_author),1,1),index_author) ORDER BY 1"; $res=pmb_mysql_query($requete); $tab_aut=array(); while ($ligne = pmb_mysql_fetch_object($res)) { //echo " Lettre : ".$ligne->plettre." Nombre : ".$ligne->nb."
"; if($ligne->plettre == "vide"){ if($tab_aut[$ligne->plettre]){ $nb=$tab_aut[$ligne->plettre][0]+$ligne->nb; $tab_aut[$ligne->plettre]=array($nb,$msg["navigopac_ss_aut"]); }else{ $tab_aut[$ligne->plettre]=array($ligne->nb,$msg["navigopac_ss_aut"]); } }elseif(preg_match("#[0-9]#",$ligne->plettre)){ if($tab_aut["num"]){ $nb=$tab_aut["num"][0]+$ligne->nb; $tab_aut["num"]=array($nb,"0-9"); }else{ $tab_aut["num"]=array($ligne->nb,"0-9"); } }else{ $tab_aut[mb_strtoupper($ligne->plettre)]=array($ligne->nb,mb_strtoupper($ligne->plettre)); } } while(count($tab_aut) > $nb_auteur_max){//Pour minimiser le nombre d'étagère à afficher //Je vais chercher deux valeurs qui peuvent être regroupées $coupl_plus_petit=10000000; $ancienne_valeur=0; $ancienne_lettre=""; $lettre_a_regoupe=array(); foreach ($tab_aut as $key => $value ) { if($key != "num" && $key != "vide"){ if($ancienne_valeur && ($ancienne_valeur + $value[0] < $coupl_plus_petit)){ $coupl_plus_petit=$ancienne_valeur + $value[0]; $lettre_a_regoupe=array($ancienne_lettre,$key); } $ancienne_valeur=$value[0]; $ancienne_lettre=$key; } } //J'en regroupe deux $new_key=substr($lettre_a_regoupe[0],0,1)."-".substr($lettre_a_regoupe[1],-1); $tab_aut[$new_key]=array(($tab_aut[$lettre_a_regoupe[0]][0]*1+$tab_aut[$lettre_a_regoupe[1]][0]*1),$new_key); unset($tab_aut[$lettre_a_regoupe[0]]); unset($tab_aut[$lettre_a_regoupe[1]]); ksort($tab_aut); } print ""; $n=0; foreach ( $tab_aut as $key => $value ) { if ($n==0) print ""; print ""; $n++; if ($n==$opac_nb_sections_per_line) { print ""; $n=0; } } if ($n!=0) { while ($n<$opac_nb_sections_per_line) { print ""; $n++; } print ""; } print "
folder".htmlentities($value[1],ENT_QUOTES,$charset)."
"; print "
"; $requete = "SELECT notices.notice_id FROM temp_n_id JOIN notices ON notices.notice_id=temp_n_id.notice_id GROUP BY notices.notice_id"; $nbr_lignes=pmb_mysql_num_rows(pmb_mysql_query($requete)); show_localisation::affiche_notice_navigopac($requete); }else{ //On sait par quoi doit commencer le nom de l'auteur print ""; print pmb_bidi($section_libelle); print ""; if($plettreaut == "num"){ $requete = "SELECT notices.notice_id FROM temp_n_id JOIN responsability ON responsability_notice=temp_n_id.notice_id JOIN authors ON author_id=responsability_author and trim(index_author) REGEXP '^[0-9]' JOIN notices ON notices.notice_id=temp_n_id.notice_id GROUP BY notices.notice_id"; print " > ".$msg["navigopac_aut_com_par_chiffre"]; }elseif($plettreaut == "vide"){ $requete = "SELECT notices.notice_id FROM temp_n_id LEFT JOIN responsability ON responsability_notice=temp_n_id.notice_id LEFT JOIN notices ON notices.notice_id=temp_n_id.notice_id WHERE responsability_author IS NULL GROUP BY notices.notice_id"; print " > ".$msg["navigopac_ss_aut"]; }else{ $requete = "SELECT notices.notice_id FROM temp_n_id JOIN responsability ON responsability_notice=temp_n_id.notice_id JOIN authors ON author_id=responsability_author and trim(index_author) REGEXP '^[".$plettreaut."]' JOIN notices ON notices.notice_id=temp_n_id.notice_id GROUP BY notices.notice_id"; print " > ".$msg["navigopac_aut_com_par"]." ".$plettreaut; } $nbr_lignes=pmb_mysql_num_rows(pmb_mysql_query($requete)); print "\n"; print "
"; show_localisation::affiche_notice_navigopac($requete); } }else{//Navigation par un plan de classement if(!isset($dcote) || !$dcote) { $query = show_localisation::get_query_records_items('distinct SUBSTR(expl_cote,1,1) as dcote'); $query .= " UNION "; $query .= show_localisation::get_query_serials_items('distinct SUBSTR(expl_cote,1,1) as dcote'); $result = pmb_mysql_query($query); if($result && pmb_mysql_num_rows($result) == 1) { //Afin d'afficher les sous-niveaux du premier niveau $dcote = pmb_mysql_result($result, 0, 0); } } if (strlen($dcote)||($nc==1)) print ""; print pmb_bidi($section_libelle); if (strlen($dcote)||($nc==1)) print ""; //Calcul du chemin if (strlen($dcote)) { if (!$ssub) { for ($i=0; $i0) { $cote_n_1=substr($dcote,0,$i); $compl_n_1=str_repeat("0",$lcote-$i); if (($ccote)==($cote_n_1.$compl_n_1)) $chemin=$msg["l_general"]; } if (!$chemin) { $requete="select indexint_name,indexint_comment from indexint where indexint_name='".$ccote."' and num_pclass='".$type_aff_navigopac."'"; $res_ch=pmb_mysql_query($requete); if (pmb_mysql_num_rows($res_ch)) $chemin=pmb_mysql_result(pmb_mysql_query($requete),0,1); else $chemin=$msg["l_unclassified"]; } print " > "; if ((($i+1)"; print pmb_bidi($chemin); if ((($i+1)"; else $theme=$chemin; } } else { $t_dcote=explode(",",$dcote); $requete="select indexint_comment from indexint where indexint_name='".stripslashes($t_dcote[0])."' and num_pclass='".$type_aff_navigopac."'"; $res_ch=pmb_mysql_query($requete); if (pmb_mysql_num_rows($res_ch)) $chemin=pmb_mysql_result(pmb_mysql_query($requete),0,0); else $chemin=$msg["l_unclassified"]; print pmb_bidi(" > ".$chemin); } } if ($nc==1) { print " > ".$msg["l_unclassified"]; $theme=$msg["l_unclassified"]; } print "\n"; if ($ssub) { $t_expl_cote_cond=array(); for ($i=0; $i0) { $zendKey = substr($ct->expl_cote, 0, $lf); if ($zendIndexInt[$zendKey]) { if (!$nc) { $t["comment"]=$zendIndexInt[$zendKey]; $t["dcote"]=$zendKey; $t["ssub"]=1; $index[$t["dcote"]]=$t; break; } else { $rq_del="select distinct notice_id from notices, exemplaires where expl_cote='".$ct->expl_cote."' and expl_notice=notice_id "; $rq_del.=" union select distinct notice_id from notices, exemplaires, bulletins where expl_cote='".$ct->expl_cote."' and expl_bulletin=bulletin_id and bulletin_notice=notice_id "; $res_del=pmb_mysql_query($rq_del) ; if (pmb_mysql_num_rows($res_del)) { while ($n_id=pmb_mysql_fetch_object($res_del)) { pmb_mysql_query("delete from temp_n_id where notice_id=".$n_id->notice_id." and expl_id=".$n_id->expl_id); } } } } $lf--; } if ($lf==0) { if (preg_match("/[0-9][0-9][0-9]/",$ct->expl_cote,$c)) { $found=false; $lcote=3; $level=$level_ref; while ((!$found)&&($level<=$lcote)) { $cote=substr($c[0],0,$level); $compl=str_repeat("0",$lcote-$level); $rq_index="select indexint_name,indexint_comment from indexint where indexint_name='".$cote.$compl."' and length(indexint_name)>=$lcote and indexint_comment!='' and num_pclass='".$type_aff_navigopac."' order by indexint_name limit 1 "; $res_index_1=pmb_mysql_query($rq_index); if (pmb_mysql_num_rows($res_index_1)) { $name=pmb_mysql_result($res_index_1,0,0); if (!$nc) { if (substr($name,0,$level-1)==$dcote) { $t["comment"]=pmb_mysql_result($res_index_1,0,1); if ($level>1) { $cote_n_1=substr($c[0],0,$level-1); $compl_n_1=str_repeat("0",$lcote-$level+1); if (($cote.$compl)==($cote_n_1.$compl_n_1)) $t["comment"]="Généralités"; } $t["lcote"]=$lcote; $t["dcote"]=$cote; $index[$name]=$t; $found=true; } else $level++; } else { if (substr($name,0,$level-1)==$dcote) { $rq_del="select distinct notice_id, expl_id from notices, exemplaires where expl_cote='".$ct->expl_cote."' and expl_notice=notice_id "; $rq_del.=" union select distinct notice_id, expl_id from notices, exemplaires, bulletins where expl_cote='".$ct->expl_cote."' and expl_bulletin=bulletin_id and bulletin_notice=notice_id "; $res_del=pmb_mysql_query($rq_del); if (pmb_mysql_num_rows($res_del)) { while ($n_id=pmb_mysql_fetch_object($res_del)) { pmb_mysql_query("delete from temp_n_id where notice_id=".$n_id->notice_id." and expl_id=".$n_id->expl_id); } } $found=true; } else $level++; } } else $level++; } if (($level>$lcote)&&($lf==0)) { $t["comment"]=$msg["l_unclassified"]; $t["lcote"]=$lcote; $t["dcote"]=$dcote; $index["NC"]=$t; } } else { $t["comment"]=$msg["l_unclassified"]; $t["lcote"]=$lcote; $t["dcote"]=$dcote; $index["NC"]=$t; } } } } if ($nc) { $nbr_lignes=pmb_mysql_result(pmb_mysql_query("select count(1) from temp_n_id"),0,0); } if ($nbr_lignes) { //Affichage des sous catégories if (count($index)>1) { if (!strlen($dcote)) print pmb_bidi(sprintf($msg["l_etageres"],htmlentities($section_libelle,ENT_QUOTES,$charset))); else if (strlen($dcote)==1) print pmb_bidi(sprintf($msg["l_themes"],htmlentities($theme,ENT_QUOTES,$charset))); else pmb_bidi(print sprintf($msg["l_sub_themes"],htmlentities($theme,ENT_QUOTES,$charset))); reset($index); $ssub_val=array(); //Regroupement des libellés identiques hors dewey foreach ($index as $key => $val) { if ($val["ssub"]) { if ($ssub_val[$val["comment"]]) { $ssub_val[$val["comment"]]["dcote"].=",".$val["dcote"]; } else { $ssub_val[$val["comment"]]=$val; } } else { $ssub_val[$val["comment"]."@ssub"]=$val; } } //Affichage du classement si il reste suffisamment de catégories if (count($ssub_val)>1) { $opac_categories_nb_col_subcat; $cur_col=0; reset($ssub_val); asort($ssub_val); print ""; foreach ($ssub_val as $key => $val) { if ($cur_col==0) print ""; if (($key=="NC")||($key==$msg["l_unclassified"]."@ssub")) $nc1=1; else $nc1=0; print ""; $cur_col++; if ($cur_col==$opac_categories_nb_col_subcat) { print ""; $cur_col=0; } } if ($cur_col<$opac_categories_nb_col_subcat) { for ($i=$cur_col; $i<$opac_categories_nb_col_subcat; $i++) { print ""; } print ""; } print "
folder".htmlentities($val["comment"],ENT_QUOTES,$charset)."
 

"; } } print "
"; $requete = "SELECT DISTINCT notices.notice_id FROM temp_n_id JOIN notices ON notices.notice_id=temp_n_id.notice_id GROUP BY notices.notice_id"; show_localisation::affiche_notice_navigopac($requete); } else { print "

$msg[categ_empty]

"; } } else { print "
$msg[categ_empty]

"; } } } } print "\n"; print "\n";