Пример #1
0
function aff_cart_objects($idcaddie = 0, $url_base = "./catalog.php?categ=caddie&sub=gestion&quoi=panier&idcaddie=0", $no_del = false, $rec_history = 0, $no_point = false)
{
    global $msg;
    global $dbh;
    global $begin_result_liste, $end_result_liste;
    global $affich_tris_result_liste;
    global $pmb_nb_max_tri;
    global $nbr_lignes, $page, $nb_per_page_search;
    global $url_base_suppr_cart;
    $url_base_suppr_cart = $url_base;
    $cb_display = "\n\t\t\t<div id=\"el!!id!!Parent\" class=\"notice-parent\">\n\t    \t\t<span class=\"notice-heada\">!!heada!!</span>\n\t    \t\t<br />\n\t\t\t</div>\n\t\t\t";
    // nombre de références par pages
    if ($nb_per_page_search != "") {
        $nb_per_page = $nb_per_page_search;
    } else {
        $nb_per_page = 10;
    }
    // on récupére le nombre de lignes
    if (!$nbr_lignes) {
        $requete = "SELECT count(1) FROM caddie_content where caddie_id='" . $idcaddie . "' ";
        $res = pmb_mysql_query($requete, $dbh);
        $nbr_lignes = pmb_mysql_result($res, 0, 0);
    }
    if (!$page) {
        $page = 1;
    }
    $debut = ($page - 1) * $nb_per_page;
    //Calcul des variables pour la suppression de notices
    $modulo = $nbr_lignes % $nb_per_page;
    if ($modulo == 1) {
        $page_suppr = !$page ? 1 : $page - 1;
    } else {
        $page_suppr = $page;
    }
    $nb_after_suppr = $nbr_lignes ? $nbr_lignes - 1 : 0;
    if ($nbr_lignes) {
        // on lance la vraie requête
        $myCart = new caddie($idcaddie);
        $caddie_type = $myCart->type;
        switch ($caddie_type) {
            case "NOTI":
                $from = " caddie_content left join notices on notice_id = object_id ";
                $order_by = " index_sew ";
                break;
            case "EXPL":
                $from = " caddie_content left join exemplaires on expl_id=object_id left join notices on notice_id = expl_notice ";
                $order_by = " index_sew ";
                break;
            case "BULL":
                $from = " caddie_content left join bulletins on bulletin_id = object_id ";
                $order_by = " date_date ";
                break;
        }
        $requete = "SELECT * FROM {$from} where caddie_id='" . $idcaddie . "' order by {$order_by}";
        $requete .= " LIMIT {$debut},{$nb_per_page} ";
        //gestion du tri
        if ($caddie_type == "NOTI") {
            if ($nbr_lignes <= $pmb_nb_max_tri) {
                if ($_SESSION["tri"]) {
                    $requete = "SELECT notice_id,caddie_content.* FROM {$from} where caddie_id='" . $idcaddie . "'";
                    $sort = new sort('notices', 'base');
                    $requete = $sort->appliquer_tri($_SESSION["tri"], $requete, "notice_id", $debut, $nb_per_page);
                }
            }
        }
        // fin gestion tri
        $nav_bar = aff_pagination($url_base, $nbr_lignes, $nb_per_page, $page, 10, false, true);
        // l'affichage du résultat est fait après le else
    } else {
        print $msg[399];
        return;
    }
    $liste = array();
    $result = @pmb_mysql_query($requete, $dbh);
    // or die (pmb_mysql_error());
    if ($result) {
        if (pmb_mysql_num_rows($result)) {
            while ($temp = pmb_mysql_fetch_object($result)) {
                $liste[] = array('object_id' => $temp->object_id, 'content' => $temp->content, 'blob_type' => $temp->blob_type, 'flag' => $temp->flag);
            }
        }
    }
    if (!sizeof($liste) || !is_array($liste)) {
        print $msg[399];
        return;
    } else {
        print "\n\t\t<script>\n\t\t\tvar ajax_pointage=new http_request();\n\t\t\tvar num_caddie=0;\n\t\t\tvar num_item=0;\n\t\t\tvar action='';\n\t\t\tfunction add_pointage_item(idcaddie,id_item) {\n\t\t\t\tnum_caddie=idcaddie;\n\t\t\t\tnum_item=id_item;\n\t\t\t\taction='add_item';\t\n\t\t\t\tvar url = './ajax.php?module=catalog&categ=pointage_add&sub=pointage&moyen=manu&action=add_item&idcaddie='+idcaddie+'&id_item='+id_item;\n\t\t \t\tajax_pointage.request(url,0,'',1,pointage_callback,0,0);\n\t\t\t}\n\t\t\t\n\t\t\tfunction del_pointage_item(idcaddie,id_item) {\n\t\t\t\tnum_caddie=idcaddie;\n\t\t\t\tnum_item=id_item;\n\t\t\t\taction='del_item';\n\t\t\t\tvar url = './ajax.php?module=catalog&categ=pointage_del&sub=pointage&moyen=manu&action=del_item&idcaddie='+idcaddie+'&id_item='+id_item;\n\t\t\t\tajax_pointage.request(url,0,'',1,pointage_callback,0,0);   \n\t\t\t}\n\t\t\tfunction pointage_callback(response) {\n\t\t\t\tdata = eval('('+response+')');\n\t\t\t\tswitch (action) {\n\t\t\t\t\tcase 'add_item':\n\t\t\t\t\t\tif (data.res_pointage == 1) {\n\t\t\t\t\t\t\tdocument.getElementById('caddie_'+num_caddie+'_item_'+num_item).src='./images/depointer.png';\n\t\t\t\t\t\t\tdocument.getElementById('caddie_'+num_caddie+'_item_'+num_item).title='" . $msg['caddie_item_depointer'] . "';\n\t\t\t\t\t\t\tdocument.getElementById('caddie_'+num_caddie+'_item_'+num_item).setAttribute('onclick','del_pointage_item('+num_caddie+','+num_item+')');\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tdocument.getElementById('caddie_'+num_caddie+'_item_'+num_item).src='./images/pointer.png';\n\t\t\t\t\t\t\tdocument.getElementById('caddie_'+num_caddie+'_item_'+num_item).title='" . $msg['caddie_item_pointer'] . "';\n\t\t\t\t\t\t\tdocument.getElementById('caddie_'+num_caddie+'_item_'+num_item).setAttribute('onclick','add_pointage_item('+num_caddie+','+num_item+')');\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'del_item':\n\t\t\t\t\t\tif (data.res_pointage == 1) {\n\t\t\t\t\t\t\tdocument.getElementById('caddie_'+num_caddie+'_item_'+num_item).src='./images/pointer.png';\n\t\t\t\t\t\t\tdocument.getElementById('caddie_'+num_caddie+'_item_'+num_item).title='" . $msg['caddie_item_pointer'] . "';\n\t\t\t\t\t\t\tdocument.getElementById('caddie_'+num_caddie+'_item_'+num_item).setAttribute('onclick','add_pointage_item('+num_caddie+','+num_item+')');\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tdocument.getElementById('caddie_'+num_caddie+'_item_'+num_item).src='./images/depointer.png';\n\t\t\t\t\t\t\tdocument.getElementById('caddie_'+num_caddie+'_item_'+num_item).title='" . $msg['caddie_item_depointer'] . "';\n\t\t\t\t\t\t\tdocument.getElementById('caddie_'+num_caddie+'_item_'+num_item).setAttribute('onclick','del_pointage_item('+num_caddie+','+num_item+')');\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tvar div = document.createElement('div');\n\t\t\t\tdiv.setAttribute('id','cart_'+data.idcaddie+'_nb_items');\n\t\t\t\tdiv.innerHTML = data.aff_cart_nb_items;\n\t\t\t\tdocument.getElementById('cart_'+data.idcaddie+'_nb_items').parentNode.replaceChild(div,document.getElementById('cart_'+data.idcaddie+'_nb_items'));\n\t\t\t}\n\t\t</script>";
        // en fonction du type de caddie on affiche ce qu'il faut
        if ($caddie_type == "NOTI") {
            // boucle de parcours des notices trouvées
            // inclusion du javascript de gestion des listes dépliables
            // début de liste
            print $begin_result_liste;
            //Affichage du lien impression et panier
            if ($rec_history && $_SESSION["CURRENT"] !== false) {
                $current = $_SESSION["CURRENT"];
                print "&nbsp;<a href='#' onClick=\"openPopUp('./print_cart.php?current_print={$current}&action=print_prepare','print',600,700,-2,-2,'scrollbars=yes,menubar=0'); return false;\"><img src='./images/basket_small_20x20.gif' border='0' align='center' alt=\"" . $msg["histo_add_to_cart"] . "\" title=\"" . $msg["histo_add_to_cart"] . "\"></a>&nbsp;<a href='#' onClick=\"openPopUp('./print.php?current_print={$current}&action_print=print_prepare','print',500,600,-2,-2,'scrollbars=yes,menubar=0'); return false;\"><img src='./images/print.gif' border='0' align='center' alt=\"" . $msg["histo_print"] . "\" title=\"" . $msg["histo_print"] . "\"/></a>";
                print "&nbsp;<a href='#' onClick=\"openPopUp('./download.php?current_download={$current}&action_download=download_prepare" . $tri_id_info . "','download',500,600,-2,-2,'scrollbars=yes,menubar=0'); return false;\"><img src='./images/upload_docnum.gif' border='0' align='center' alt=\"" . $msg["docnum_download"] . "\" title=\"" . $msg["docnum_download"] . "\"/></a>";
                if ($nbr_lignes <= $pmb_nb_max_tri) {
                    print "&nbsp;" . $affich_tris_result_liste;
                }
            }
            print caddie::show_actions($idcaddie, $caddie_type);
            while (list($cle, $object) = each($liste)) {
                if ($object[content] == "") {
                    // affichage de la liste des notices sous la forme 'expandable'
                    $requete = "SELECT * FROM notices WHERE notice_id={$object['object_id']} LIMIT 1";
                    $fetch = pmb_mysql_query($requete);
                    if (pmb_mysql_num_rows($fetch)) {
                        $notice = pmb_mysql_fetch_object($fetch);
                        if ($notice->niveau_biblio == 'b') {
                            // notice de bulletin
                            $rqtbull = "select bulletin_id from bulletins where num_notice=" . $notice->notice_id;
                            $fetchbull = pmb_mysql_query($rqtbull);
                            $bull = pmb_mysql_fetch_object($fetchbull);
                            $link = "./catalog.php?categ=serials&sub=bulletinage&action=view&bul_id=" . $bull->bulletin_id;
                            // pas affichés pour l'instant:
                            $link_expl = '';
                            $link_explnum = '';
                            if (!$no_point) {
                                if ($object[flag]) {
                                    $marque_flag = "<img src='images/depointer.png' id='caddie_" . $idcaddie . "_item_" . $notice->notice_id . "' title=\"" . $msg['caddie_item_depointer'] . "\" onClick='del_pointage_item(" . $idcaddie . "," . $notice->notice_id . ");' style='cursor: pointer'/>";
                                } else {
                                    $marque_flag = "<img src='images/pointer.png' id='caddie_" . $idcaddie . "_item_" . $notice->notice_id . "' title=\"" . $msg['caddie_item_pointer'] . "\" onClick='add_pointage_item(" . $idcaddie . "," . $notice->notice_id . ");' style='cursor: pointer'/>";
                                }
                            } else {
                                if ($object[flag]) {
                                    $marque_flag = "<img src='images/tick.gif'/>";
                                } else {
                                    $marque_flag = "";
                                }
                            }
                            if (!$no_del) {
                                $lien_suppr_cart = "<a href='{$url_base}&action=del_item&object_type=NOTI&item={$notice->notice_id}&page={$page_suppr}&nbr_lignes={$nb_after_suppr}&nb_per_page={$nb_per_page}'><img src='./images/basket_empty_20x20.gif' alt='basket' title=\"" . $msg[caddie_icone_suppr_elt] . "\" /></a> {$marque_flag}";
                            } else {
                                $lien_suppr_cart = $marque_flag;
                            }
                            $display = new mono_display($notice, 6, $link, 1, $link_expl, $lien_suppr_cart, $link_explnum, 0, 0, 1, 1);
                            print pmb_bidi($display->result);
                        } elseif ($notice->niveau_biblio != 's' && $notice->niveau_biblio != 'a') {
                            // notice de monographie
                            $link = './catalog.php?categ=isbd&id=!!id!!';
                            $link_expl = './catalog.php?categ=edit_expl&id=!!notice_id!!&cb=!!expl_cb!!&expl_id=!!expl_id!!';
                            $link_explnum = './catalog.php?categ=edit_explnum&id=!!notice_id!!&explnum_id=!!explnum_id!!';
                            if (!$no_point) {
                                if ($object[flag]) {
                                    $marque_flag = "<img src='images/depointer.png' id='caddie_" . $idcaddie . "_item_" . $notice->notice_id . "' title=\"" . $msg['caddie_item_depointer'] . "\" onClick='del_pointage_item(" . $idcaddie . "," . $notice->notice_id . ");' style='cursor: pointer'/>";
                                } else {
                                    $marque_flag = "<img src='images/pointer.png' id='caddie_" . $idcaddie . "_item_" . $notice->notice_id . "' title=\"" . $msg['caddie_item_pointer'] . "\" onClick='add_pointage_item(" . $idcaddie . "," . $notice->notice_id . ");' style='cursor: pointer'/>";
                                }
                            } else {
                                if ($object[flag]) {
                                    $marque_flag = "<img src='images/tick.gif'/>";
                                } else {
                                    $marque_flag = "";
                                }
                            }
                            if (!$no_del) {
                                $lien_suppr_cart = "<a href='{$url_base}&action=del_item&object_type=NOTI&item={$notice->notice_id}&page={$page_suppr}&nbr_lignes={$nb_after_suppr}&nb_per_page={$nb_per_page}'><img src='./images/basket_empty_20x20.gif' alt='basket' title=\"" . $msg[caddie_icone_suppr_elt] . "\" /></a> {$marque_flag}";
                            } else {
                                $lien_suppr_cart = $marque_flag;
                            }
                            $display = new mono_display($notice, 6, $link, 1, $link_expl, $lien_suppr_cart, $link_explnum, 0, 0, 1, 1);
                            print pmb_bidi($display->result);
                        } else {
                            // on a affaire à un périodique
                            // préparation des liens pour lui
                            $link_serial = './catalog.php?categ=serials&sub=view&serial_id=!!id!!';
                            $link_analysis = './catalog.php?categ=serials&sub=bulletinage&action=view&bul_id=!!bul_id!!&art_to_show=!!id!!';
                            $link_bulletin = './catalog.php?categ=serials&sub=bulletinage&action=view&bul_id=!!id!!';
                            if (!$no_point) {
                                if ($object[flag]) {
                                    $marque_flag = "<img src='images/depointer.png' id='caddie_" . $idcaddie . "_item_" . $notice->notice_id . "' title=\"" . $msg['caddie_item_depointer'] . "\" onClick='del_pointage_item(" . $idcaddie . "," . $notice->notice_id . ");' style='cursor: pointer'/>";
                                } else {
                                    $marque_flag = "<img src='images/pointer.png' id='caddie_" . $idcaddie . "_item_" . $notice->notice_id . "' title=\"" . $msg['caddie_item_pointer'] . "\" onClick='add_pointage_item(" . $idcaddie . "," . $notice->notice_id . ");' style='cursor: pointer'/>";
                                }
                            } else {
                                if ($object[flag]) {
                                    $marque_flag = "<img src='images/tick.gif'/>";
                                } else {
                                    $marque_flag = "";
                                }
                            }
                            if (!$no_del) {
                                $lien_suppr_cart = "<a href='{$url_base}&action=del_item&action=del_item&object_type=NOTI&item={$notice->notice_id}&page={$page_suppr}&nbr_lignes={$nb_after_suppr}&nb_per_page={$nb_per_page}'><img src='./images/basket_empty_20x20.gif' alt='basket' title=\"" . $msg[caddie_icone_suppr_elt] . "\" /></a> {$marque_flag}";
                            } else {
                                $lien_suppr_cart = $marque_flag;
                            }
                            if ($notice->niveau_biblio == 's') {
                                $link_explnum = "./catalog.php?categ=serials&sub=explnum_form&serial_id=!!serial_id!!&explnum_id=!!explnum_id!!";
                            } else {
                                $link_explnum = "./catalog.php?categ=serials&sub=analysis&action=explnum_form&bul_id=!!bul_id!!&analysis_id=!!analysis_id!!&explnum_id=!!explnum_id!!";
                            }
                            $serial = new serial_display($notice, 6, $link_serial, $link_analysis, $link_bulletin, $lien_suppr_cart, $link_explnum, 0, 0, 1, 1);
                            print pmb_bidi($serial->result);
                        }
                    }
                } else {
                    if ($object[flag]) {
                        $marque_flag = "<img src='images/tick.gif'/>";
                    } else {
                        $marque_flag = "";
                    }
                    if (!$no_del) {
                        $lien_suppr_cart = "<a href='{$url_base}&action=del_item&object_type=EXPL_CB&item=" . $object[content] . "&page={$page_suppr}&nbr_lignes={$nb_after_suppr}&nb_per_page={$nb_per_page}'><img src='./images/basket_empty_20x20.gif' alt='basket' title=\"" . $msg[caddie_icone_suppr_elt] . "\" /></a> {$marque_flag}";
                    } else {
                        $lien_suppr_cart = $marque_flag;
                    }
                    $cb_display = "\n\t\t\t\t\t\t<div id=\"el!!id!!Parent\" class=\"notice-parent\">\n\t\t\t\t    \t\t<span class=\"notice-heada\"><strong>{$lien_suppr_cart} " . $msg["4014"] . " : {$object['content']}&nbsp;: {$msg[395]}</strong></span>\n\t\t\t\t    \t\t<br />\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t";
                    print $cb_display;
                }
            }
            // fin de liste
            print $end_result_liste;
        }
        // fin si NOTI
        // si EXPL
        if ($caddie_type == "EXPL") {
            // boucle de parcours des exemplaires trouvés
            // inclusion du javascript de gestion des listes dépliables
            // début de liste
            print $begin_result_liste;
            print caddie::show_actions($idcaddie, $caddie_type);
            while (list($cle, $expl) = each($liste)) {
                if (!$expl[content]) {
                    if ($stuff = get_expl_info($expl[object_id])) {
                        if (!$no_point) {
                            if ($expl[flag]) {
                                $marque_flag = "<img src='images/depointer.png' id='caddie_" . $idcaddie . "_item_" . $stuff->expl_id . "' title=\"" . $msg['caddie_item_depointer'] . "\" onClick='del_pointage_item(" . $idcaddie . "," . $stuff->expl_id . ");' style='cursor: pointer'/>";
                            } else {
                                $marque_flag = "<img src='images/pointer.png' id='caddie_" . $idcaddie . "_item_" . $stuff->expl_id . "' title=\"" . $msg['caddie_item_pointer'] . "\" onClick='add_pointage_item(" . $idcaddie . "," . $stuff->expl_id . ");' style='cursor: pointer'/>";
                            }
                        } else {
                            if ($expl[flag]) {
                                $marque_flag = "<img src='images/tick.gif'/>";
                            } else {
                                $marque_flag = "";
                            }
                        }
                        if (!$no_del) {
                            $stuff->lien_suppr_cart = "<a href='{$url_base}&action=del_item&object_type=EXPL&item={$stuff->expl_id}&page={$page_suppr}&nbr_lignes={$nb_after_suppr}&nb_per_page={$nb_per_page}'><img src='./images/basket_empty_20x20.gif' alt='basket' title=\"" . $msg[caddie_icone_suppr_elt] . "\" /></a> {$marque_flag}";
                        } else {
                            $stuff->lien_suppr_cart = $marque_flag;
                        }
                        $stuff = check_pret($stuff);
                        print pmb_bidi(print_info($stuff, 0, 1));
                    } else {
                        print "<strong>ID : {$expl['object_id']}&nbsp;: {$msg[395]}</strong>";
                    }
                } else {
                    if (!$no_point) {
                        if ($expl[flag]) {
                            $marque_flag = "<img src='images/depointer.png' id='caddie_" . $idcaddie . "_item_" . $stuff->expl_id . "' title=\"" . $msg['caddie_item_depointer'] . "\" onClick='del_pointage_item(" . $idcaddie . "," . $stuff->expl_id . ");' style='cursor: pointer'/>";
                        } else {
                            $marque_flag = "<img src='images/pointer.png' id='caddie_" . $idcaddie . "_item_" . $stuff->expl_id . "' title=\"" . $msg['caddie_item_pointer'] . "\" onClick='add_pointage_item(" . $idcaddie . "," . $stuff->expl_id . ");' style='cursor: pointer'/>";
                        }
                    } else {
                        if ($expl[flag]) {
                            $marque_flag = "<img src='images/tick.gif'/>";
                        } else {
                            $marque_flag = "";
                        }
                    }
                    if (!$no_del) {
                        $lien_suppr_cart = "<a href='{$url_base}&action=del_item&object_type=EXPL_CB&item=" . $expl[content] . "&page={$page_suppr}&nbr_lignes={$nb_after_suppr}&nb_per_page={$nb_per_page}'><img src='./images/basket_empty_20x20.gif' alt='basket' title=\"" . $msg[caddie_icone_suppr_elt] . "\" /></a> {$marque_flag}";
                    } else {
                        $lien_suppr_cart = $marque_flag;
                    }
                    $cb_display = "\n\t\t\t\t\t\t<div id=\"el!!id!!Parent\" class=\"notice-parent\">\n\t\t\t\t    \t\t<span class=\"notice-heada\"><strong>{$lien_suppr_cart} Code-barre : {$expl['content']}&nbsp;: {$msg[395]}</strong></span>\n\t\t\t\t    \t\t<br />\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t";
                    print $cb_display;
                }
            }
            // fin de liste
            print $end_result_liste;
        }
        // fin si EXPL
        if ($caddie_type == "BULL") {
            // boucle de parcours des bulletins trouvés
            // inclusion du javascript de gestion des listes dépliables
            // début de liste
            print $begin_result_liste;
            print caddie::show_actions($idcaddie, $caddie_type);
            while (list($cle, $expl) = each($liste)) {
                if (!$no_del) {
                    $show_del = 1;
                } else {
                    $show_del = 0;
                }
                if ($bull_aff = show_bulletinage_info($expl[object_id], 0, $show_del, $expl[flag], 1)) {
                    print pmb_bidi($bull_aff);
                } else {
                    if (!$no_point) {
                        if ($expl[flag]) {
                            $marque_flag = "<img src='images/depointer.png' id='caddie_" . $idcaddie . "_item_" . $expl[object_id] . "' title=\"" . $msg['caddie_item_depointer'] . "\" onClick='del_pointage_item(" . $idcaddie . "," . $expl[object_id] . ");' style='cursor: pointer'/>";
                        } else {
                            $marque_flag = "<img src='images/pointer.png' id='caddie_" . $idcaddie . "_item_" . $expl[object_id] . "' title=\"" . $msg['caddie_item_pointer'] . "\" onClick='add_pointage_item(" . $idcaddie . "," . $expl[object_id] . ");' style='cursor: pointer'/>";
                        }
                    } else {
                        if ($expl[flag]) {
                            $marque_flag = "<img src='images/tick.gif'/>";
                        } else {
                            $marque_flag = "";
                        }
                    }
                    if (!$no_del) {
                        $lien_suppr_cart = "<a href='{$url_base}&action=del_item&object_type=EXPL_CB&item=" . $expl[content] . "&page={$page_suppr}&nbr_lignes={$nb_after_suppr}&nb_per_page={$nb_per_page}'><img src='./images/basket_empty_20x20.gif' alt='basket' title=\"" . $msg[caddie_icone_suppr_elt] . "\" /></a> {$marque_flag}";
                    } else {
                        $lien_suppr_cart = $marque_flag;
                    }
                    $cb_display = "\n\t\t\t\t\t\t<div id=\"el!!id!!Parent\" class=\"notice-parent\">\n\t\t\t\t    \t\t<span class=\"notice-heada\"><strong>{$lien_suppr_cart} Code-barre : {$expl['content']}&nbsp;: {$msg[395]}</strong></span>\n\t\t\t\t    \t\t<br />\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t";
                    print $cb_display;
                }
            }
            // fin de liste
            print $end_result_liste;
        }
        // fin si BULL
    }
    print "<br />" . $nav_bar;
    return;
}
Пример #2
0
    $param_path == "";
    _parser_($fic_catal, array("ITEM" => "_item_"), "CATALOG");
    //Lecture des paramètres
    _parser_("imports/" . $param_path . "/params.xml", array("OUTPUT" => "_output_", "INPUT" => "_input_"), "PARAMS");
    //Si l'export est spécial, on charge la fonction d'export
    if ($specialexport) {
        require_once "imports/" . $param_path . "/export.inc.php";
    }
}
//Requête de sélection et de comptage des notices
if ($n_current == "") {
    $n_current = 0;
}
//Récupération des notices
$n_notices = 0;
$myCart = new caddie($idcaddie);
//Pour le cas ou on a un panier d'exemplaire avec des exemplaires de bulletin
$bulletin_a_exporter = array();
switch ($myCart->type) {
    case "NOTI":
        $liste_flag = array();
        $liste_no_flag = array();
        if ($elt_flag) {
            $liste_flag = $myCart->get_cart("FLAG");
        }
        if ($elt_no_flag) {
            $liste_no_flag = $myCart->get_cart("NOFLAG");
        }
        $liste = $liste_flag;
        for ($i = 0; $i < count($liste_no_flag); $i++) {
            $liste[] = $liste_no_flag[$i];
Пример #3
0
        $myCart = new caddie(0);
        $myCart->name = pmb_preg_replace('/\\"|\'/', ' ', stripslashes($cart_name));
        $myCart->type = $cart_type;
        $myCart->comment = pmb_preg_replace('/\\"|\'/', ' ', stripslashes($cart_comment));
        if (is_array($cart_autorisations)) {
            $autorisations = implode(" ", $cart_autorisations);
        } else {
            $autorisations = "";
        }
        $myCart->autorisations = $autorisations;
        $myCart->create_cart();
        aff_paniers($idcaddie, "NOTI", "./circ.php?categ=resa_planning&resa_action=search_resa&mode=3&unq=" . md5(microtime()) . "&id_empr={$id_empr}&groupID={$groupID}", "add_item", "Sélectionnez un caddie pour en afficher le contenu", "NOTI", 0, 1, 1);
        break;
    default:
        if ($idcaddie) {
            $myCart = new caddie($idcaddie);
            print pmb_bidi("<div class=\"row\"><b>Panier&nbsp;: " . $myCart->name . ' (' . $myCart->type . ')</b></div>');
            aff_cart_notices($myCart->get_cart(), $myCart->type, $idcaddie);
        } else {
            aff_paniers($idcaddie, "NOTI", "./circ.php?categ=resa_planning&resa_action=search_resa&mode=3&unq=" . md5(microtime()) . "&id_empr={$id_empr}&groupID={$groupID}", "add_item", "Sélectionnez un caddie pour en afficher le contenu", "NOTI", 0, 1, 1);
        }
}
// affichage du contenu du caddie à partir de $liste qui contient les object_id
function aff_cart_notices($liste, $caddie_type = "", $idcaddie = 0)
{
    global $msg;
    global $dbh;
    global $begin_result_liste, $end_result_liste;
    global $end_result_list;
    global $id_empr;
    global $groupID;
Пример #4
0
 switch ($action) {
     case 'choix_quoi':
         if ($idcaddie_selected) {
             $myCart_selected = new caddie($idcaddie_selected);
             print pmb_bidi(aff_cart_titre($myCart_selected));
             print aff_cart_nb_items($myCart_selected);
             print aff_choix_quoi("./catalog.php?categ=caddie&sub=pointage&moyen=panier&action=pointe_item&idcaddie={$idcaddie}&idcaddie_selected={$idcaddie_selected}", "./catalog.php?categ=caddie&sub=pointage&moyen=panier&action=&object_type=NOTI&idcaddie={$idcaddie}&item=0", $msg["caddie_choix_pointe_panier"], $msg["caddie_item_pointer"], "", false, $myCart->type);
         }
         print pmb_bidi(aff_cart_titre($myCart));
         print aff_cart_nb_items($myCart);
         break;
     case 'pointe_item':
         print pmb_bidi(aff_cart_titre($myCart));
         print aff_cart_nb_items($myCart);
         if ($idcaddie_selected) {
             $myCart_selected = new caddie($idcaddie_selected);
             $liste_0 = $liste_1 = array();
             if ($elt_flag) {
                 $liste_0 = $myCart_selected->get_cart("FLAG", $elt_flag_inconnu);
             }
             if ($elt_no_flag) {
                 $liste_1 = $myCart_selected->get_cart("NOFLAG", $elt_no_flag_inconnu);
             }
             $liste = array_merge($liste_0, $liste_1);
             if ($liste) {
                 while (list($cle, $object) = each($liste)) {
                     $myCart->pointe_item($object, $myCart_selected->type);
                 }
             }
         }
         print "<h3>" . $msg["caddie_menu_pointage_apres_pointage"] . "</h3>";
Пример #5
0
// +-------------------------------------------------+
// $Id: impr_cote_suite.php,v 1.2 2009-10-26 17:56:23 dbellamy Exp $
$base_path = "../../..";
$class_path = "{$base_path}/classes";
$base_noheader = 1;
require_once "{$base_path}/includes/init.inc.php";
require_once "{$class_path}/fpdf.class.php";
require_once "{$class_path}/ufpdf.class.php";
require_once "{$class_path}/fpdf_etiquette.class.php";
require_once "{$class_path}/caddie.class.php";
if ($pmb_label_construct_script) {
    require_once "../{$pmb_label_construct_script}";
} else {
    require_once "../custom_label_no_script.inc.php";
}
$myCart = new caddie($idcaddie);
if ($elt_flag && $elt_no_flag) {
    $liste = $myCart->get_cart("ALL");
}
if ($elt_flag && !$elt_no_flag) {
    $liste = $myCart->get_cart("FLAG");
}
if ($elt_no_flag && !$elt_flag) {
    $liste = $myCart->get_cart("NOFLAG");
}
// Démarrage et configuration du pdf
$nom_classe = $fpdf . "_Etiquette";
$pdf = new $nom_classe($label_grid_nb_per_row, $label_grid_nb_per_col, $page_orientation, $unit, $page_format);
$pdf->Open();
$pdf->SetPageMargins($label_grid_from_top, '0', $label_grid_from_left, '0');
$pdf->SetSticksMargins(0, 0, 0, 0);
Пример #6
0
$base_noheader = 1;
$base_nobody = 1;
$base_auth = "CATALOGAGE_AUTH";
require_once "includes/init.inc.php";
require_once "{$class_path}/caddie.class.php";
header("Content-Type: text/html; charset={$charset}");
//si id_notice est présent, il s'agit de l'accès rapide aux paniers (div apparaissant sur mouseOver icone panier)
//sinon, il s'agit de la liste des paniers pour le drag and drop
if ($id_notice) {
    $list_noti = caddie::get_cart_list("NOTI", 1);
    $list_expl = array();
    $list_bull = array();
} else {
    $list_noti = caddie::get_cart_list("NOTI", 0);
    $list_expl = caddie::get_cart_list("EXPL", 0);
    $list_bull = caddie::get_cart_list("BULL", 0);
}
$is_cart = 0;
if ($id_notice) {
    $link = "<a href='#' id='close_cart_div' ><img border='0' align='middle' src='images/close.gif'/></a>";
} else {
    $link = "<a href='#' id='close_cart_pannel' ><img border='0' align='middle' src='images/close.gif'/></a>";
}
print "<div><table width='100%'><tbody><tr><td align='left' width='90%'></td><td align='right'>{$link}</td></tr></tbody></table></div>";
if (count($list_noti)) {
    print "<h3>{$msg['396']}</h3><br />";
    for ($i = 0; $i < count($list_noti); $i++) {
        if ($id_notice) {
            $pannel_cart_link = "javascript:notice_div_caddie(" . $id_notice . "," . $list_noti[$i]["idcaddie"] . ")";
        } else {
            $pannel_cart_link = "catalog.php?categ=caddie&sub=gestion&quoi=panier&action=&object_type=NOTI&idcaddie=" . $list_noti[$i]["idcaddie"] . "&item=0";
Пример #7
0
<?php

// +-------------------------------------------------+
// © 2002-2004 PMB Services / www.sigb.net pmb@sigb.net et contributeurs (voir www.sigb.net)
// +-------------------------------------------------+
// $Id: manu_ajax.inc.php,v 1.2 2015-05-20 11:45:22 jpermanne Exp $
if (stristr($_SERVER['REQUEST_URI'], ".inc.php")) {
    die("no access");
}
global $charset;
//require_once($include_path."/cart.inc.php");
if ($idcaddie) {
    if ($typecaddie == 'empr') {
        $myCart = new empr_caddie($idcaddie);
    } else {
        $myCart = new caddie($idcaddie);
    }
    switch ($action) {
        case 'add_item':
            if ($id_item) {
                if ($typecaddie == 'empr') {
                    $res_pointage = $myCart->pointe_item($id_item);
                } else {
                    $res_pointage = $myCart->pointe_item($id_item, $myCart->type);
                }
            }
            break;
        case 'del_item':
            $res_pointage = $myCart->depointe_item($id_item);
            break;
        default:
Пример #8
0
     }
     aff_paniers($idcaddie, "NOTI", "./catalog.php?categ=caddie&sub=gestion&quoi=panier", "", $msg["caddie_select_afficher"], "", 1, 0, 1);
     break;
 case 'del_item':
     $myCart = new caddie($idcaddie);
     if ($object_type == "EXPL_CB") {
         $myCart->del_item_blob($item);
     } else {
         $myCart->del_item($item);
     }
     print pmb_bidi(aff_cart_titre($myCart));
     print aff_cart_nb_items($myCart);
     aff_cart_objects($idcaddie, "./catalog.php?categ=caddie&sub=gestion&quoi=panier&idcaddie={$idcaddie}");
     break;
 case 'valid_new_cart':
     $myCart = new caddie(0);
     $myCart->name = $cart_name;
     $myCart->type = $cart_type;
     $myCart->comment = $cart_comment;
     if (is_array($cart_autorisations)) {
         $autorisations = implode(" ", $cart_autorisations);
     } else {
         $autorisations = "";
     }
     $myCart->autorisations = $autorisations;
     $myCart->classementGen = $classementGen_caddie;
     $myCart->acces_rapide = isset($acces_rapide) ? 1 : 0;
     if ($form_actif) {
         $myCart->create_cart();
     }
     aff_paniers($idcaddie, "NOTI", "./catalog.php?categ=caddie&sub=gestion&quoi=panier", "", $msg["caddie_select_afficher"], "", 1, 0, 1);
Пример #9
0
         print aff_cart_nb_items($myCartOrigine);
         // le caddie d'origine est BULL, le caddie destination est NOTI, il fait afficher le choix de notice de bulletin ou notices de dépouillement
         if ($myCart->type == 'NOTI' && $myCartOrigine->type == 'BULL') {
             $aff_choix_dep = true;
         } else {
             $aff_choix_dep = false;
         }
         print aff_choix_quoi("./catalog.php?categ=caddie&sub=action&quelle=transfert&action=transfert_final&idcaddie={$idcaddie}&idcaddie_origine={$idcaddie_origine}", "./catalog.php?categ=caddie&sub=action&quelle=transfert&action=&idcaddie=", $msg["caddie_choix_transfert"], $msg["caddie_bouton_transferer"], "", $aff_choix_dep);
         print pmb_bidi(aff_cart_titre($myCart));
         print aff_cart_nb_items($myCart);
     }
     break;
 case 'transfert_final':
     $idcaddie_origine = verif_droit_caddie($idcaddie_origine);
     if ($idcaddie_origine) {
         $myCartOrigine = new caddie($idcaddie_origine);
         print pmb_bidi(aff_cart_titre($myCart));
         print aff_cart_nb_items($myCart);
         if ($myCart->type == 'NOTI' && $myCartOrigine->type == 'BULL') {
             // cas du transfert depuis caddie de BULL vers caddie de notices
             if ($bull_not) {
                 // transfert des notices de bulletin
                 if ($elt_flag) {
                     $liste = $myCartOrigine->get_cart("FLAG");
                     while (list($cle, $object) = each($liste)) {
                         $myCart->add_item($object, $myCartOrigine->type);
                     }
                 }
                 if ($elt_no_flag) {
                     $liste = $myCartOrigine->get_cart("NOFLAG");
                     while (list($cle, $object) = each($liste)) {
Пример #10
0
function aff_paniers($item = 0, $object_type = "NOTI", $lien_origine = "./cart.php?", $action_click = "add_item", $titre = "Cliquez sur le nom d'un panier pour y déposer la notice", $restriction_panier = "", $lien_edition = 0, $lien_suppr = 0, $lien_creation = 1, $nocheck = false, $lien_pointage = 0)
{
    global $msg;
    global $PMBuserid;
    global $charset;
    global $myCart;
    global $action;
    if ($lien_edition) {
        $lien_edition_panier_cst = "<input type=button class=bouton value='{$msg['caddie_editer']}' onclick=\"document.location='{$lien_origine}&action=edit_cart&idcaddie=!!idcaddie!!';\" />";
    } else {
        $lien_edition_panier_cst = "";
    }
    $liste = caddie::get_cart_list($restriction_panier);
    print "<script type='text/javascript' src='./javascript/tablist.js'></script>";
    if ($item && $nocheck) {
        print "<form name='print_options' action='{$lien_origine}&action={$action_click}&object_type=" . $object_type . "&item={$item}' method='post'>";
        print "<input type='hidden' id='idcaddie' name='idcaddie' >";
        if ($lien_pointage) {
            print "<input type='hidden' id='idcaddie_selected' name='idcaddie_selected' >";
        }
    }
    if ($item && !$nocheck) {
        print "<form name='print_options' action='{$lien_origine}&action={$action_click}&object_type=" . $object_type . "&item={$item}' method='post'>";
        if ($action != "save_cart") {
            print "<input type='checkbox' name='include_child' >&nbsp;" . $msg["cart_include_child"];
        }
    }
    print "<hr />";
    if (sizeof($liste)) {
        print pmb_bidi("<div class='row'><a href='javascript:expandAll()'><img src='./images/expand_all.gif' id='expandall' border='0'></a>\n\t\t<a href='javascript:collapseAll()'><img src='./images/collapse_all.gif' id='collapseall' border='0'></a>{$titre}</div>");
        print confirmation_delete("{$lien_origine}&action=del_cart&object_type=" . $object_type . "&item={$item}&idcaddie=");
        while (list($cle, $valeur) = each($liste)) {
            $rqt_autorisation = explode(" ", $valeur['autorisations']);
            if (array_search($PMBuserid, $rqt_autorisation) !== FALSE || $PMBuserid == 1) {
                $aff_lien = str_replace('!!idcaddie!!', $valeur['idcaddie'], $lien_edition_panier_cst);
                if (!$myCart) {
                    $myCart = new caddie(0);
                }
                $myCart->nb_item = $valeur['nb_item'];
                $myCart->nb_item_pointe = $valeur['nb_item_pointe'];
                $myCart->type = $valeur['type'];
                $print_cart[$myCart->type]["titre"] = "<b>" . $msg["caddie_de_" . $myCart->type] . "</b><br />";
                $parity[$myCart->type] = 1 - $parity[$myCart->type];
                if ($parity[$myCart->type]) {
                    $pair_impair = "even";
                } else {
                    $pair_impair = "odd";
                }
                $tr_javascript = " onmouseover=\"this.className='surbrillance'\" onmouseout=\"this.className='{$pair_impair}'\" ";
                if ($item && $action != "save_cart") {
                    $print_cart[$myCart->type]["cart_list"] .= pmb_bidi("<tr class='{$pair_impair}' {$tr_javascript} ><td>" . (!$nocheck ? "<input type='checkbox' id='id_" . $valeur['idcaddie'] . "' name='caddie[" . $valeur['idcaddie'] . "]' value='" . $valeur['idcaddie'] . "'>" : "") . "&nbsp;");
                    $link = "{$lien_origine}&action={$action_click}&object_type=" . $object_type . "&idcaddie=" . $valeur['idcaddie'] . "&item={$item}";
                    if (!$nocheck) {
                        $print_cart[$myCart->type]["cart_list"] .= pmb_bidi("<a href='#' onclick='javascript:document.getElementById(\"id_" . $valeur['idcaddie'] . "\").checked=true;document.forms[\"print_options\"].submit();' /><strong>" . $valeur['name'] . "</strong>");
                    } else {
                        if ($lien_pointage) {
                            $print_cart[$myCart->type]["cart_list"] .= pmb_bidi("<a href='#' onclick='javascript:document.getElementById(\"idcaddie\").value=" . $item . ";document.getElementById(\"idcaddie_selected\").value=" . $valeur['idcaddie'] . ";document.forms[\"print_options\"].submit();' /><strong>" . $valeur['name'] . "</strong>");
                        } else {
                            $print_cart[$myCart->type]["cart_list"] .= pmb_bidi("<a href='#' onclick='javascript:document.getElementById(\"idcaddie\").value=" . $valeur['idcaddie'] . ";document.forms[\"print_options\"].submit();' /><strong>" . $valeur['name'] . "</strong>");
                        }
                    }
                    if ($valeur['comment']) {
                        $print_cart[$myCart->type]["cart_list"] .= pmb_bidi("<br /><small>(" . $valeur['comment'] . ")</small>");
                    }
                    $print_cart[$myCart->type]["cart_list"] .= pmb_bidi("</td>\n\t            \t\t" . aff_cart_nb_items_reduit($myCart) . "\n\t            \t\t<td>{$aff_lien}</td>\n\t\t\t\t\t\t</tr>");
                } else {
                    $link = "{$lien_origine}&action={$action_click}&object_type=" . $object_type . "&idcaddie=" . $valeur['idcaddie'] . "&item={$item}";
                    $print_cart[$myCart->type]["cart_list"] .= pmb_bidi("<tr class='{$pair_impair}' {$tr_javascript} >\n\t                \t\t\t<td><a href='{$link}' /><strong>" . $valeur['name'] . "</strong>");
                    if ($valeur['comment']) {
                        $print_cart[$myCart->type]["cart_list"] .= pmb_bidi("<br /><small>(" . $valeur['comment'] . ")</small>");
                    }
                    $print_cart[$myCart->type]["cart_list"] .= pmb_bidi("</a></td>\n\t            \t\t<td>" . aff_cart_nb_items_reduit($myCart) . "</td>\n\t            \t\t<td>{$aff_lien}</td>\n\t\t\t\t\t\t</tr>");
                }
            }
        }
        // affichage des paniers par type
        foreach ($print_cart as $key => $cart_type) {
            print gen_plus($key, $cart_type["titre"], "<table border='0' cellspacing='0' width='100%'>" . $cart_type["cart_list"] . "</table>", 1);
        }
    } else {
        print $msg[398];
    }
    if (!$nocheck) {
        if ($item && $action != "save_cart") {
            $boutons_select = "<input type='submit' value='" . $msg["print_cart_add"] . "' class='bouton'/>&nbsp;<input type='button' value='" . $msg["print_cancel"] . "' class='bouton' onClick='self.close();'/>&nbsp;";
        }
        if ($lien_creation) {
            print "<div class='row'><hr />\n\t\t\t\t{$boutons_select}<input class='bouton' type='button' value=' {$msg['new_cart']} ' onClick=\"document.location='{$lien_origine}&action=new_cart&object_type=" . $object_type . "&item={$item}'\" />\n\t\t\t\t</div>";
        } else {
            print "<div class='row'><hr />\n\t\t\t\t{$boutons_select}\n\t\t\t\t</div>";
        }
    } else {
        if ($lien_creation) {
            print "<div class='row'><hr />\n\t\t\t{$boutons_select}<input class='bouton' type='button' value=' {$msg['new_cart']} ' onClick=\"document.location='{$lien_origine}&action=new_cart&object_type=" . $object_type . "&item={$item}'\" />\n\t\t\t</div>";
        }
    }
    //if(($item)&&(!$nocheck)) print"</form>";
    if ($item) {
        print "</form>";
    }
}
Пример #11
0
 $expl = get_expl_info($item);
 // informations de localisation
 $aff .= "<div class=\"row\">";
 $aff .= "<u>" . $msg[298] . "</u>&nbsp;:&nbsp;" . $expl->location_libelle . '<br />';
 $aff .= "<u>" . $msg[295] . "</u>&nbsp;:&nbsp;" . $expl->section_libelle . '<br />';
 $aff .= "<u>" . $msg[296] . "</u>&nbsp;:&nbsp;" . $expl->expl_cote . '<br />';
 $aff .= "<u>" . $msg[297] . "</u>&nbsp;:&nbsp;" . $expl->statut_libelle;
 $aff .= "</div>";
 print '<strong>' . pmb_bidi($aff_reduit) . '</strong><br />';
 switch ($action) {
     case 'add_item':
         if ($idcaddie) {
             $caddie[0] = $idcaddie;
         }
         foreach ($caddie as $idcaddie) {
             $myCart = new caddie($idcaddie);
             if ($include_child) {
                 $tab_list_child = notice::get_list_child($item);
                 if (count($tab_list_child)) {
                     foreach ($tab_list_child as $notice_id) {
                         $myCart->add_item($notice_id, "EXPL");
                     }
                 }
             } else {
                 $myCart->add_item($item, "EXPL");
             }
             $myCart->compte_items();
         }
         print "<script type='text/javascript'>window.close();</script>";
         break;
     case 'new_cart':
Пример #12
0
<?php

// +-------------------------------------------------+
// © 2002-2004 PMB Services / www.sigb.net pmb@sigb.net et contributeurs (voir www.sigb.net)
// +-------------------------------------------------+
// $Id: douchette_ajax.inc.php,v 1.1 2008-01-25 15:00:56 ngantier Exp $
if (stristr($_SERVER['REQUEST_URI'], ".inc.php")) {
    die("no access");
}
if ($idcaddie) {
    $myCart = new caddie($idcaddie);
    switch ($action) {
        case 'add_item':
            $param->form_cb_expl = $form_cb_expl;
            if ($form_cb_expl) {
                $expl_ajout_ok = 1;
                $query = "select expl_id from exemplaires where expl_cb='{$form_cb_expl}'";
                $result = mysql_query($query, $dbh);
                if (!mysql_num_rows($result)) {
                    // exemplaire inconnu
                    $param->message_ajout_expl = $msg[367];
                    $expl_ajout_ok = 0;
                } else {
                    $expl_trouve = mysql_fetch_object($result);
                    $item = $expl_trouve->expl_id;
                    $param->expl_id = $expl_trouve->expl_id;
                    if ($stuff = get_expl_info($item)) {
                        $param->expl_notice = $stuff->expl_notice;
                        $param->titre = $stuff->titre;
                        $stuff = check_pret($stuff);
                    } else {
Пример #13
0
// +-------------------------------------------------+
// $Id: bulletin.inc.php,v 1.12 2008-12-15 14:26:50 ngantier Exp $
if (stristr($_SERVER['REQUEST_URI'], ".inc.php")) {
    die("no access");
}
if ($item) {
    $bull = new bulletinage_display($item);
    $aff_bull = $bull->header;
    print pmb_bidi($aff_bull);
    switch ($action) {
        case 'add_item':
            if ($idcaddie) {
                $caddie[0] = $idcaddie;
            }
            foreach ($caddie as $idcaddie) {
                $myCart = new caddie($idcaddie);
                if ($include_child) {
                    $tab_list_child = notice::get_list_child($item);
                    if (count($tab_list_child)) {
                        foreach ($tab_list_child as $notice_id) {
                            $myCart->add_item($notice_id, "BULL", $what);
                        }
                    }
                } else {
                    $myCart->add_item($item, "BULL", $what);
                }
                $myCart->compte_items();
            }
            print "<script type='text/javascript'>window.close();</script>";
            break;
        case 'new_cart':
Пример #14
0
             }
             break;
         case "expl":
             $sh = new search(true, "search_fields_expl");
             $table = $sh->make_search();
             if ($environement["pager"]) {
                 $limit = "limit " . $nb_per_page_search * $page . ",{$nb_per_page_search}";
             }
             $requete = "select expl_id as notice_id from {$table} " . $limit;
             $object_type = "EXPL";
             break;
     }
 }
 if ($environement["caddie"]) {
     foreach ($environement["caddie"] as $environement_caddie) {
         $c = new caddie($environement_caddie);
         $nb_items_before = $c->nb_item;
         $resultat = @mysql_query($requete);
         print mysql_error();
         while ($r = mysql_fetch_object($resultat)) {
             if ($environement["include_child"]) {
                 $tab_list_child = notice::get_list_child($r->notice_id);
                 if (count($tab_list_child)) {
                     foreach ($tab_list_child as $notice_id) {
                         $c->add_item($notice_id, $object_type);
                     }
                 }
             } else {
                 $c->add_item($r->notice_id, $object_type);
             }
         }
Пример #15
0
                 echo "<div class='row'><a href=\"./catalog.php?categ=edit_explnum&id=" . $o->notice_id . "&explnum_id=" . $o->explnum_id . "\">" . $o->tit1 . "</a>&nbsp;<a href=\"" . $o->explnum_url . "\">" . $o->explnum_url . "</a> <span class='erreur'>" . $response->headers['Status-Code'] . " -> " . $tmp . "</span></div>";
                 if ($ajtenum) {
                     $cad->add_item($o->notice_id, 'NOTI');
                 }
             }
             $pb->progress();
             flush();
         }
     }
     echo "</div>";
     flush();
 }
 if ($chkbull) {
     $resl = "";
     if ($ajtbull) {
         $cad = new caddie($idcaddiebul);
         $liencad = "&nbsp;<a href=\"./catalog.php?categ=caddie&sub=gestion&quoi=panier&action=&object_type=NOTI&idcaddie={$idcaddiebul}\">" . $cad->name . "</a>";
     } else {
         $liencad = "";
     }
     echo "<div class='row'><hr /></div><div class='row'><label class='etiquette' >" . $msg['chklnk_verifbull'] . "</label>" . $liencad . "</div>\n\t\t\t<div class='row'>";
     $q = implode($req_explnum_bull, " union ");
     $r = pmb_mysql_query($q) or die(pmb_mysql_error() . "<br />" . $q);
     if ($r) {
         $rc = pmb_mysql_num_rows($r);
     } else {
         $rc = 0;
     }
     $pb->count = $rc;
     $pb->nb_progress_call = 0;
     $pb->set_text($msg['chklnk_verifurl_bull']);
Пример #16
0
require_once "{$include_path}/expl_info.inc.php";
require_once "{$class_path}/caddie.class.php";
require_once "{$class_path}/serials.class.php";
require_once "{$class_path}/parameters.class.php";
require_once "{$class_path}/emprunteur.class.php";
require_once "{$include_path}/cart.inc.php";
require_once "{$include_path}/empr_cart.inc.php";
require_once "{$include_path}/bull_info.inc.php";
// !! A inserrer dans switch avec une commande sub !!
if ($sub != "pointage" && $sub != "collecte") {
    $idcaddie = substr($caddie, 5);
    $object_type = substr($object, 0, 4);
    $object_id = substr($object, 10);
    $idcaddie = verif_droit_caddie($idcaddie);
    if ($idcaddie) {
        $myCart = new caddie($idcaddie);
        $myCart->add_item($object_id, $object_type);
        $myCart->compte_items();
    } else {
        die("Failed: " . "obj=" . $object . " caddie=" . $caddie);
    }
    print $myCart->nb_item;
    die;
}
if ($typecaddie == 'empr') {
    $idcaddie = verif_droit_empr_caddie($idcaddie);
} else {
    $idcaddie = verif_droit_caddie($idcaddie);
}
switch ($sub) {
    case "pointage":
Пример #17
0
    die("no access");
}
if ($item) {
    print "<h1>" . $msg["400"] . "</h1>";
    $notice = new mono_display($item, 1);
    print pmb_bidi('<strong>' . $notice->header . '</strong><br />');
}
switch ($action) {
    case 'add_item':
        // cas du click sur le lien du panier
        if ($idcaddie) {
            $caddie[0] = $idcaddie;
        }
        // Pour tous les paniers cochés
        foreach ($caddie as $idcaddie) {
            $myCart = new caddie($idcaddie);
            if ($include_child) {
                $tab_list_child = notice::get_list_child($item);
                if (count($tab_list_child)) {
                    foreach ($tab_list_child as $notice_id) {
                        $myCart->add_item($notice_id, "NOTI");
                    }
                }
            } else {
                $myCart->add_item($item, "NOTI");
            }
            $myCart->compte_items();
        }
        print "<script type='text/javascript'>window.close();</script>";
        break;
    case 'new_cart':
Пример #18
0
<?php

// +-------------------------------------------------+
// © 2002-2004 PMB Services / www.sigb.net pmb@sigb.net et contributeurs (voir www.sigb.net)
// +-------------------------------------------------+
// $Id: douchette_ajax.inc.php,v 1.2 2015-04-03 11:16:22 jpermanne Exp $
if (stristr($_SERVER['REQUEST_URI'], ".inc.php")) {
    die("no access");
}
if ($idcaddie) {
    $myCart = new caddie($idcaddie);
    switch ($action) {
        case 'add_item':
            $param->form_cb_expl = $form_cb_expl;
            if ($form_cb_expl) {
                $expl_ajout_ok = 1;
                $query = "select expl_id from exemplaires where expl_cb='{$form_cb_expl}'";
                $result = pmb_mysql_query($query, $dbh);
                if (!pmb_mysql_num_rows($result)) {
                    // exemplaire inconnu
                    $param->message_ajout_expl = $msg[367];
                    $expl_ajout_ok = 0;
                } else {
                    $expl_trouve = pmb_mysql_fetch_object($result);
                    $item = $expl_trouve->expl_id;
                    $param->expl_id = $expl_trouve->expl_id;
                    if ($stuff = get_expl_info($item)) {
                        $param->expl_notice = $stuff->expl_notice;
                        $param->titre = $stuff->titre;
                        $stuff = check_pret($stuff);
                    } else {
Пример #19
0
 function form_pour_maj_entrepot($source_id, $sync_form = "sync_form")
 {
     global $quoi_synchro;
     $form = "";
     $form .= "<script>";
     $form .= "\n\t\tfunction unckeckall() {\n\t\t\tfor (i=0, count=document." . $sync_form . ".elements.length; i<count; i++) {\n\t\t\t\tif (document." . $sync_form . ".elements[i].value.substr(0, 21) == 'synchro_noticecaddie_') {\n\t\t\t\t\tdocument." . $sync_form . ".elements[i].checked = false;\n\t\t\t\t}\n\t\t\t\tif (document." . $sync_form . ".elements[i].value.substr(0, 19) == 'synchro_explcaddie_') {\n\t\t\t\t\tdocument." . $sync_form . ".elements[i].checked = false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tfunction clear_the_radio_button() {\n\t\t\tdocument.getElementById('quoi_synchro_synchro_base').checked = false;\n\t\t}";
     $form .= "</script>";
     $form .= $this->msg["aliga_syncbase"];
     $form .= '<blockquote>';
     $form .= '<input type="radio" onclick="unckeckall();" name="quoi_synchro[]" value="synchro_base" id="quoi_synchro_synchro_base" ' . (!$quoi_synchro || $quoi_synchro['synchro_base'] ? 'checked' : '') . '><label for="quoi_synchro_synchro_base">' . $this->msg["aliga_syncbase"] . '</label>';
     $form .= '</blockquote>';
     $form .= $this->msg["aliga_sync_noticecaddie"];
     $form .= '<blockquote>';
     $caddies = caddie::get_cart_list("NOTI");
     foreach ($caddies as $caddie) {
         $form .= '<input type="checkbox" onclick="clear_the_radio_button()" name="quoi_synchro[]" value="synchro_noticecaddie_' . $caddie["idcaddie"] . '" id="quoi_synchro_synchro_noticecaddie_' . $caddie["idcaddie"] . '" ' . ($quoi_synchro['synchro_noticecaddie_' . $caddie["idcaddie"] . ''] ? 'checked' : '') . '><label for="quoi_synchro_synchro_noticecaddie_' . $caddie["idcaddie"] . '">' . $caddie["name"] . '</label><i> (' . $caddie["nb_item_base"] . ' ' . $this->msg["aliga_caddie_element"] . ')</i><br />';
     }
     $form .= '</blockquote>';
     $form .= $this->msg["aliga_sync_explcaddie"];
     $form .= '<blockquote>';
     $caddies = caddie::get_cart_list("EXPL");
     foreach ($caddies as $caddie) {
         $form .= '<input type="checkbox" onclick="clear_the_radio_button()" name="quoi_synchro[]" value="synchro_explcaddie_' . $caddie["idcaddie"] . '" id="quoi_synchro_synchro_explcaddie_' . $caddie["idcaddie"] . '" ' . ($quoi_synchro['synchro_explcaddie_' . $caddie["idcaddie"] . ''] ? 'checked' : '') . '><label for="quoi_synchro_synchro_explcaddie_' . $caddie["idcaddie"] . '">' . $caddie["name"] . ' <i>(' . $caddie["nb_item_base"] . ' ' . $this->msg["aliga_caddie_element"] . ')</i></label><br />';
     }
     $form .= '</blockquote>';
     $form .= "<br /><br />";
     return $form;
 }