Exemplo n.º 1
0
 function get_primaldata()
 {
     global $dbh;
     $requete = "SELECT * FROM sub_collections WHERE sub_coll_id='" . addslashes($this->id) . "' ";
     $result = pmb_mysql_query($requete, $dbh);
     if (pmb_mysql_num_rows($result)) {
         $obj = pmb_mysql_fetch_object($result);
         pmb_mysql_free_result($result);
         $this->get_primaldatafrom($obj);
     } else {
         // pas de sous-collection avec cette clé
         $this->id = 0;
         $this->name = '';
         $this->parent = '';
         $this->parent_libelle = '';
         $this->parent_isbd = '';
         $this->publisher = '';
         $this->publisher_libelle = '';
         $this->publisher_isbd = '';
         $this->display = '';
         $this->issn = '';
         $this->isbd_entry = '';
         $this->comment = '';
     }
 }
Exemplo n.º 2
0
 function get_primaldata()
 {
     global $dbh;
     $requete = "SELECT * FROM authors WHERE author_id='" . addslashes($this->id) . "' LIMIT 1 ";
     $result = @pmb_mysql_query($requete, $dbh);
     if (pmb_mysql_num_rows($result)) {
         $obj = pmb_mysql_fetch_object($result);
         pmb_mysql_free_result($result);
         $this->get_primaldatafrom($obj);
     } else {
         // pas d'auteur avec cette clé
         $this->id = 0;
         $this->type = '';
         $this->name = '';
         $this->rejete = '';
         $this->date = '';
         $this->see = '';
         $this->display = '';
         $this->isbd_entry = '';
         $this->author_web = '';
         $this->author_comment = '';
         $this->subdivision = '';
         $this->lieu = '';
         $this->salle = '';
         $this->ville = '';
         $this->pays = '';
         $this->numero = '';
     }
 }
Exemplo n.º 3
0
 function getData()
 {
     global $dbh;
     global $msg;
     if (!$this->idetagere) {
         // pas d'identifiant.
         $this->name = '';
         $this->comment = '';
         $this->autorisations = "";
         $this->validite = "";
         $this->validite_date_deb = "";
         $this->validite_date_fin = "";
         $this->validite_date_deb_f = "";
         $this->validite_date_fin_f = "";
         $this->visible_accueil = "";
         $this->id_tri = 0;
         $this->thumbnail_url = '';
         $this->classementGen = '';
     } else {
         $requete = "SELECT idetagere, name, comment, validite, ";
         $requete .= "validite_date_deb, date_format(validite_date_deb, '" . $msg["format_date"] . "') as validite_date_deb_f,  ";
         $requete .= "validite_date_fin, date_format(validite_date_fin, '" . $msg["format_date"] . "') as validite_date_fin_f,  ";
         $requete .= "visible_accueil, autorisations, id_tri, thumbnail_url, etagere_classement FROM etagere WHERE idetagere='{$this->idetagere}' ";
         $result = @pmb_mysql_query($requete, $dbh);
         if (pmb_mysql_num_rows($result)) {
             $temp = pmb_mysql_fetch_object($result);
             pmb_mysql_free_result($result);
             $this->idetagere = $temp->idetagere;
             $this->name = $temp->name;
             $this->comment = $temp->comment;
             $this->validite = $temp->validite;
             $this->validite_date_deb = $temp->validite_date_deb;
             $this->validite_date_deb_f = $temp->validite_date_deb_f;
             $this->validite_date_fin = $temp->validite_date_fin;
             $this->validite_date_fin_f = $temp->validite_date_fin_f;
             $this->visible_accueil = $temp->visible_accueil;
             $this->autorisations = $temp->autorisations;
             $this->id_tri = $temp->id_tri;
             $this->thumbnail_url = $temp->thumbnail_url;
             $this->thumbnail_url = $temp->etagere_classsement;
         } else {
             // pas de caddie avec cet id
             $this->idetagere = 0;
             $this->name = "";
             $this->comment = "";
             $this->validite = "";
             $this->validite_date_deb = "";
             $this->validite_date_fin = "";
             $this->validite_date_deb_f = "";
             $this->validite_date_fin_f = "";
             $this->visible_accueil = "";
             $this->autorisations = "";
             $this->id_tri = '';
             $this->thumbnail_url = '';
             $this->classementGen = '';
         }
     }
 }
Exemplo n.º 4
0
 function getData()
 {
     global $dbh;
     if (!$this->id) {
         // pas d'identifiant. on retourne un tableau vide
         $this->id = 0;
         $this->name = '';
         $this->parent = 0;
         $this->editeur = '';
         $this->editor_isbd = '';
         $this->display = '';
         $this->issn = '';
         $this->collection_web = '';
         $this->comment = '';
     } else {
         $requete = "SELECT * FROM collections WHERE collection_id={$this->id} LIMIT 1 ";
         $result = @pmb_mysql_query($requete, $dbh);
         if (pmb_mysql_num_rows($result)) {
             $temp = pmb_mysql_fetch_object($result);
             pmb_mysql_free_result($result);
             $this->id = $temp->collection_id;
             $this->name = $temp->collection_name;
             $this->parent = $temp->collection_parent;
             $this->issn = $temp->collection_issn;
             $this->collection_web = $temp->collection_web;
             $this->comment = $temp->collection_comment;
             if ($temp->collection_web) {
                 $this->collection_web_link = " <a href='{$temp->collection_web}' target=_blank><img src='./images/globe.gif' border=0 /></a>";
             } else {
                 $this->collection_web_link = "";
             }
             $editeur = new editeur($temp->collection_parent);
             $this->editor_isbd = $editeur->isbd_entry;
             $this->issn ? $this->isbd_entry = $this->name . ', ISSN ' . $this->issn : ($this->isbd_entry = $this->name);
             $this->editeur = $editeur->name;
             $this->display = $this->name . ' (' . $this->editeur . ')';
             // Ajoute un lien sur la fiche collection si l'utilisateur à accès aux autorités
             if (SESSrights & AUTORITES_AUTH) {
                 $this->isbd_entry_lien_gestion = "<a href='./autorites.php?categ=collections&sub=collection_form&id=" . $this->id . "' class='lien_gestion'>" . $this->name . "</a>";
             } else {
                 $this->isbd_entry_lien_gestion = $this->name;
             }
         } else {
             // pas de collection avec cette clé
             $this->id = 0;
             $this->name = '';
             $this->parent = 0;
             $this->editeur = '';
             $this->editor_isbd = '';
             $this->display = '';
             $this->issn = '';
             $this->collection_web = '';
             $this->collection_web_link = "";
             $this->comment = "";
         }
     }
 }
Exemplo n.º 5
0
function show_results($dbh, $user_input, $nbr_lignes = 0, $page = 0, $id = 0)
{
    global $nb_per_page;
    global $base_url;
    global $caller;
    global $msg;
    global $no_display;
    global $charset;
    // on récupére le nombre de lignes qui vont bien
    if ($user_input == "") {
        $requete = "SELECT COUNT(1) FROM notices where notice_id!='" . $no_display . "' and niveau_biblio='s' and niveau_hierar='1' ";
    } 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;
        }
        $members = $aq->get_query_members("notices", "index_wew", "index_sew", "notice_id");
        $requete = "select count(notice_id) from notices where (" . $members["where"] . " or code like '" . stripslashes($user_input) . "') and notice_id!='" . $no_display . "' and niveau_biblio='s' and niveau_hierar='1'";
    }
    $res = pmb_mysql_query($requete, $dbh);
    $nbr_lignes = @pmb_mysql_result($res, 0, 0);
    if (!$page) {
        $page = 1;
    }
    $debut = ($page - 1) * $nb_per_page;
    if ($nbr_lignes) {
        // on lance la vraie requête
        if ($user_input == "") {
            $requete = "SELECT notice_id, tit1, code FROM notices where notice_id!='" . $no_display . "' and niveau_biblio='s' and niveau_hierar='1' ORDER BY tit1, code LIMIT {$debut},{$nb_per_page} ";
        } else {
            $requete = "select notice_id, tit1, code, " . $members["select"] . " as pert from notices where (" . $members["where"] . " or code like '" . stripslashes($user_input) . "') and notice_id!='" . $no_display . "' and niveau_biblio='s' and niveau_hierar='1' group by notice_id order by pert desc, index_serie, tnvol, index_sew, code limit {$debut},{$nb_per_page}";
        }
        $res = @pmb_mysql_query($requete, $dbh);
        print "<table><tr>";
        while ($notice = pmb_mysql_fetch_object($res)) {
            $notice_entry = $notice->tit1 . "&nbsp;" . $notice->code;
            print "\n\t\t\t\t<tr>\n\t\t\t\t\t<td>\n\t\t\t\t\t\t<a href='#' onclick=\"set_parent('{$caller}', '{$notice->notice_id}', '" . htmlentities(addslashes($notice->tit1), ENT_QUOTES, $charset) . " ({$notice->code})')\">" . htmlentities($notice->tit1, ENT_QUOTES, $charset) . "</a></td>\n\t\t\t\t\t<td>{$notice->code}</td>";
            print "</tr>";
        }
        print "</table>";
        pmb_mysql_free_result($res);
        // constitution des liens
        $nbepages = ceil($nbr_lignes / $nb_per_page);
        $suivante = $page + 1;
        $precedente = $page - 1;
    }
    // affichage de la pagination
    print "<div class='row'>&nbsp;<hr /></div><div align='center'>";
    $url_base = $base_url . "&user_input=" . rawurlencode(stripslashes($user_input));
    $nav_bar = aff_pagination($url_base, $nbr_lignes, $nb_per_page, $page, 10, false, true);
    print $nav_bar;
    print "</div>";
}
Exemplo n.º 6
0
function show_results($dbh, $nbr_lignes = 0, $page = 0)
{
    global $nb_per_page;
    global $base_url;
    global $caller;
    global $charset;
    global $msg;
    global $id_fou;
    // on récupére le nombre de lignes qui vont bien
    $nbr_lignes = types_produits::countTypes();
    if (!$page) {
        $page = 1;
    }
    $debut = ($page - 1) * $nb_per_page;
    if ($nbr_lignes) {
        // on lance la vraie requête
        $q = types_produits::listTypes($debut, $nb_per_page);
        $res = pmb_mysql_query($q, $dbh);
        while ($row = pmb_mysql_fetch_object($res)) {
            $typ = $row->id_produit;
            $lib_typ = $row->libelle;
            $taux_tva = new tva_achats($row->num_tva_achat);
            $lib_tva = htmlentities($taux_tva->taux_tva, ENT_QUOTES, $charset);
            $offre = new offres_remises($id_fou, $row->id_produit);
            if ($offre->remise) {
                $lib_rem = htmlentities($offre->remise, ENT_QUOTES, $charset);
            } else {
                $lib_rem = '0';
            }
            print pmb_bidi("\n\t\t\t<a href='#' onclick=\"set_parent('{$caller}', '{$row->id_produit}', '" . htmlentities(addslashes($lib_typ), ENT_QUOTES, $charset) . "', '{$lib_rem}', '{$lib_tva}'  )\">{$lib_typ}</a>");
            print "<br />";
        }
        pmb_mysql_free_result($res);
        // constitution des liens
        $nbepages = ceil($nbr_lignes / $nb_per_page);
        $suivante = $page + 1;
        $precedente = $page - 1;
        // affichage du lien précédent si nécessaire
        print '<hr /><div align=center>';
        if ($precedente > 0) {
            print "<a href='{$base_url}&page={$precedente}&nbr_lignes={$nbr_lignes}&no_display={$no_display}'><img src='./images/left.gif' border='0' title='{$msg['48']}' alt='[{$msg['48']}]' hspace='3' align='middle' /></a>";
        }
        for ($i = 1; $i <= $nbepages; $i++) {
            if ($i == $page) {
                print "<b>{$i}/{$nbepages}</b>";
            }
        }
        if ($suivante <= $nbepages) {
            print "<a href='{$base_url}&page={$suivante}&nbr_lignes={$nbr_lignes}&no_display={$no_display}'><img src='./images/right.gif' border='0' title='{$msg['49']}' alt='[{$msg['49']}]' hspace='3' align='middle' /></a>";
        }
    }
    print '</div>';
}
Exemplo n.º 7
0
function dsi_list_classements()
{
    global $dbh, $msg;
    global $page, $nbr_lignes;
    global $dsi_list_tmpl;
    global $form_cb;
    // nombre de références par pages
    $nb_per_page = 10;
    if (!$nbr_lignes) {
        $requete = "SELECT COUNT(1) FROM classements ";
        $res = pmb_mysql_query($requete, $dbh);
        $nbr_lignes = @pmb_mysql_result($res, 0, 0);
    }
    if (!$page) {
        $page = 1;
    }
    $debut = ($page - 1) * $nb_per_page;
    if ($nbr_lignes) {
        // on lance la vraie requête
        $requete = "SELECT id_classement, nom_classement, type_classement FROM classements ORDER BY type_classement, nom_classement, id_classement LIMIT {$debut},{$nb_per_page} ";
        $res = @pmb_mysql_query($requete, $dbh);
        $parity = 0;
        while ($clas = pmb_mysql_fetch_object($res)) {
            if ($parity % 2) {
                $pair_impair = "even";
            } else {
                $pair_impair = "odd";
            }
            $tr_javascript = " onmouseover=\"this.className='surbrillance'\" onmouseout=\"this.className='{$pair_impair}'\" onmousedown=\"document.location='./dsi.php?categ=options&sub=classements&id_classement={$clas->id_classement}&suite=acces';\" ";
            $empr_list .= "<tr class='{$pair_impair}' {$tr_javascript} style='cursor: pointer'>";
            $empr_list .= "\n\t\t\t\t<td>\n\t\t\t\t\t<strong>" . $msg['dsi_clas_type_class_' . $clas->type_classement] . "</strong>\n\t\t\t\t\t</td>\n\t\t\t\t<td>\n\t\t\t\t\t<strong>{$clas->nom_classement}</strong>\n\t\t\t\t\t</td>\n\t\t\t\t</tr>";
            $parity += 1;
        }
        pmb_mysql_free_result($res);
        // affichage de la barre de navig
        $url_base = "{$PHP_SELF}?categ=options&sub=classements";
        $nav_bar = aff_pagination($url_base, $nbr_lignes, $nb_per_page, $page, 10, false, true);
        if ($nbr_lignes > 0) {
            $dsi_list_tmpl = str_replace("<!--!!nb_total!!-->", "(" . $nbr_lignes . ")", $dsi_list_tmpl);
        }
        $dsi_list_tmpl = str_replace("!!cle!!", $form_cb, $dsi_list_tmpl);
        $dsi_list_tmpl = str_replace("!!list!!", $empr_list, $dsi_list_tmpl);
        $dsi_list_tmpl = str_replace("!!nav_bar!!", $nav_bar, $dsi_list_tmpl);
        $dsi_list_tmpl = str_replace("!!message_trouve!!", "", $dsi_list_tmpl);
        $ajout = "<br /><input type='button' class='bouton' value='{$msg['dsi_clas_ajouter']}' onclick=\"document.location='./dsi.php?categ=options&sub=classements&suite=add'\" />";
        return $dsi_list_tmpl . $ajout;
    } else {
        return "";
    }
}
Exemplo n.º 8
0
function affiche_notice_navigopac($requete)
{
    global $page, $nbr_lignes, $id, $location, $dcote, $lcote, $nc, $main, $ssub, $plettreaut;
    global $opac_nb_aut_rec_per_page, $opac_section_notices_order, $msg, $dbh, $opac_notices_depliable, $begin_result_liste, $add_cart_link_spe, $base_path;
    global $back_surloc, $back_loc, $back_section_see;
    global $opac_perio_a2z_abc_search, $opac_perio_a2z_max_per_onglet;
    if (!$page) {
        $page = 1;
    }
    $debut = ($page - 1) * $opac_nb_aut_rec_per_page;
    //On controle paramètre de tri
    if (!trim($opac_section_notices_order)) {
        $opac_section_notices_order = "index_serie, tnvol, index_sew";
    }
    if ($plettreaut && $plettreaut != "vide") {
        $opac_section_notices_order = "index_author, " . $opac_section_notices_order;
    }
    $requete .= " ORDER BY " . $opac_section_notices_order . " LIMIT {$debut},{$opac_nb_aut_rec_per_page}";
    $res = @pmb_mysql_query($requete, $dbh);
    print $nbr_lignes . " " . $msg["results"] . "<br />";
    if ($opac_notices_depliable) {
        print $begin_result_liste;
    }
    if ($add_cart_link_spe) {
        print pmb_bidi(str_replace("!!spe!!", "&location={$location}&dcote={$dcote}&lcote={$lcote}&ssub={$ssub}&nc={$nc}&plettreaut={$plettreaut}", $add_cart_link_spe));
    }
    //affinage
    //enregistrement de l'endroit actuel dans la session
    $_SESSION["last_module_search"]["search_mod"] = "section_see";
    $_SESSION["last_module_search"]["search_id"] = $id;
    $_SESSION["last_module_search"]["search_location"] = $location;
    $_SESSION["last_module_search"]["search_page"] = $page;
    //affinage
    if ($dcote == "" && $plettreaut == "" && $nc == "") {
        print "<span class=\"espaceResultSearch\">&nbsp;&nbsp;</span><span class=\"affiner_recherche\"><a href='{$base_path}/index.php?search_type_asked=extended_search&mode_aff=aff_module' title='" . $msg["affiner_recherche"] . "'>" . $msg["affiner_recherche"] . "</a></span>";
    }
    //fin affinage
    print "<blockquote>";
    print aff_notice(-1);
    while ($obj = pmb_mysql_fetch_object($res)) {
        print pmb_bidi(aff_notice($obj->notice_id));
    }
    print aff_notice(-2);
    print "</blockquote>";
    pmb_mysql_free_result($res);
    // constitution des liens
    $nbepages = ceil($nbr_lignes / $opac_nb_aut_rec_per_page);
    print '<div id="navbar"><hr /><center>' . printnavbar($page, $nbepages, './index.php?lvl=section_see&id=' . $id . '&location=' . $location . ($back_surloc ? '&back_surloc=' . urlencode($back_surloc) : '') . ($back_loc ? '&back_loc=' . urlencode($back_loc) : '') . ($back_section_see ? '&back_section_see=' . urlencode($back_section_see) : '') . '&page=!!page!!&nbr_lignes=' . $nbr_lignes . '&dcote=' . $dcote . '&lcote=' . $lcote . '&nc=' . $nc . '&main=' . $main . '&ssub=' . $ssub . '&plettreaut=' . $plettreaut) . '</center></div>';
}
Exemplo n.º 9
0
function show_results($dbh, $user_input, $nbr_lignes = 0, $page = 0, $id = 0)
{
    global $nb_per_page;
    global $base_url;
    global $caller;
    global $class_path;
    global $no_display;
    global $charset;
    global $msg;
    global $dbh;
    // on récupére le nombre de lignes
    if ($user_input == "") {
        $requete = "SELECT empr_cp, empr_ville FROM empr group by empr_cp, empr_ville ";
    } else {
        $requete = "SELECT empr_cp, empr_ville FROM empr where empr_cp like '{$user_input}%' group by empr_cp, empr_ville ";
    }
    $res = pmb_mysql_query($requete, $dbh);
    $nbr_lignes = pmb_mysql_num_rows($res);
    if (!$page) {
        $page = 1;
    }
    $debut = ($page - 1) * $nb_per_page;
    if ($nbr_lignes) {
        // on lance la vraie requête
        if ($user_input == "") {
            $requete = "SELECT empr_cp, empr_ville, count(id_empr) as nbre FROM empr group by empr_cp, empr_ville ORDER BY empr_cp, empr_ville LIMIT {$debut},{$nb_per_page} ";
        } else {
            $requete = "SELECT empr_cp, empr_ville, count(id_empr) as nbre  FROM empr where empr_cp like '{$user_input}%' group by empr_cp, empr_ville ORDER BY empr_cp, empr_ville LIMIT {$debut},{$nb_per_page} ";
        }
        $res = pmb_mysql_query($requete, $dbh);
        while ($cp_ville = pmb_mysql_fetch_object($res)) {
            print "<div class='row'>";
            print pmb_bidi("<a href='#' onclick=\"set_parent('{$caller}', '" . htmlentities(addslashes($cp_ville->empr_ville), ENT_QUOTES, $charset) . "', '" . htmlentities(addslashes($cp_ville->empr_cp), ENT_QUOTES, $charset) . "')\">{$cp_ville->empr_cp} - {$cp_ville->empr_ville} : {$cp_ville->nbre}</a>");
            print "</div>";
        }
        pmb_mysql_free_result($res);
        // constitution des liens
        $nbepages = ceil($nbr_lignes / $nb_per_page);
        $suivante = $page + 1;
        $precedente = $page - 1;
        // affichage de la pagination
        print "<hr /><div align='center'>";
        $url_base = $base_url . "&rech_regexp={$rech_regexp}&user_input=" . rawurlencode(stripslashes($user_input));
        $nav_bar = aff_pagination($url_base, $nbr_lignes, $nb_per_page, $page, 10, false, true);
        print $nav_bar;
        print '</div>';
    }
}
Exemplo n.º 10
0
 function get_primaldata()
 {
     global $dbh;
     $requete = "SELECT * FROM series WHERE serie_id='" . addslashes($this->id) . "' ";
     $result = @pmb_mysql_query($requete, $dbh);
     if (pmb_mysql_num_rows($result)) {
         $obj = pmb_mysql_fetch_object($result);
         pmb_mysql_free_result($result);
         $this->get_primaldatafrom($obj);
     } else {
         // pas de collection avec cette clé
         $this->id = 0;
         $this->name = '';
         $this->index = '';
     }
 }
Exemplo n.º 11
0
function show_results($dbh, $user_input, $nbr_lignes = 0, $page = 0)
{
    global $nb_per_page;
    global $base_url;
    global $caller;
    global $msg;
    global $charset;
    global $idaction;
    global $current_note;
    $user_input = str_replace('*', '%', $user_input);
    if ($user_input == "") {
        $req_count = "select count(1) from demandes_notes where num_action='" . $idaction . "' and id_note !='" . $current_note . "'";
    } else {
        $req_count = "select count(1) from demandes_notes where num_action='" . $idaction . "' and contenu like '%" . $user_input . "%' and id_note !='" . $current_note . "'";
    }
    $res = pmb_mysql_query($req_count, $dbh);
    $nbr_lignes = @pmb_mysql_result($res, 0, 0);
    if (!$page) {
        $page = 1;
    }
    $debut = ($page - 1) * $nb_per_page;
    if ($nbr_lignes) {
        // on lance la vraie requête
        if ($user_input == "") {
            $req = "select id_note, date_note, CONCAT(SUBSTRING(contenu,1,50),'','...') as note from demandes_notes where num_action='" . $idaction . "' and id_note !='" . $current_note . "'";
        } else {
            $req = "select id_note, date_note, CONCAT(SUBSTRING(contenu,1,50),'','...') as note from demandes_notes where num_action='" . $idaction . "' and contenu like '%" . $user_input . "%' and id_note !='" . $current_note . "'";
        }
        $res = pmb_mysql_query($req, $dbh);
        while ($note = pmb_mysql_fetch_object($res)) {
            print "<div class='row'>";
            print "<a href='#' onclick=\"set_parent('{$caller}', '{$note->id_note}', '" . htmlentities(addslashes($note->note), ENT_QUOTES, $charset) . "')\"> [" . htmlentities(formatdate($note->date_note), ENT_QUOTES, $charset) . '] ' . htmlentities($note->note, ENT_QUOTES, $charset) . "</a>";
            print "</div>";
        }
        pmb_mysql_free_result($res);
        // constitution des liens
        $nbepages = ceil($nbr_lignes / $nb_per_page);
        $suivante = $page + 1;
        $precedente = $page - 1;
    }
    print "<div class='row'>&nbsp;<hr /></div><div align='center'>";
    $url_base = $base_url . "&user_input=" . rawurlencode(stripslashes($user_input));
    $nav_bar = aff_pagination($url_base, $nbr_lignes, $nb_per_page, $page, 10, false, true);
    print $nav_bar;
    print "</div>";
}
Exemplo n.º 12
0
 protected function _get_notices_ids()
 {
     if (!$this->searched) {
         $query = $this->_get_search_query();
         $this->notices_ids = "";
         $res = pmb_mysql_query($query);
         if ($res && pmb_mysql_num_rows($res)) {
             while ($row = pmb_mysql_fetch_object($res)) {
                 if ($this->notices_ids != "") {
                     $this->notices_ids .= ",";
                 }
                 $this->notices_ids .= $row->num_obj;
             }
             pmb_mysql_free_result($res);
         }
         $this->searched = true;
     }
     return $this->notices_ids;
 }
Exemplo n.º 13
0
 function getData()
 {
     global $dbh;
     if (!$this->id_classement) {
         $this->type_classement = 'BAN';
         $this->nom_classement = '';
     } else {
         $requete = "SELECT type_classement, nom_classement FROM classements WHERE id_classement='{$this->id_classement}' ";
         $result = @pmb_mysql_query($requete, $dbh);
         if (pmb_mysql_num_rows($result)) {
             $temp = pmb_mysql_fetch_object($result);
             pmb_mysql_free_result($result);
             $this->type_classement = $temp->type_classement;
             $this->nom_classement = $temp->nom_classement;
         } else {
             $this->id_classement = 0;
             $this->type_classement = '';
             $this->nom_classement = '';
         }
     }
 }
Exemplo n.º 14
0
 function getData()
 {
     global $dbh;
     if (!$this->idemprcaddie) {
         // pas d'identifiant.
         $this->name = '';
         $this->comment = '';
         $this->nb_item = 0;
         $this->autorisations = "";
         $this->classementGen = "";
     } else {
         $requete = "SELECT * FROM empr_caddie WHERE idemprcaddie='{$this->idemprcaddie}' ";
         $result = @pmb_mysql_query($requete, $dbh);
         if (pmb_mysql_num_rows($result)) {
             $temp = pmb_mysql_fetch_object($result);
             pmb_mysql_free_result($result);
             $this->idemprcaddie = $temp->idemprcaddie;
             $this->name = $temp->name;
             $this->comment = $temp->comment;
             $this->autorisations = $temp->autorisations;
             $this->classementGen = $temp->empr_caddie_classement;
             //liaisons
             $req = "SELECT id_planificateur, num_type_tache, libelle_tache FROM planificateur WHERE num_type_tache=8 AND param REGEXP 's:11:\"empr_caddie\";s:[0-9]+:\"" . $this->idemprcaddie . "\";'";
             $res = pmb_mysql_query($req, $dbh);
             if ($res && pmb_mysql_num_rows($res)) {
                 while ($ligne = pmb_mysql_fetch_object($res)) {
                     $this->liaisons["mailing"][] = array("id" => $ligne->id_planificateur, "id_bis" => $ligne->num_type_tache, "lib" => $ligne->libelle_tache);
                 }
             }
         } else {
             // pas de caddie avec cet id
             $this->idemprcaddie = 0;
             $this->name = '';
             $this->comment = '';
             $this->autorisations = "";
             $this->classementGen = "";
         }
         $this->compte_items();
     }
 }
 function do_header()
 {
     global $dbh;
     global $charset;
     global $pmb_notice_reduit_format;
     global $base_path;
     global $msg;
     $aut1_libelle = array();
     // récupération du titre de série
     if ($this->notice->is_article) {
         $this->header = $this->notice->serie_name;
         if ($this->notice->bull_num && $this->notice->bull_periode) {
             $this->header .= " (" . $this->notice->bull_num . " - " . $this->notice->bull_periode . ")";
         } elseif ($this->notice->bull_num) {
             $this->header .= " (" . $this->notice->bull_num . ")";
         } elseif ($this->notice->bull_periode) {
             $this->header .= " (" . $this->notice->bull_periode . ")";
         }
     } elseif ($this->notice->serie_name) {
         $this->tit_serie = $this->notice->serie_name;
         $this->header = $this->tit_serie;
         if ($this->notice->tnvol) {
             $this->header .= ',&nbsp;' . $this->notice->tnvol;
         }
     }
     $this->tit1 = $this->notice->tit1;
     $this->header ? $this->header .= '.&nbsp;' . $this->tit1 : ($this->header = $this->tit1);
     if ($this->source_name) {
         $this->header = $this->source_name . " : " . $this->header;
     }
     //on ajoute la checkbox pour l'intégration en lot...
     //calcul de la checkbox
     $checkbox = "<input type='checkbox' name='external_notice_to_integer[]' value='" . $this->notice_id . "'";
     //on commence par regarder si cette notice n'a pas déjà été intégrér
     $query = "select rid from notices_externes join external_count on external_count.recid = notices_externes.recid where rid=" . $this->notice_id;
     $result = pmb_mysql_query($query);
     if (pmb_mysql_num_rows($result)) {
         $checkbox .= " checked='checked' disabled='disabled'";
     }
     $checkbox .= "/>";
     //ajout dans le header;
     $this->header = $checkbox . "&nbsp;" . $this->header;
     //$this->responsabilites
     $as = array_search("0", $this->responsabilites["responsabilites"]);
     if ($as !== FALSE && $as !== NULL) {
         $auteur_0 = $this->responsabilites["auteurs"][$as];
         //$auteur = new auteur($auteur_0["id"]);
         if ($auteur_0["auteur_isbd"]) {
             $this->header .= ' / ' . $auteur_0["auteur_titre"];
         }
     } else {
         $as = array_keys($this->responsabilites["responsabilites"], "1");
         for ($i = 0; $i < count($as); $i++) {
             $indice = $as[$i];
             $auteur_1 = $this->responsabilites["auteurs"][$indice];
             $aut1_libelle[] = $auteur_1["auteur_titre"];
         }
         $auteurs_liste = implode("; ", $aut1_libelle);
         if ($auteurs_liste) {
             $this->header .= ' / ' . $auteurs_liste;
         }
     }
     switch ($pmb_notice_reduit_format) {
         case "1":
             if ($this->notice->year != '') {
                 $this->header .= ' (' . htmlentities($this->notice->year, ENT_QUOTES, $charset) . ')';
             }
             break;
         case "2":
             if ($this->notice->year != '') {
                 $this->header .= ' (' . htmlentities($this->notice->year, ENT_QUOTES, $charset) . ')';
             }
             if ($this->notice->code != '') {
                 $this->header .= ' / ' . htmlentities($this->notice->code, ENT_QUOTES, $charset);
             }
             break;
         default:
             break;
     }
     if ($this->drag) {
         $drag = "<span id=\"NOTI_drag_" . $this->notice_id . ($this->anti_loop ? "_p" . $this->anti_loop[count($this->anti_loop) - 1] : "") . "\"  dragicon=\"{$base_path}/images/icone_drag_notice.png\" dragtext=\"" . $this->header . "\" draggable=\"yes\" dragtype=\"notice\" callback_before=\"show_carts\" callback_after=\"\" style=\"padding-left:7px\"><img src=\"" . $base_path . "/images/notice_drag.png\"/></span>";
     }
     if ($this->action) {
         $this->header = "<a href=\"" . $this->action . "\">" . $this->header . '</a>';
     }
     if ($this->notice->niveau_biblio == 'b') {
         $rqt = "select tit1 from bulletins,notices where bulletins.num_notice='" . $this->notice_id . "' and notices.notice_id=bulletins.bulletin_notice";
         $execute_query = pmb_mysql_query($rqt);
         $row = pmb_mysql_fetch_object($execute_query);
         $this->header .= " <i>" . str_replace("%s", $row->tit1, $msg["bul_titre_perio"]) . "</i>";
         pmb_mysql_free_result($execute_query);
     }
     if ($this->notice->lien) {
         // ajout du lien pour les ressourcenotice_parent_useds électroniques
         $this->header .= "<a href=\"" . $this->notice->lien . "\" target=\"__LINK__\">";
         global $use_opac_url_base, $opac_url_base;
         if (!$use_opac_url_base) {
             $this->header .= "<img src=\"./images/globe.gif\" border=\"0\" align=\"middle\" hspace=\"3\"";
         } else {
             $this->header .= "<img src=\"" . $opac_url_base . "images/globe.gif\" border=\"0\" align=\"middle\" hspace=\"3\"";
         }
         $this->header .= " alt=\"";
         $this->header .= $this->notice->eformat;
         $this->header .= "\" title=\"";
         $this->header .= $this->notice->eformat;
         $this->header .= "\">";
         $this->header .= '</a>';
     }
 }
Exemplo n.º 16
0
 function get_info_editeur($id)
 {
     $info = array();
     if ($id) {
         $requete = "SELECT * FROM publishers WHERE ed_id={$id} LIMIT 1 ";
         $result = @pmb_mysql_query($requete);
         if ($result && pmb_mysql_num_rows($result)) {
             $temp = pmb_mysql_fetch_object($result);
             pmb_mysql_free_result($result);
             $id = $temp->ed_id;
             $name = $temp->ed_name;
             $adr1 = $temp->ed_adr1;
             $adr2 = $temp->ed_adr2;
             $cp = $temp->ed_cp;
             $ville = $temp->ed_ville;
             $pays = $temp->ed_pays;
             $web = $temp->ed_web;
             $ed_comment = $temp->ed_comment;
             // Determine le lieu de publication
             $l = '';
             if ($adr1) {
                 $l = $adr1;
             }
             if ($adr2) {
                 $l = $l == '' ? $adr2 : $l . ', ' . $adr2;
             }
             if ($cp) {
                 $l = $l == '' ? $cp : $l . ', ' . $cp;
             }
             if ($pays) {
                 $l = $l == '' ? $pays : $l . ', ' . $pays;
             }
             if ($ville) {
                 $l = $l == '' ? $ville : $ville . ' (' . $l . ')';
             }
             if ($l == '') {
                 $l = '[S.l.]';
             }
             // Determine le nom de l'editeur
             if ($name) {
                 $n = $name;
             } else {
                 $n = '[S.n.]';
             }
             // Constitue l'ISBD pour le coupe lieu/editeur
             if ($l == '[S.l.]' and $n == '[S.n.]') {
                 $isbd_entry = '[S.l.&nbsp;: s.n.]';
             } else {
                 $isbd_entry = $l . '&nbsp;: ' . $n;
             }
             $info['isbd_entry'] = $isbd_entry;
             $info['name'] = $name;
             $info['place'] = $l;
         }
     }
     return $info;
 }
Exemplo n.º 17
0
    while ($j = pmb_mysql_fetch_array($resultat_droits_expl)) {
        $temp .= $j["idlocation"] . ",";
        $visibilite_expl_user .= "\n\t\t\t<div class='row'>\n\t\t\t\t<div class='colonne3' align='right'>" . $j["location_libelle"] . " : </div>\n\t\t\t\t<div class='colonne_suite'>&nbsp;<select name=\"form_expl_visibilite_" . $j["idlocation"] . "\">\n\t\t\t";
        $as_invis = array_search($j["idlocation"], $explr_tab_invis);
        $as_unmod = array_search($j["idlocation"], $explr_tab_unmod);
        $as_mod = array_search($j["idlocation"], $explr_tab_modif);
        $visibilite_expl_user .= "\n<option value='explr_invisible' " . ($as_invis !== FALSE && $as_invis !== NULL ? "selected='selected' " : "") . ">" . $msg["explr_invisible"] . "</option>";
        if ($as_mod !== FALSE && $as_mod !== NULL || $as_unmod !== FALSE && $as_unmod !== NULL || $as_invis !== FALSE && $as_invis !== NULL) {
            $visibilite_expl_user .= "\n<option value='explr_visible_unmod' " . ($as_unmod !== FALSE && $as_unmod !== NULL ? "selected='selected' " : "") . ">" . $msg["explr_visible_unmod"] . "</option>";
        } else {
            $visibilite_expl_user .= "\n<option value='explr_visible_unmod' selected='selected' >" . $msg["explr_visible_unmod"] . "</option>";
        }
        $visibilite_expl_user .= "\n<option value='explr_visible_mod' " . ($as_mod !== FALSE && $as_mod !== NULL ? "selected='selected' " : "") . ">" . $msg["explr_visible_mod"] . "</option>";
        $visibilite_expl_user .= "</select></div></div>\n";
    }
    pmb_mysql_free_result($resultat_droits_expl);
    if (!$explr_invisible && !$explr_visible_unmod && !$explr_visible_mod) {
        $rqt = "UPDATE users SET explr_invisible=0,explr_visible_mod=0,explr_visible_unmod='" . substr($temp, 0, strlen($temp) - 1) . "' WHERE userid={$id}";
        @pmb_mysql_query($rqt);
    }
    $deflt_user .= $visibilite_expl_user;
}
//fin visibilité des exemplaires
$param_default = "\n<div class='row'><hr /></div>\n\t\t{$param_user}\n\t<div class='row'><hr /></div>\n\t\t" . str_replace("!!param_allloc!!", $param_user_allloc, $deflt_user) . "\n\t<br />\n\t<div class='row'><hr /></div>\n\t\t{$value_user}\n\t<div class='row'><hr /></div>\n\t\t{$deflt_user_style}\n\t<br />";
if ($speci_user || $deflt3user) {
    $param_default .= "<div class='row'><hr /></div>";
    $param_default .= $deflt3user;
    $param_default .= $speci_user;
    $param_default .= "<div class='row'></div>";
}
echo window_title($msg[1003] . $msg[18] . $msg[1003] . $msg[86] . $msg[1003] . $usr->username . $msg[1001]);
Exemplo n.º 18
0
 function print_resume($level = 2, $css = '')
 {
     global $css;
     global $msg;
     if (!$this->id) {
         return;
     }
     // adaptation par rapport au niveau de détail souhaité
     switch ($level) {
         // case x :
         case 2:
         default:
             global $collection_level2_display;
             global $collection_level2_no_issn_info;
             $collection_display = $collection_level2_display;
             $collection_no_issn_info = $collection_level2_no_issn_info;
             break;
     }
     $print = $collection_display;
     // remplacement des champs statiques
     $print = str_replace("!!name!!", $this->name . " " . $this->collection_web_link, $print);
     $print = str_replace("!!issn!!", $this->issn ? $this->issn : $collection_no_issn_info, $print);
     $print = str_replace("!!publ!!", $this->publisher_libelle, $print);
     $print = str_replace("!!publ_isbd!!", $this->publisher_isbd, $print);
     $print = str_replace("!!isbd!!", $this->isbd_entry, $print);
     $print = str_replace("!!comment!!", nl2br($this->comment), $print);
     // remplacement des champs dynamiques
     if (preg_match("#!!publisher!!#", $print)) {
         $remplacement = "<a href='index.php?lvl=publisher_see&id={$this->parent}'>{$this->publisher_libelle}</a>";
         $print = str_replace("!!publisher!!", $remplacement, $print);
     }
     if (preg_match("#!!subcolls!!#", $print)) {
         global $dbh;
         $query = "select sub_coll_id, sub_coll_name from sub_collections where sub_coll_parent=" . $this->id;
         $result = pmb_mysql_query($query, $dbh);
         if (pmb_mysql_num_rows($result)) {
             $remplacement = $msg["subcollection_attached"] . "\n<ul>\n";
             while ($obj = pmb_mysql_fetch_object($result)) {
                 $remplacement .= "<li><a href='index.php?lvl=subcoll_see&id=" . $obj->sub_coll_id . "'>" . $obj->sub_coll_name . "</a></li>\n";
             }
             pmb_mysql_free_result($result);
             $remplacement .= "</ul><div class='row'></div>\n";
         } else {
             $remplacement = "";
         }
         $print = str_replace("!!subcolls!!", $remplacement, $print);
     }
     return $print;
 }
Exemplo n.º 19
0
function show_results($dbh, $user_input, $nbr_lignes = 0, $page = 0, $id = 0)
{
    global $nb_per_page;
    global $base_url;
    global $caller;
    global $charset;
    global $msg;
    global $expl_list_id;
    // on récupére le nombre de lignes qui vont bien
    if (!$id) {
        if ($user_input == "") {
            $requete = "SELECT COUNT(1) FROM groupexpl";
        } 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 = "select count(distinct id_groupexpl) from groupexpl where groupexpl_name like '%" . $user_input . "%'";
        }
        $res = pmb_mysql_query($requete, $dbh);
        $nbr_lignes = @pmb_mysql_result($res, 0, 0);
    } else {
        $nbr_lignes = 1;
    }
    if (!$page) {
        $page = 1;
    }
    $debut = ($page - 1) * $nb_per_page;
    if ($nbr_lignes) {
        $expl_list = explode(",", $expl_list_id);
        $expl_list_cb = array();
        foreach ($expl_list as $id_expl) {
            $query = "SELECT expl_cb FROM exemplaires WHERE expl_id='" . $id_expl . "'";
            $result = pmb_mysql_query($query);
            if ($result && pmb_mysql_num_rows($result)) {
                $cb = pmb_mysql_result($result, 0, 0);
                $expl_list_cb[] = $cb;
            }
        }
        $last_id_used = session::get_last_used("groupexpl");
        if ($last_id_used) {
            print "<div class='selector_last_used'>\n \t\t\t\t<div class='row'>\n \t\t\t\t\t<b>" . $msg["selector_last_groupexpl_used"] . "</b>\n \t\t\t\t</div>\n \t\t\t\t<div class='row'>";
            $query = "select id_groupexpl, groupexpl_name from groupexpl where id_groupexpl=" . $last_id_used;
            $result = pmb_mysql_query($query);
            while ($group = pmb_mysql_fetch_object($result)) {
                print pmb_bidi("\n\t\t\t\t\t\t<a href=\"{$base_url}&action=add_expl&id_groupexpl=" . $group->id_groupexpl . "&expl_list=" . implode(",", $expl_list_cb) . "\">\n\t\t\t\t\t\t{$group->groupexpl_name}</a><br />");
            }
            print "</div></div>";
        }
        // on lance la vraie requête
        if (!$id) {
            if ($user_input == "") {
                $requete = "SELECT groupexpl.* FROM groupexpl";
                $requete .= " ORDER BY groupexpl_name LIMIT {$debut},{$nb_per_page} ";
            } else {
                $requete = "select groupexpl.* from groupexpl where groupexpl_name like '%" . $user_input . "%' order by groupexpl_name LIMIT {$debut},{$nb_per_page}";
            }
        } else {
            $requete = "select groupexpl.* FROM groupexpl where id_groupexpl='" . $id . "'";
        }
        $res = @pmb_mysql_query($requete, $dbh);
        while ($group = pmb_mysql_fetch_object($res)) {
            print pmb_bidi("\n \t\t\t<a href=\"{$base_url}&action=add_expl&id_groupexpl=" . $group->id_groupexpl . "&expl_list=" . implode(",", $expl_list_cb) . "\">\n\t\t\t\t\t{$group->groupexpl_name}</a><br />");
        }
        pmb_mysql_free_result($res);
        // constitution des liens
        $nbepages = ceil($nbr_lignes / $nb_per_page);
        $suivante = $page + 1;
        $precedente = $page - 1;
        // affichage pagination
        print "<div class='row'>&nbsp;<hr /></div><div align='center'>";
        $url_base = $base_url . "&user_input=" . rawurlencode(stripslashes($user_input));
        $nav_bar = aff_pagination($url_base, $nbr_lignes, $nb_per_page, $page, 10, false, true);
        print $nav_bar;
        print "</div>";
    }
}
Exemplo n.º 20
0
function resa_list_resa_a_traiter()
{
    /* Traitement :
    		chercher toutes les réservations non traitées (resa_cb ="")
    		construire le tableau avec le titre de l'ouvrage, le nom du réservataire et son rang
    	*/
    global $dbh;
    global $msg;
    global $pmb_lecteurs_localises;
    global $deflt_resas_location;
    global $pmb_location_reservation;
    global $pmb_transferts_actif, $transferts_choix_lieu_opac, $transferts_site_fixe;
    global $f_loc, $f_dispo_loc;
    $tableau_final = array();
    $order = "tit, resa_idnotice, resa_idbulletin, resa_date";
    $sql_expl_loc = "";
    if ($pmb_lecteurs_localises) {
        if ($f_loc == "") {
            $f_loc = $deflt_resas_location;
        }
        if ($f_loc && $f_dispo_loc) {
            $sql_expl_loc = " and (expl_location='" . $f_loc . "' or expl_location='" . $f_dispo_loc . "') ";
        } elseif ($f_dispo_loc) {
            $sql_expl_loc = " and expl_location='" . $f_dispo_loc . "' ";
        }
    }
    if ($pmb_transferts_actif == "1" && $f_loc) {
        switch ($transferts_choix_lieu_opac) {
            case "1":
                //retrait de la resa sur lieu choisi par le lecteur
                $sql_suite .= " AND resa_loc_retrait='" . $f_loc . "' ";
                break;
            case "2":
                //retrait de la resa sur lieu fixé
                if ($f_loc != $transferts_site_fixe) {
                    $sql_suite .= " AND 0";
                }
                break;
            case "3":
                //retrait de la resa sur lieu exemplaire
                // On affiche les résa que peut satisfaire la loc
                // respecter les droits de réservation du lecteur
                if ($pmb_location_reservation) {
                    $sql_loc_resa .= " and empr_location=resa_emprloc and resa_loc='" . $f_loc . "' ";
                    $sql_loc_resa_from = ", resa_loc ";
                }
                if ($f_loc && $f_dispo_loc) {
                    $sql_expl_loc = " and (expl_location='" . $f_loc . "' or expl_location='" . $f_dispo_loc . "') ";
                } elseif ($f_dispo_loc) {
                    $sql_expl_loc = " and expl_location='" . $f_dispo_loc . "' ";
                }
                break;
            default:
                //retrait de la resa sur lieu lecteur
                $sql_suite .= " AND empr_location='" . $f_loc . "' ";
                if ($f_loc && $f_dispo_loc) {
                    $sql_expl_loc = " and (expl_location='" . $f_loc . "' or expl_location='" . $f_dispo_loc . "') ";
                } elseif ($f_dispo_loc) {
                    $sql_expl_loc = " and expl_location='" . $f_dispo_loc . "' ";
                }
                break;
        }
    } elseif ($pmb_location_reservation && $f_loc) {
        $sql_loc_resa .= " and empr_location=resa_emprloc and resa_loc='" . $f_loc . "' ";
        $sql_loc_resa_from = ", resa_loc ";
    }
    $sql = "SELECT resa_idnotice, resa_idbulletin, resa_date, resa_date_fin, resa_cb, resa_idempr, empr_nom, empr_prenom, empr_cb, empr_location, ";
    $sql .= " trim(concat(ifnull(notices_m.tit1,''),ifnull(notices_s.tit1,''),' ',ifnull(bulletin_numero,''), if (mention_date, concat(' (',mention_date,')') ,''))) as tit, id_resa, ";
    $sql .= " IF(resa_date_fin>=sysdate() or resa_date_fin='0000-00-00',0,1) as perimee, date_format(resa_date_debut, '" . $msg["format_date"] . "') as aff_resa_date_debut, if(resa_date_fin='0000-00-00', '', date_format(resa_date_fin, '" . $msg["format_date"] . "')) as aff_resa_date_fin, date_format(resa_date, '" . $msg["format_date"] . "') as aff_resa_date ";
    $sql .= " FROM ((((resa LEFT JOIN notices AS notices_m ON resa_idnotice = notices_m.notice_id ) ";
    $sql .= " LEFT JOIN bulletins ON resa_idbulletin = bulletins.bulletin_id) ";
    $sql .= " LEFT JOIN notices AS notices_s ON bulletin_notice = notices_s.notice_id) ";
    $sql .= " LEFT JOIN exemplaires ON resa_cb = exemplaires.expl_cb), empr {$sql_loc_resa_from} ";
    $sql .= " where resa_idempr=id_empr and (resa_cb='' or resa_cb is null) ";
    $sql .= $sql_suite;
    $sql .= " group by resa_idnotice, resa_idbulletin, resa_idempr ";
    $sql .= " order by " . $order;
    $req = pmb_mysql_query($sql) or die("Erreur SQL !<br />" . $sql . "<br />" . pmb_mysql_error());
    if (!pmb_mysql_num_rows($req)) {
        return $tableau_final;
    }
    while ($data = pmb_mysql_fetch_array($req)) {
        if ($pmb_lecteurs_localises) {
            $requete = "SELECT location_libelle as empr_loc_libelle FROM docs_location WHERE idlocation= '" . $data['empr_location'] . "' ";
            $result = @pmb_mysql_query($requete, $dbh);
            $res_empr = pmb_mysql_fetch_object($result);
        }
        $resa_idnotice = $data['resa_idnotice'];
        $resa_idbulletin = $data['resa_idbulletin'];
        // on compte le nombre total d'exemplaires prêtables pour la notice
        $query = "SELECT count(1) FROM exemplaires, docs_statut WHERE expl_statut=idstatut AND statut_allow_resa=1 {$sql_expl_loc} ";
        if ($resa_idnotice) {
            $query .= " AND expl_notice=" . $resa_idnotice;
        } elseif ($resa_idbulletin) {
            $query .= " AND expl_bulletin=" . $resa_idbulletin;
        }
        $tresult = @pmb_mysql_query($query, $dbh);
        $total_ex = pmb_mysql_result($tresult, 0, 0);
        // on compte le nombre d'exemplaires sortis
        $query = "SELECT count(1) as qte FROM exemplaires , pret WHERE pret_idexpl=expl_id {$sql_expl_loc} ";
        if ($resa_idnotice) {
            $query .= " and expl_notice=" . $resa_idnotice;
        } elseif ($resa_idbulletin) {
            $query .= " and expl_bulletin=" . $resa_idbulletin;
        }
        $tresult = @pmb_mysql_query($query, $dbh);
        $total_sortis = pmb_mysql_result($tresult, 0, 0);
        // on en déduit le nombre d'exemplaires disponibles
        $total_dispo = $total_ex - $total_sortis;
        // on a au moins UN dispo :
        if ($total_dispo > 0) {
            $available = true;
            $rank = recupere_rang($data['resa_idempr'], $resa_idnotice, $resa_idbulletin);
            if ($rank > $total_dispo) {
                $available = false;
            }
            if ($pmb_transferts_actif == "1") {
                $dest_loc = resa_loc_retrait($data['id_resa']);
                if ($dest_loc != 0) {
                    $query = "SELECT count(1) FROM exemplaires, docs_statut WHERE expl_statut=idstatut AND statut_allow_resa=1";
                    $query .= " AND expl_location=" . $dest_loc;
                    if ($resa_idnotice) {
                        $query .= " AND expl_notice=" . $resa_idnotice;
                    } elseif ($resa_idbulletin) {
                        $query .= " AND expl_bulletin=" . $resa_idbulletin;
                    }
                    $tresult = pmb_mysql_query($query, $dbh);
                    $total_ex = pmb_mysql_result($tresult, 0);
                    if ($total_ex == 0) {
                        //on a pas d'exemplaires sur le site de retrait
                        //on regarde si on en ailleurs
                        $query = "SELECT count(1) FROM exemplaires, docs_statut WHERE expl_statut=idstatut AND statut_allow_resa=1";
                        $query .= " AND expl_location<>" . $dest_loc;
                        if ($resa_idnotice) {
                            $query .= " AND expl_notice=" . $resa_idnotice;
                        } elseif ($resa_idbulletin) {
                            $query .= " AND expl_bulletin=" . $resa_idbulletin;
                        }
                        $tresult = pmb_mysql_query($query, $dbh);
                        $total_ex = pmb_mysql_result($tresult, 0);
                        if ($total_ex != 0) {
                            //on en a au moins un ailleurs!
                            //on regarde si un des exemplaires n'est pas en transfert pour cette resa !
                            $query = "SELECT count(1) FROM transferts WHERE etat_transfert=0 AND origine=4 AND origine_comp=" . $data['id_resa'];
                            $tresult = pmb_mysql_query($query, $dbh);
                            $nb_trans = pmb_mysql_result($tresult, 0);
                            if ($nb_trans != 0) {
                                //on a un transfert en cours
                                $available = false;
                            } elseif ($total_ex >= $rank) {
                                if (!transfert_resa_dispo($resa_idnotice, $resa_idbulletin, $dest_loc)) {
                                    //non disponible dans une autre localisation
                                    $available = false;
                                }
                            }
                        }
                    }
                }
            }
            // un exemplaire est disponible pour cette resa
            if ($available) {
                $rank = recupere_rang($data['resa_idempr'], $resa_idnotice, $resa_idbulletin);
                if ($pmb_transferts_actif == "1") {
                    $loc_retrait = resa_loc_retrait($data["id_resa"]);
                    $rqt = "SELECT location_libelle FROM docs_location WHERE idlocation='" . $loc_retrait . "'";
                    $libloc_retrait = @pmb_mysql_result(pmb_mysql_query($rqt), 0);
                } else {
                    $libloc_retrait = "";
                }
                $tableau_final[] = array('resa_tit' => $data['tit'], 'resa_idnotice' => $resa_idnotice, 'resa_idbulletin' => $resa_idbulletin, 'resa_idempr' => $data['resa_idempr'], 'resa_empr' => $data['empr_nom'] . " " . $data['empr_prenom'], 'resa_empr_loc_libelle' => $res_empr->empr_loc_libelle, 'rank' => $rank, 'loc_retrait_libelle' => $libloc_retrait);
            }
        }
    }
    // fin while
    pmb_mysql_free_result($req);
    return $tableau_final;
}
Exemplo n.º 21
0
 function getData()
 {
     global $dbh;
     if (!$this->id) {
         // pas d'identifiant. on retourne un tableau vide
         $this->id = 0;
         $this->name = '';
         $this->parent = 0;
         $this->parent_libelle = '';
         $this->editeur = 0;
         $this->editeur_libelle = '';
         $this->display = '';
         $this->isbd_entry = '';
         $this->issn = '';
         $this->subcollection_web = '';
         $this->subcollection_web_link = "";
         $this->comment = "";
         $this->num_statut = 1;
     } else {
         $requete = "SELECT * FROM sub_collections WHERE sub_coll_id={$this->id} LIMIT 1 ";
         $result = @pmb_mysql_query($requete, $dbh);
         if (pmb_mysql_num_rows($result)) {
             $temp = pmb_mysql_fetch_object($result);
             pmb_mysql_free_result($result);
             $this->id = $temp->sub_coll_id;
             $this->name = $temp->sub_coll_name;
             $this->parent = $temp->sub_coll_parent;
             $this->issn = $temp->sub_coll_issn;
             $this->subcollection_web = $temp->subcollection_web;
             $this->comment = $temp->subcollection_comment;
             $authority = new authority(0, $this->id, AUT_TABLE_SUB_COLLECTIONS);
             $this->num_statut = $authority->get_num_statut();
             if ($temp->subcollection_web) {
                 $this->subcollection_web_link = " <a href='{$temp->subcollection_web}' target=_blank><img src='./images/globe.gif' border=0 /></a>";
             } else {
                 $this->subcollection_web_link = "";
             }
             $parent = new collection($temp->sub_coll_parent);
             $this->parent_libelle = $parent->name;
             $parent_libelle_lien_gestion = $parent->isbd_entry_lien_gestion;
             $this->editeur = $parent->parent;
             $editeur = new editeur($parent->parent);
             $this->editeur_libelle = $editeur->name;
             $this->editor_isbd = $editeur->isbd_entry;
             $this->issn ? $this->isbd_entry = $this->parent_libelle . '.&nbsp;' . $this->name . ', ISSN ' . $this->issn : ($this->isbd_entry = $this->parent_libelle . '.&nbsp;' . $this->name);
             $this->display = $this->parent_libelle . '. ' . $this->name . ' (' . $this->editeur_libelle . ')';
             // Ajoute un lien sur la fiche sous-collection si l'utilisateur à accès aux autorités
             if (SESSrights & AUTORITES_AUTH) {
                 if ($this->issn) {
                     $lien_lib = $this->name . ', ISSN ' . $this->issn;
                 } else {
                     $lien_lib = $this->name;
                 }
                 //$this->isbd_entry_lien_gestion = $parent_libelle_lien_gestion.".&nbsp;<a href='./autorites.php?categ=souscollections&sub=collection_form&id=".$this->id."' class='lien_gestion'>".$lien_lib."</a>";
                 $this->isbd_entry_lien_gestion = $parent_libelle_lien_gestion . ".&nbsp;<a href='./autorites.php?categ=see&sub=subcollection&id=" . $this->id . "' class='lien_gestion'>" . $lien_lib . "</a>";
             } else {
                 $this->isbd_entry_lien_gestion = $this->isbd_entry;
             }
         } else {
             // pas de sous-collection avec cette clé
             $this->id = 0;
             $this->name = '';
             $this->parent = 0;
             $this->parent_libelle = '';
             $this->editeur = 0;
             $this->editeur_libelle = '';
             $this->display = '';
             $this->isbd_entry = '';
             $this->issn = '';
             $this->subcollection_web = '';
             $this->comment = '';
             $this->subcollection_web_link = "";
             $this->num_statut = 1;
         }
     }
 }
Exemplo n.º 22
0
function show_results($dbh, $user_input, $nbr_lignes = 0, $page = 0, $id = 0)
{
    global $nb_per_page;
    global $base_url;
    global $caller;
    global $no_display;
    global $charset;
    global $msg;
    global $callback;
    // on récupére le nombre de lignes qui vont bien
    if (!$id) {
        if ($user_input == "") {
            $requete = "SELECT COUNT(1) FROM series where serie_id!='{$no_display}' ";
        } 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("series", "serie_name", "serie_index", "serie_id", "serie_id!='{$no_display}'");
        }
        $res = pmb_mysql_query($requete, $dbh);
        $nbr_lignes = pmb_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 series where serie_id!='{$no_display}' ";
                $requete .= "ORDER BY serie_index LIMIT {$debut},{$nb_per_page} ";
            } else {
                $members = $aq->get_query_members("series", "serie_name", "serie_index", "serie_id");
                $requete = "select *," . $members["select"] . " as pert from series where " . $members["where"] . " and serie_id!='{$no_display}' group by serie_id order by pert desc,serie_index limit {$debut},{$nb_per_page}";
            }
        } else {
            $requete = "select * from series where serie_id='" . $id . "'";
        }
        $res = @pmb_mysql_query($requete, $dbh);
        while ($serie = pmb_mysql_fetch_object($res)) {
            $entry = $serie->serie_name;
            print pmb_bidi("\n\t\t\t<a href='#' onclick=\"set_parent('{$caller}', '{$serie->serie_id}', '" . htmlentities(addslashes($entry), ENT_QUOTES, $charset) . "','{$callback}')\">\n\t\t\t\t{$entry}</a>");
            print "<br />";
        }
        pmb_mysql_free_result($res);
        // constitution des liens
        $nbepages = ceil($nbr_lignes / $nb_per_page);
        $suivante = $page + 1;
        $precedente = $page - 1;
        // affichage pagination
        print "<div class='row'>&nbsp;<hr /></div><div align='center'>";
        $url_base = $base_url . "&user_input=" . rawurlencode(stripslashes($user_input));
        $nav_bar = aff_pagination($url_base, $nbr_lignes, $nb_per_page, $page, 10, false, true);
        print $nav_bar;
        print "</div>";
    }
}
    if (!$start) {
        $requete = "CREATE TABLE if not exists empr_passwords (\n\t\t\tid_empr INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY ,\n\t\t\tempr_password VARCHAR( 255 ) NOT NULL default '')";
        pmb_mysql_query($requete, $dbh);
        $requete = "INSERT IGNORE INTO empr_passwords SELECT id_empr, empr_password FROM empr where empr_password_is_encrypted=0";
        pmb_mysql_query($requete, $dbh);
    }
    // définition de l'état de la jauge
    $state = floor($start / ($count / $jauge_size));
    // mise à jour de l'affichage de la jauge
    print "<table border='0' align='center' width='{$jauge_size}' cellpadding='0' border='0'><tr><td class='jauge'>";
    print "<img src='../../images/jauge.png' width='{$state}' height='16'></td></tr></table>";
    // calcul pourcentage avancement
    $percent = floor($start / $count * 100);
    // affichage du % d'avancement et de l'état
    print "<div align='center'>{$percent}%</div>";
    while ($row = pmb_mysql_fetch_object($query)) {
        emprunteur::update_digest($row->empr_login, $row->empr_password);
        emprunteur::hash_password($row->empr_login, $row->empr_password);
    }
    pmb_mysql_free_result($query);
    $next = $start + $lot;
    print "\n\t<form class='form-{$current_module}' name='current_state' action='./clean.php' method='post'>\n\t\t<input type='hidden' name='v_state' value=\"" . urlencode($v_state) . "\">\n\t\t<input type='hidden' name='spec' value=\"{$spec}\">\n\t\t<input type='hidden' name='start' value=\"{$next}\">\n\t\t<input type='hidden' name='count' value=\"{$count}\">\n\t</form>\n\t<script type=\"text/javascript\">\n\t<!--\n\t\tdocument.forms['current_state'].submit();\n\t-->\n\t</script>";
} else {
    $spec = $spec - HASH_EMPR_PASSWORD;
    $v_state .= "<br /><img src=../../images/d.gif hspace=3>" . htmlentities($msg["hash_empr_password_status"], ENT_QUOTES, $charset);
    $v_state .= $count . " " . htmlentities($msg["hash_empr_password_status_end"], ENT_QUOTES, $charset);
    $opt = pmb_mysql_query('OPTIMIZE TABLE empr');
    // mise à jour de l'affichage de la jauge
    print "\n\t<table border='0' align='center' width='{$table_size}' cellpadding='0'><tr><td class='jauge'>\n\t<img src='../../images/jauge.png' width='{$jauge_size}' height='16'></td></tr></table>\n\t<div align='center'>100%</div>";
    print "\n\t<form class='form-{$current_module}' name='process_state' action='./clean.php' method='post'>\n\t\t<input type='hidden' name='v_state' value=\"" . urlencode($v_state) . "\">\n\t\t<input type='hidden' name='spec' value=\"{$spec}\">\n\t</form>\n\t<script type=\"text/javascript\">\n\t<!--\n\t\tdocument.forms['process_state'].submit();\n\t-->\n\t</script>";
}
Exemplo n.º 24
0
function show_results($dbh, $user_input, $nbr_lignes = 0, $page = 0, $id = 0)
{
    global $nb_per_page;
    global $base_url;
    global $caller;
    global $msg;
    global $charset;
    global $callback;
    // on récupére le nombre de lignes qui vont bien
    if (!$id) {
        if ($user_input == "") {
            $requete = "SELECT COUNT(1) FROM sub_collections where sub_coll_id!='{$no_display}' ";
        } 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("sub_collections", "sub_coll_name", "index_sub_coll", "sub_coll_id", "sub_coll_id!='{$no_display}' ");
        }
        $res = pmb_mysql_query($requete, $dbh);
        $nbr_lignes = @pmb_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 A.*,B.*,C.* FROM sub_collections A, collections B, publishers C";
                $requete .= " WHERE sub_coll_id!='{$no_display}' and A.sub_coll_parent=B.collection_id";
                $requete .= " AND B.collection_parent=C.ed_id";
                $requete .= " ORDER BY A.sub_coll_name LIMIT {$debut},{$nb_per_page} ";
            } else {
                $members = $aq->get_query_members("sub_collections", "sub_coll_name", "index_sub_coll", "sub_coll_id");
                $requete = "select sub_collections.*,collections.*,publishers.*, " . $members["select"] . " as pert from sub_collections, collections, publishers ";
                $requete .= "where " . $members["where"] . " and sub_coll_id!='{$no_display}' and sub_coll_parent=collection_id and collection_parent=ed_id group by sub_coll_id order by pert desc,index_sub_coll, index_coll, index_publisher limit {$debut},{$nb_per_page}";
            }
        } else {
            $requete = "select sub_collections.*,collections.*,publishers.* from sub_collections,collections,publishers where sub_coll_id='" . $id . "' and sub_coll_parent=collection_id and collection_parent=ed_id group by sub_coll_id";
        }
        $res = @pmb_mysql_query($requete, $dbh);
        while ($col = pmb_mysql_fetch_object($res)) {
            $idsubcoll = $col->sub_coll_id;
            $libellesubcoll = htmlentities(addslashes($col->sub_coll_name), ENT_QUOTES, $charset);
            $idparentcoll = $col->sub_coll_parent;
            $idparentlibelle = htmlentities(addslashes($col->collection_name), ENT_QUOTES, $charset);
            $idediteur = $col->ed_id;
            $libelleediteur = htmlentities(addslashes($col->ed_name), ENT_QUOTES, $charset);
            print pmb_bidi("\n\t\t\t<a href='#' onclick=\"set_parent('{$caller}', {$idsubcoll}, '" . $libellesubcoll . "', {$idparentcoll}, '" . $idparentlibelle . "', {$idediteur}, '" . $libelleediteur . "','{$callback}')\">\n\t\t\t\t{$col->sub_coll_name}</a>");
            print pmb_bidi("&nbsp;({$col->collection_name}.&nbsp;{$col->ed_name})<br />");
        }
        pmb_mysql_free_result($res);
        // constitution des liens
        $nbepages = ceil($nbr_lignes / $nb_per_page);
        $suivante = $page + 1;
        $precedente = $page - 1;
        // affichage pagination
        print "<div class='row'>&nbsp;<hr /></div><div align='center'>";
        $url_base = $base_url . "&user_input=" . rawurlencode(stripslashes($user_input));
        $nav_bar = aff_pagination($url_base, $nbr_lignes, $nb_per_page, $page, 10, false, true);
        print $nav_bar;
        print "</div>";
    }
}
Exemplo n.º 25
0
function show_results($dbh, $user_input, $nbr_lignes = 0, $page = 0, $id = 0)
{
    global $nb_per_page;
    global $base_url;
    global $caller;
    global $no_display;
    global $charset;
    global $msg;
    global $callback;
    global $param1;
    // on récupére le nombre de lignes qui vont bien
    //	if($param1) $restrict=" and abt_id  not in (select num_serialcirc_abt from serialcirc) ";
    if (!$id) {
        if ($user_input == "") {
            $requete = "SELECT COUNT(1) FROM abts_abts where abt_id!='{$no_display}' {$restrict}";
        } else {
            $requete = "select count(distinct abt_id) from abts_abts where abt_name like '%abt%' and abt_id!='{$no_display}' {$restrict}";
        }
        $res = pmb_mysql_query($requete, $dbh);
        $nbr_lignes = pmb_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 abts_abts where abt_id!='{$no_display}' {$restrict} ";
                $requete .= "ORDER BY abt_name LIMIT {$debut},{$nb_per_page} ";
            } else {
                $requete = "SELECT * FROM abts_abts where  abt_name like '%{$user_input}%' and abt_id!='{$no_display}' {$restrict}";
                $requete .= "ORDER BY abt_name LIMIT {$debut},{$nb_per_page} ";
            }
        } else {
            $requete = "select * from abts_abts where abt_id='" . $id . "'";
        }
        print "<table>";
        $res = @pmb_mysql_query($requete, $dbh);
        while ($abt = pmb_mysql_fetch_object($res)) {
            $circlist_info = "";
            $flag_circlist_info = 0;
            $requete = "select id_serialcirc from serialcirc where num_serialcirc_abt=" . $abt->abt_id;
            $res_circlist = pmb_mysql_query($requete);
            print "<tr><td>";
            if (pmb_mysql_num_rows($res_circlist)) {
                $circlist_info = "<img align='top' title='" . $msg["serialcirc_img_info"] . "'  height='18' width='18' alt='" . $msg["serialcirc_img_info"] . "' src='./images/icon_a.gif'>";
                $flag_circlist_info = 1;
            }
            print "{$circlist_info}</td><td width='100%'>";
            $entry = $abt->abt_name;
            print pmb_bidi("\n\t\t\t<a href='#' onclick=\"set_parent('{$caller}', '{$abt->abt_id}', '" . htmlentities(addslashes($entry), ENT_QUOTES, $charset) . "','{$callback}',{$flag_circlist_info})\">\n\t\t\t\t{$entry}</a>");
            print "</td>";
        }
        print "</table>";
        pmb_mysql_free_result($res);
        // constitution des liens
        $nbepages = ceil($nbr_lignes / $nb_per_page);
        $suivante = $page + 1;
        $precedente = $page - 1;
        // affichage pagination
        print "<div class='row'>&nbsp;<hr /></div><div align='center'>";
        $url_base = $base_url . "&user_input=" . rawurlencode(stripslashes($user_input));
        $nav_bar = aff_pagination($url_base, $nbr_lignes, $nb_per_page, $page, 10, false, true);
        print $nav_bar;
        print "</div>";
    }
}
function bulletin_affichage($id, $type = "")
{
    global $dbh, $msg;
    global $opac_show_exemplaires;
    $display = "";
    $requete = "SELECT bulletin_id, bulletin_numero, bulletin_notice, mention_date, date_date, bulletin_titre, bulletin_cb, date_format(date_date, '" . $msg["format_date_sql"] . "') as aff_date_date,num_notice FROM bulletins WHERE bulletin_id='{$id}'";
    $res = @pmb_mysql_query($requete, $dbh);
    while ($obj = pmb_mysql_fetch_array($res)) {
        $requete3 = "SELECT notice_id FROM notices WHERE notice_id='" . $obj["bulletin_notice"] . "' ";
        $res3 = @pmb_mysql_query($requete3, $dbh);
        while ($obj3 = pmb_mysql_fetch_object($res3)) {
            $notice3 = new notice($obj3->notice_id);
        }
        $notice3->fetch_visibilite();
        //on vient poser l'ancre des docnums...
        $req = "select explnum_id from explnum where explnum_bulletin = " . $obj["bulletin_id"];
        $resultat = pmb_mysql_query($req, $dbh) or die($req . " " . pmb_mysql_error());
        $nb_ex = pmb_mysql_num_rows($resultat);
        $res_print = "<h3><img src=./images/icon_per.gif> " . $notice3->print_resume(1, $css) . "." . " <b>" . $obj["bulletin_numero"] . "</b>" . ($nb_ex ? "&nbsp;<a href='#docnum'>" . ($nb_ex > 1 ? "<img src='" . get_url_icon("globe_rouge.png") . "' />" : "<img src='" . get_url_icon("globe_orange.png") . "' />") . "</a>" : "") . "</h3>\n";
        $num_notice = $obj['num_notice'];
        if ($obj['bulletin_titre']) {
            $res_print .= htmlentities($obj['bulletin_titre'], ENT_QUOTES, $charset) . "<br />";
        }
        if ($obj['mention_date']) {
            $res_print .= $msg['bull_mention_date'] . " &nbsp;" . $obj['mention_date'] . "\n";
        }
        if ($obj['date_date']) {
            $res_print .= "<br />" . $msg['bull_date_date'] . " &nbsp;" . $obj['aff_date_date'] . " \n";
        }
        if ($type != "visionneuse" && $nb_ex) {
            $res_print .= "<br /><a href='#docnum'>" . ($nb_ex > 1 ? "<img src='" . get_url_icon("globe_rouge.png") . "' />" : "<img src='" . get_url_icon("globe_orange.png") . "' />") . "</a>";
        }
        if ($obj['bulletin_cb']) {
            $res_print .= "<br />" . $msg["code_start"] . " " . htmlentities($obj['bulletin_cb'], ENT_QUOTES, $charset) . "\n";
            $code_cb_bulletin = $obj['bulletin_cb'];
        }
    }
    do_image($res_print, $code_cb_bulletin, 0);
    if ($num_notice) {
        // Il y a une notice de bulletin
        $display .= $res_print;
        $opac_notices_depliable = 0;
        $seule = 1;
        //$display .= pmb_bidi(aff_notice($num_notice,0,0)) ;
        if ($type == "visionneuse") {
            $display .= pmb_bidi(aff_notice($num_notice, 1, 1, 0, "", 0, 1));
        } else {
            $display .= pmb_bidi(aff_notice($num_notice, 0, 1, 0, "", 0));
        }
    } else {
        // construction des dépouillements
        $depouill = "<br /><h3>" . $msg['bull_dep'] . "</h3>";
        $requete = "SELECT * FROM analysis, notices, notice_statut WHERE analysis_bulletin='{$id}' AND notice_id = analysis_notice AND statut = id_notice_statut and ((notice_visible_opac=1 and notice_visible_opac_abon=0)" . ($_SESSION["user_code"] ? " or (notice_visible_opac_abon=1 and notice_visible_opac=1)" : "") . ") ";
        $res = @pmb_mysql_query($requete, $dbh);
        if (pmb_mysql_num_rows($res)) {
            if ($opac_notices_depliable) {
                $depouill .= $begin_result_liste;
            }
            if ($opac_cart_allow) {
                $depouill .= "<a href=\"cart_info.php?id=" . $id . "&lvl=analysis&header=" . rawurlencode(strip_tags($notice_header)) . "\" target=\"cart_info\" class=\"img_basket\" title='" . $msg["cart_add_result_in"] . "'>" . $msg["cart_add_result_in"] . "</a>";
            }
            $depouill .= "<blockquote>";
            while ($obj = pmb_mysql_fetch_array($res)) {
                $depouill .= pmb_bidi(aff_notice($obj["analysis_notice"]));
            }
            $depouill .= "</blockquote>";
        } else {
            $depouill = $msg["no_analysis"];
        }
        $display .= $res_print;
        $display .= $depouill;
        if ($notice3->visu_expl && (!$notice3->visu_expl_abon || $notice3->visu_expl_abon && $_SESSION["user_code"])) {
            if (!$opac_resa_planning) {
                $resa_check = check_statut(0, $id);
                if ($resa_check) {
                    $requete_resa = "SELECT count(1) FROM resa WHERE resa_idbulletin='{$id}'";
                    $nb_resa_encours = pmb_mysql_result(pmb_mysql_query($requete_resa, $dbh), 0, 0);
                    if ($nb_resa_encours) {
                        $message_nbresa = str_replace("!!nbresa!!", $nb_resa_encours, $msg["resa_nb_deja_resa"]);
                    }
                    if ($_SESSION["user_code"] && $allow_book && $opac_resa && !$popup_resa) {
                        $ret_resa .= "<h3>" . $msg["bulletin_display_resa"] . "</h3>";
                        if ($opac_max_resa == 0 || $opac_max_resa > $nb_resa_encours) {
                            if ($opac_resa_popup) {
                                $ret_resa .= "<a href='#' onClick=\"if(confirm('" . $msg["confirm_resa"] . "')){w=window.open('./do_resa.php?lvl=resa&id_bulletin=" . $id . "&oresa=popup','doresa','scrollbars=yes,width=500,height=600,menubar=0,resizable=yes'); w.focus(); return false;}else return false;\" id=\"bt_resa\">" . $msg["bulletin_display_place_resa"] . "</a>";
                            } else {
                                $ret_resa .= "<a href='./do_resa.php?lvl=resa&id_bulletin=" . $id . "&oresa=popup' onClick=\"return confirm('" . $msg["confirm_resa"] . "')\" id=\"bt_resa\">" . $msg["bulletin_display_place_resa"] . "</a>";
                            }
                            $ret_resa .= $message_nbresa;
                        } else {
                            $ret_resa .= str_replace("!!nb_max_resa!!", $opac_max_resa, $msg["resa_nb_max_resa"]);
                        }
                        $ret_resa .= "<br />";
                    } elseif (!$_SESSION["user_code"] && $opac_resa && !$popup_resa) {
                        // utilisateur pas connecté
                        // préparation lien réservation sans être connecté
                        $ret_resa .= "<h3>" . $msg["bulletin_display_resa"] . "</h3>";
                        if ($opac_resa_popup) {
                            $ret_resa .= "<a href='#' onClick=\"if(confirm('" . $msg["confirm_resa"] . "')){w=window.open('./do_resa.php?lvl=resa&id_bulletin=" . $id . "&oresa=popup','doresa','scrollbars=yes,width=500,height=600,menubar=0,resizable=yes'); w.focus(); return false;}else return false;\" id=\"bt_resa\">" . $msg["bulletin_display_place_resa"] . "</a>";
                        } else {
                            $ret_resa .= "<a href='./do_resa.php?lvl=resa&id_bulletin=" . $id . "&oresa=popup' onClick=\"return confirm('" . $msg["confirm_resa"] . "')\" id=\"bt_resa\">" . $msg["bulletin_display_place_resa"] . "</a>";
                        }
                        $ret_resa .= $message_nbresa;
                        $ret_resa .= "<br />";
                    } elseif ($fonction == 'notice_affichage_custom_bretagne') {
                        if ($opac_resa_popup) {
                            $reserver = "<a href='#' onClick=\"if(confirm('" . $msg["confirm_resa"] . "')){w=window.open('./do_resa.php?lvl=resa&id_notice=" . $this->notice_id . "&oresa=popup','doresa','scrollbars=yes,width=500,height=600,menubar=0,resizable=yes'); w.focus(); return false;}else return false;\" id=\"bt_resa\">" . $msg["bulletin_display_place_resa"] . "</a>";
                        } else {
                            $reserver = "<a href='./do_resa.php?lvl=resa&id_notice=" . $this->notice_id . "&oresa=popup' onClick=\"return confirm('" . $msg["confirm_resa"] . "')\" id=\"bt_resa\">" . $msg["bulletin_display_place_resa"] . "</a>";
                        }
                        $reservernbre = $message_nbresa;
                    } else {
                        $ret_resa = "";
                    }
                    $display .= pmb_bidi($ret_resa);
                }
            }
            if ($opac_show_exemplaires) {
                if ($fonction == 'notice_affichage_custom_bretagne') {
                    $display .= pmb_bidi(notice_affichage_custom_bretagne::expl_list("m", 0, $id));
                } else {
                    $display .= pmb_bidi(notice_affichage::expl_list("m", 0, $id));
                }
            }
        }
        if ($type != "visionneuse" && $notice3->visu_explnum && (!$notice3->visu_explnum_abon || $notice3->visu_explnum_abon && $_SESSION["user_code"])) {
            if ($explnum = show_explnum_per_notice(0, $id, '')) {
                $display .= pmb_bidi("<a name='docnum'><h3>" . $msg["explnum"] . "</h3></a>" . $explnum);
            }
        }
    }
    pmb_mysql_free_result($res);
    $display .= notice_affichage::autres_lectures(0, $id);
    return $display;
}
Exemplo n.º 27
0
require_once "./dsi/func_abo.inc.php";
require_once "./dsi/func_pro.inc.php";
require_once "./dsi/func_common.inc.php";
require_once "./dsi/func_clas.inc.php";
require_once "./dsi/func_equ.inc.php";
require_once "./dsi/func_diff.inc.php";
require_once "./dsi/func_rss.inc.php";
$action_diff_aff = "<h1>" . $msg[dsi_dif_auto_titre] . "</h1>";
// récupérer les bannettes à diffuser
$requete = "SELECT id_bannette, proprio_bannette FROM bannettes ";
$requete .= " WHERE (DATE_ADD(date_last_envoi, INTERVAL periodicite DAY) <= sysdate()) and bannette_auto=1 ";
$res = pmb_mysql_query($requete, $dbh);
while ($bann = pmb_mysql_fetch_object($res)) {
    $liste_bannette[] = $bann->id_bannette;
}
pmb_mysql_free_result($res);
if (!$liste_bannette) {
    $liste_bannette = array();
}
for ($i = 0; $i < sizeof($liste_bannette); $i++) {
    $bannette = new bannette($liste_bannette[$i]);
    $action_diff_aff .= $msg['dsi_dif_vidage'] . ": " . $bannette->nom_bannette . "<br />";
    if (!$bannette->limite_type) {
        $action_diff_aff .= $bannette->vider();
    }
    $action_diff_aff .= $msg['dsi_dif_remplissage'] . ": " . $bannette->nom_bannette;
    $action_diff_aff .= $bannette->remplir();
    $action_diff_aff .= $bannette->purger();
    $action_diff_aff .= "<strong>" . $msg['dsi_dif_diffusion'] . ": " . $bannette->nom_bannette . "</strong><br />";
    $action_diff_aff .= $bannette->diffuser();
}
Exemplo n.º 28
0
 protected function _get_objects_ids()
 {
     global $dbh;
     if (!$this->searched) {
         $query = $this->_get_search_query();
         $this->objects_ids = "";
         $res = pmb_mysql_query($query, $dbh);
         if ($res) {
             if (pmb_mysql_num_rows($res)) {
                 while ($row = pmb_mysql_fetch_object($res)) {
                     if ($this->objects_ids != "") {
                         $this->objects_ids .= ",";
                     }
                     $this->objects_ids .= $row->{$this->object_index_key};
                 }
             }
             pmb_mysql_free_result($res);
         }
         $this->searched = true;
     }
     return $this->objects_ids;
 }
Exemplo n.º 29
0
 function do_header()
 {
     global $msg, $dbh, $base_path;
     global $charset;
     global $pmb_notice_reduit_format;
     global $icon_doc;
     global $tdoc, $biblio_doc;
     global $use_opac_url_base, $opac_url_base, $use_dsi_diff_mode;
     global $no_aff_doc_num_image;
     $aut1_libelle = array();
     $type_reduit = substr($pmb_notice_reduit_format, 0, 1);
     //Icone type de Document
     $icon = $icon_doc[$this->notice->niveau_biblio . $this->notice->typdoc];
     if ($icon) {
         $info_bulle_icon = $biblio_doc[$this->notice->niveau_biblio] . " : " . $tdoc->table[$this->notice->typdoc];
         if ($use_opac_url_base) {
             $this->icondoc = "<img src=\"" . $opac_url_base . "images/{$icon}\" alt=\"{$info_bulle_icon}\" title=\"{$info_bulle_icon}\" align='top' />";
         } else {
             $this->icondoc = "<img src=\"" . $base_path . "/images/{$icon}\" alt=\"{$info_bulle_icon}\" title=\"{$info_bulle_icon}\" align='top' />";
         }
     }
     //Icone nouveauté
     $icon = "icone_nouveautes.png";
     if ($this->notice->notice_is_new) {
         $info_bulle_icon_new = $msg["notice_is_new_gestion"];
         if ($use_opac_url_base) {
             $this->icon_is_new = "<img src=\"" . $opac_url_base . "images/{$icon}\" alt=\"{$info_bulle_icon_new}\" title=\"{$info_bulle_icon_new}\" align='top' />";
         } else {
             $this->icon_is_new = "<img src=\"" . $base_path . "/images/{$icon}\" alt=\"{$info_bulle_icon_new}\" title=\"{$info_bulle_icon_new}\" align='top' />";
         }
     }
     if ($this->notice->statut) {
         $rqt_st = "SELECT class_html , gestion_libelle FROM notice_statut WHERE id_notice_statut='" . $this->notice->statut . "' ";
         $res_st = pmb_mysql_query($rqt_st, $dbh) or die($rqt_st . " " . pmb_mysql_error());
         $class_html = " class='" . pmb_mysql_result($res_st, 0, 0) . "' ";
         if ($this->notice->statut > 1) {
             $txt = pmb_mysql_result($res_st, 0, 1);
         } else {
             $txt = "";
         }
     } else {
         $class_html = " class='statutnot1' ";
         $txt = "";
     }
     if ($this->notice->commentaire_gestion) {
         if ($txt) {
             $txt .= ":\r\n" . $this->notice->commentaire_gestion;
         } else {
             $txt = $this->notice->commentaire_gestion;
         }
     }
     if ($txt) {
         $statut = "<small><span {$class_html} style='margin-right: 3px;'><a href=# onmouseover=\"z=document.getElementById('zoom_statut" . $this->notice_id . "'); z.style.display=''; \" onmouseout=\"z=document.getElementById('zoom_statut" . $this->notice_id . "'); z.style.display='none'; \"><img src='" . $base_path . "/images/spacer.gif' width='10' height='10' /></a></span></small>";
         $statut .= "<div id='zoom_statut" . $this->notice_id . "' style='border: solid 2px #555555; background-color: #FFFFFF; position: absolute; display:none; z-index: 2000;'><b>" . nl2br(htmlentities($txt, ENT_QUOTES, $charset)) . "</b></div>";
     } else {
         $statut = "<small><span {$class_html} style='margin-right: 3px;'><img src='" . $base_path . "/images/spacer.gif' width='10' height='10' /></span></small>";
     }
     $this->aff_statut = $statut;
     if ($type_reduit == "H") {
         $id_tpl = substr($pmb_notice_reduit_format, 2);
         if ($id_tpl) {
             $tpl = new notice_tpl_gen($id_tpl);
             $notice_tpl_header = $tpl->build_notice($this->notice_id);
             if ($notice_tpl_header) {
                 $this->header = $notice_tpl_header;
             }
         }
     }
     if ($type_reduit == "E" || $type_reduit == "P") {
         // peut-être veut-on des personnalisés ?
         $perso_voulus_temp = substr($pmb_notice_reduit_format, 2);
         if ($perso_voulus_temp != "") {
             $perso_voulus = explode(",", $perso_voulus_temp);
         }
     }
     if ($type_reduit == "E") {
         // zone de l'éditeur
         if ($this->notice->ed1_id) {
             $editeur = new editeur($this->notice->ed1_id);
             $editeur_reduit = $editeur->display;
             if ($this->notice->year) {
                 $editeur_reduit .= " (" . $this->notice->year . ")";
             }
         } elseif ($this->notice->year) {
             // année mais pas d'éditeur et si pas un article
             if ($this->notice->niveau_biblio != 'a' && $this->notice->niveau_hierar != 2) {
                 $editeur_reduit = $this->notice->year . " ";
             }
         }
     } else {
         $editeur_reduit = "";
     }
     if ($type_reduit == "E" || $type_reduit == "P") {
         if (!is_object($this->p_perso)) {
             $this->p_perso = new parametres_perso("notices");
         }
         //Champs personalisés à ajouter au réduit
         if (!$this->p_perso->no_special_fields) {
             if (count($perso_voulus)) {
                 $this->p_perso->get_values($this->notice_id);
                 for ($i = 0; $i < count($perso_voulus); $i++) {
                     $perso_voulu_aff .= $this->p_perso->get_formatted_output($this->p_perso->values[$perso_voulus[$i]], $perso_voulus[$i]) . " ";
                 }
                 $perso_voulu_aff = trim($perso_voulu_aff);
             } else {
                 $perso_voulu_aff = "";
             }
         } else {
             $perso_voulu_aff = "";
         }
     }
     if ($type_reduit != "H") {
         // récupération du titre de série
         if ($this->tit_serie) {
             $this->header = $this->header_texte = $this->tit_serie;
             if ($this->notice->tnvol) {
                 $this->header .= ',&nbsp;' . $this->notice->tnvol;
                 $this->header_texte .= ', ' . $this->notice->tnvol;
             }
         } elseif ($this->notice->tnvol) {
             $this->header .= $this->notice->tnvol;
             $this->header_texte .= $this->notice->tnvol;
         }
         $this->tit1 = $this->notice->tit1;
         $this->header ? $this->header .= '.&nbsp;' . $this->tit1 : ($this->header = $this->tit1);
         $this->header_texte ? $this->header_texte .= '. ' . $this->tit1 : ($this->header_texte = $this->tit1);
         $this->memo_titre = $this->header_texte;
         $this->memo_complement_titre = $this->notice->tit4;
         $this->memo_titre_parallele = $this->notice->tit3;
     }
     if ($type_reduit == '4') {
         if ($this->memo_titre_parallele != "") {
             $this->header .= "&nbsp;=&nbsp;" . $this->memo_titre_parallele;
             $this->header_texte .= ' = ' . $this->memo_titre_parallele;
         }
     }
     // 	if ((floor($type_reduit/10) == 1)&&($this->memo_complement_titre)) {
     // 		$this->header.="&nbsp;:&nbsp;".htmlentities($this->memo_complement_titre,ENT_QUOTES,$charset);
     // 		$this->header_texte.=" : ".$this->memo_complement_titre;
     // 	}
     if ($type_reduit == "T" && $this->memo_complement_titre) {
         $this->header .= "&nbsp;:&nbsp;" . htmlentities($this->memo_complement_titre, ENT_QUOTES, $charset);
         $this->header_texte .= " : " . $this->memo_complement_titre;
     }
     if ($type_reduit != '3' && $type_reduit != 'H') {
         //$this->responsabilites
         $as = array_search("0", $this->responsabilites["responsabilites"]);
         if ($as !== FALSE && $as !== NULL) {
             $auteur_0 = $this->responsabilites["auteurs"][$as];
             $auteur = new auteur($auteur_0["id"]);
             if ($auteur->isbd_entry) {
                 $this->header .= ' / ' . $auteur->isbd_entry;
                 $this->header_texte .= ' / ' . $auteur->isbd_entry;
             }
         } else {
             $as = array_keys($this->responsabilites["responsabilites"], "1");
             for ($i = 0; $i < count($as); $i++) {
                 $indice = $as[$i];
                 $auteur_1 = $this->responsabilites["auteurs"][$indice];
                 $auteur = new auteur($auteur_1["id"]);
                 $aut1_libelle[] = $auteur->isbd_entry;
             }
             $auteurs_liste = implode("; ", $aut1_libelle);
             if ($auteurs_liste) {
                 $this->header .= ' / ' . $auteurs_liste;
                 $this->header_texte .= ' / ' . $auteurs_liste;
             }
         }
     }
     if ($editeur_reduit) {
         $this->header .= ' / ' . $editeur_reduit;
         $this->header_texte .= ' / ' . $editeur_reduit;
     }
     if ($perso_voulu_aff) {
         $this->header .= ' / ' . $perso_voulu_aff;
         $this->header_texte .= ' / ' . $perso_voulu_aff;
     }
     switch ($type_reduit) {
         case "1":
             if ($this->notice->year != '') {
                 $this->header .= ' (' . htmlentities($this->notice->year, ENT_QUOTES, $charset) . ')';
                 $this->header_texte .= ' (' . $this->notice->year . ')';
             }
             break;
         case "2":
             if ($this->notice->year != '') {
                 $this->header .= ' (' . htmlentities($this->notice->year, ENT_QUOTES, $charset) . ')';
                 $this->header_texte .= ' (' . $this->notice->year . ')';
             }
             if ($this->notice->code != '') {
                 $this->header .= ' / ' . htmlentities($this->notice->code, ENT_QUOTES, $charset);
                 $this->header_texte .= ' / ' . $this->notice->code;
             }
             break;
         default:
             break;
     }
     if ($this->drag) {
         $drag = "<span onMouseOver='if(init_drag) init_drag();' id=\"NOTI_drag_" . $this->notice_id . ($this->anti_loop ? "_p" . $this->anti_loop[count($this->anti_loop) - 1] : "") . "\"  dragicon=\"" . $base_path . "/images/icone_drag_notice.png\" dragtext=\"" . $this->header . "\" draggable=\"yes\" dragtype=\"notice\" callback_before=\"show_carts\" callback_after=\"\" style=\"padding-left:7px\"><img src=\"" . $base_path . "/images/notice_drag.png\"/></span>";
     }
     if ($this->action) {
         $this->header = "<a href=\"" . $this->action . "\">" . $this->header . '</a>';
     }
     if ($this->icon_is_new) {
         $this->header = $this->header . " " . $this->icon_is_new;
     }
     if ($this->notice->niveau_biblio == 'b') {
         $rqt = "select tit1, date_format(date_date, '" . $msg["format_date"] . "') as aff_date_date, bulletin_numero as num_bull from bulletins,notices where bulletins.num_notice='" . $this->notice_id . "' and notices.notice_id=bulletins.bulletin_notice";
         $execute_query = pmb_mysql_query($rqt);
         $row = pmb_mysql_fetch_object($execute_query);
         $this->header .= " <i>" . (!$row->aff_date_date ? sprintf($msg["bul_titre_perio"], $row->tit1) : sprintf($msg["bul_titre_perio"], $row->tit1 . ", " . $row->num_bull . " [" . $row->aff_date_date . "]")) . "</i>";
         $this->header_texte .= " " . (!$row->aff_date_date ? sprintf($msg["bul_titre_perio"], $row->tit1) : sprintf($msg["bul_titre_perio"], $row->tit1 . ", " . $row->num_bull . " [" . $row->aff_date_date . "]"));
         pmb_mysql_free_result($execute_query);
     }
     if ($this->drag) {
         $this->header .= $drag;
     }
     if ($this->notice->lien) {
         // ajout du lien pour les ressource notice_parent_useds électroniques
         if (!$this->print_mode || $this->print_mode == '2' || $use_dsi_diff_mode) {
             $this->header .= "<a href=\"" . $this->notice->lien . "\" target=\"__LINK__\">";
             if (!$use_opac_url_base) {
                 $this->header .= "<img src=\"" . $base_path . "/images/globe.gif\" border=\"0\" align=\"middle\" hspace=\"3\"";
             } else {
                 $this->header .= "<img src=\"" . $opac_url_base . "images/globe.gif\" border=\"0\" align=\"middle\" hspace=\"3\"";
             }
             $this->header .= " alt=\"";
             $this->header .= $this->notice->eformat;
             $this->header .= "\" title=\"";
             $this->header .= $this->notice->eformat;
             $this->header .= "\">";
             $this->header .= '</a>';
         } elseif ($this->print_mode == '4') {
             $this->header .= '<br />';
             $this->header .= "<a href=\"" . $this->notice->lien . "\" target=\"__LINK__\">";
             $this->header .= '<font size="-1">' . $this->notice->lien . '</font>';
             $this->header .= '</a>';
         } else {
             $this->header .= "<br />";
             $this->header .= '<font size="-1">' . $this->notice->lien . '</font>';
         }
     }
     if (!$this->print_mode || $this->print_mode == '2' && !$no_aff_doc_num_image) {
         if ($this->notice->niveau_biblio == 'b') {
             $sql_explnum = "SELECT explnum_id, explnum_nom FROM explnum, bulletins WHERE bulletins.num_notice = " . $this->notice_id . " AND bulletins.bulletin_id = explnum.explnum_bulletin order by explnum_id";
         } else {
             $sql_explnum = "SELECT explnum_id, explnum_nom FROM explnum WHERE explnum_notice = " . $this->notice_id;
         }
         $explnums = pmb_mysql_query($sql_explnum);
         $explnumscount = pmb_mysql_num_rows($explnums);
         if ($explnumscount == 1) {
             $explnumrow = pmb_mysql_fetch_object($explnums);
             if (!$use_opac_url_base) {
                 $this->header .= "<a href=\"" . $base_path . "/doc_num.php?explnum_id=" . $explnumrow->explnum_id . "\" target=\"__LINK__\">";
             } else {
                 $this->header .= "<a href=\"" . $opac_url_base . "doc_num.php?explnum_id=" . $explnumrow->explnum_id . "\" target=\"__LINK__\">";
             }
             if (!$use_opac_url_base) {
                 $this->header .= "<img src=\"" . $base_path . "/images/globe_orange.png\" border=\"0\" align=\"middle\" hspace=\"3\"";
             } else {
                 $this->header .= "<img src=\"" . $opac_url_base . "images/globe_orange.png\" border=\"0\" align=\"middle\" hspace=\"3\"";
             }
             $this->header .= " alt=\"";
             $this->header .= htmlentities($explnumrow->explnum_nom, ENT_QUOTES, $charset);
             $this->header .= "\" title=\"";
             $this->header .= htmlentities($explnumrow->explnum_nom, ENT_QUOTES, $charset);
             $this->header .= "\">";
             $this->header .= '</a>';
         } else {
             if ($explnumscount > 1) {
                 if (!$use_opac_url_base) {
                     $this->header .= "<img src=\"" . $base_path . "/images/globe_rouge.png\" border=\"0\" align=\"middle\" alt=\"" . $msg['info_docs_num_notice'] . "\" title=\"" . $msg['info_docs_num_notice'] . "\" hspace=\"3\">";
                 } else {
                     $this->header .= "<img src=\"" . $opac_url_base . "images/globe_rouge.png\" border=\"0\" align=\"middle\" alt=\"" . $msg['info_docs_num_notice'] . "\" title=\"" . $msg['info_docs_num_notice'] . "\" hspace=\"3\">";
                 }
             }
         }
     }
     if ($this->icondoc) {
         $this->header = $this->icondoc . " " . $this->header;
     }
     if ($this->show_statut) {
         $this->header = $this->aff_statut . " " . $this->header;
     }
 }
Exemplo n.º 30
0
 function get_primaldata()
 {
     global $dbh;
     global $fonction_auteur;
     // on récupère les infos de la notice
     $query = "select * from notices where notice_id=" . $this->id . " limit 1";
     $result = pmb_mysql_query($query, $dbh);
     if (pmb_mysql_num_rows($result)) {
         $obj = pmb_mysql_fetch_object($result);
         pmb_mysql_free_result($result);
         $this->get_primaldatafrom($obj);
     }
 }