Exemplo n.º 1
0
 function classementGen($object_type, $object_id = 0)
 {
     if (!isset($_SESSION["classementGen_types"][$object_type])) {
         classementGen::parseXml();
     }
     $this->object_type = $object_type;
     if ($object_id) {
         $this->object_id = $object_id;
         $this->getLibelle();
     }
 }
Exemplo n.º 2
0
function aff_etagere($action, $bouton_ajout = 1)
{
    global $msg;
    global $PMBuserid;
    global $charset, $opac_url_base;
    $liste = etagere::get_etagere_list();
    if (sizeof($liste)) {
        if ($action == "edit_etagere") {
            print "<script src='./javascript/classementGen.js' type='text/javascript'></script>";
            print "<div class='hmenu'>\n\t\t\t\t\t<span><a href='catalog.php?categ=etagere&sub=classementGen'>" . $msg["classementGen_list_libelle"] . "</a></span>\n\t\t\t\t</div><hr>";
            if ($bouton_ajout) {
                print "<div class='row'>\n\t\t\t\t<input class='bouton' type='button' value=' " . $msg["etagere_new_etagere"] . " ' onClick=\"document.location='./catalog.php?categ=etagere&sub=gestion&action=new_etagere'\" />\n\t\t\t\t</div><br>";
            }
        }
        print pmb_bidi("<div class='row'><a href='javascript:expandAll()'><img src='./images/expand_all.gif' id='expandall' border='0'></a>\n\t\t\t<a href='javascript:collapseAll()'><img src='./images/collapse_all.gif' id='collapseall' border='0'></a></div>");
        $parity = 1;
        $arrayRows = array();
        while (list($cle, $valeur) = each($liste)) {
            $rqt_autorisation = explode(" ", $valeur['autorisations']);
            if (array_search($PMBuserid, $rqt_autorisation) !== FALSE || $PMBuserid == 1) {
                $classementRow = $valeur['etagere_classement'];
                if (!trim($classementRow)) {
                    $classementRow = classementGen::getDefaultLibelle();
                }
                $baselink = "./catalog.php?categ=etagere";
                $link = $baselink . "&sub={$action}&action=edit_etagere&idetagere=" . $valeur['idetagere'];
                if ($parity % 2) {
                    $pair_impair = "even";
                } else {
                    $pair_impair = "odd";
                }
                $parity += 1;
                $tr_javascript = " onmouseover=\"this.className='surbrillance'\" onmouseout=\"this.className='{$pair_impair}'\" ";
                $td_javascript_click = " onmousedown=\"document.location='{$link}';\" ";
                $rowPrint = pmb_bidi("<tr class='{$pair_impair}' {$tr_javascript} >");
                $rowPrint .= pmb_bidi("<td {$td_javascript_click} style='cursor: pointer'><strong>" . $valeur['name'] . "</strong>" . ($valeur['comment'] ? " (" . $valeur['comment'] . ")" : "") . "</td>");
                $rowPrint .= pmb_bidi("<td {$td_javascript_click} style='cursor: pointer'>" . $valeur['nb_paniers'] . "</td>");
                $rowPrint .= pmb_bidi("<td {$td_javascript_click} style='cursor: pointer'>" . ($valeur['validite'] ? $msg['etagere_visible_date_all'] : $msg['etagere_visible_date_du'] . " " . $valeur['validite_date_deb_f'] . " " . $msg['etagere_visible_date_fin'] . " " . $valeur['validite_date_fin_f']) . "</td>");
                $rowPrint .= pmb_bidi("<td>" . ($valeur['visible_accueil'] ? "X" : "") . "<br /><a href='" . $opac_url_base . "index.php?lvl=etagere_see&id=" . $valeur['idetagere'] . "' target=_blank>" . $opac_url_base . "index.php?lvl=etagere_see&id=" . $valeur['idetagere'] . "</a></td>");
                if ($action == "edit_etagere") {
                    $classementGen = new classementGen('etagere', $valeur['idetagere']);
                    $rowPrint .= pmb_bidi("<td>" . $classementGen->show_selector($baselink, $PMBuserid) . "</td>");
                }
                $rowPrint .= pmb_bidi("</tr>");
                $arrayRows[$classementRow]["title"] = stripslashes($classementRow);
                $arrayRows[$classementRow]["etagere_list"] .= $rowPrint;
            }
        }
        //on trie
        ksort($arrayRows);
        //on remplace les clés à cause des accents
        $arrayRows = array_values($arrayRows);
        foreach ($arrayRows as $key => $type) {
            if ($action == "edit_etagere") {
                print gen_plus($key, $type["title"], "<table class='classementGen_tableau'><tr><th class='classement40'>" . $msg['etagere_name'] . "</th><th class='classement10'>" . $msg["etagere_cart_count"] . "</th><th class='classement10'>" . $msg['etagere_visible_date'] . "</th><th class='classement35'>" . $msg['etagere_visible_accueil'] . "</th><th class='classement5'>&nbsp;</th></tr>" . $type["etagere_list"] . "</table>", 1);
            } else {
                print gen_plus($key, $type["title"], "<table class='classementGen_tableau'><tr><th class='classement40'>" . $msg['etagere_name'] . "</th><th class='classement10'>" . $msg["etagere_cart_count"] . "</th><th class='classement10'>" . $msg['etagere_visible_date'] . "</th><th class='classement40'>" . $msg['etagere_visible_accueil'] . "</th></tr>" . $type["etagere_list"] . "</table>", 1);
            }
        }
    } else {
        print $msg['etagere_no_etagere'];
    }
    if ($bouton_ajout) {
        print "<div class='row'>\n\t<input class='bouton' type='button' value=' " . $msg["etagere_new_etagere"] . " ' onClick=\"document.location='./catalog.php?categ=etagere&sub=gestion&action=new_etagere'\" />\n\t</div>";
    }
}
Exemplo n.º 3
0
                         break;
                     case "connectors":
                         $message_delete_warning .= "\\n- " . $msg["admin_connecteurs_sets"];
                         break;
                     default:
                         //On ne doit pas passer par là
                         $info_liaisons = "";
                         break 2;
                         //On sort aussi du foreach
                 }
             }
         }
         $message_delete_warning .= "\\n";
     }
     print confirmation_delete("./catalog.php?categ=caddie&action=del_cart&idcaddie=", $message_delete_warning);
     $classementGen = new classementGen('caddie', $idcaddie);
     $cart_edit_form = str_replace("!!object_type!!", $classementGen->object_type, $cart_edit_form);
     $cart_edit_form = str_replace("!!classements_liste!!", $classementGen->getClassementsSelectorContent($PMBuserid, $classementGen->libelle), $cart_edit_form);
     //acces rapide
     if ($myCart->type == "NOTI") {
         $cart_edit_form = str_replace("!!acces_rapide!!", "<label class='etiquette' for='form_type'>" . $msg["caddie_fast_access"] . "</label>&nbsp;<input type='checkbox' name='acces_rapide' " . ($myCart->acces_rapide ? "checked='checked'" : "") . ">", $cart_edit_form);
     } else {
         $cart_edit_form = str_replace("!!acces_rapide!!", "", $cart_edit_form);
     }
     print $cart_edit_form;
     break;
 case 'del_cart':
     $myCart = new caddie($idcaddie);
     $myCart->delete();
     aff_paniers($idcaddie, "NOTI", "./catalog.php?categ=caddie&sub=gestion&quoi=panier", "", $msg["caddie_select_afficher"], "", 1, 0, 1, 1);
     break;
Exemplo n.º 4
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;
    global $baselink;
    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 ($lien_creation) {
        print "<div class='row'>\n\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</div><br>";
    }
    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 />";
                if (!trim($valeur["caddie_classement"])) {
                    $valeur["caddie_classement"] = classementGen::getDefaultLibelle();
                }
                $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") {
                    $rowPrint = pmb_bidi("<tr class='{$pair_impair}' {$tr_javascript} ><td class='classement60'>" . (!$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) {
                        $rowPrint .= 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) {
                            $rowPrint .= 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 {
                            $rowPrint .= pmb_bidi("<a href='#' onclick='javascript:document.getElementById(\"idcaddie\").value=" . $valeur['idcaddie'] . ";document.forms[\"print_options\"].submit();' /><strong>" . $valeur['name'] . "</strong>");
                        }
                    }
                    if ($valeur['comment']) {
                        $rowPrint .= pmb_bidi("<br /><small>(" . $valeur['comment'] . ")</small>");
                    }
                    $rowPrint .= pmb_bidi("</td>\n\t            \t\t" . aff_cart_nb_items_reduit($myCart) . "\n\t            \t\t<td class='classement20'>{$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}";
                    $rowPrint = pmb_bidi("<tr class='{$pair_impair}' {$tr_javascript} >");
                    $rowPrint .= pmb_bidi("<td class='classement60'><a href='{$link}' /><strong>" . $valeur['name'] . "</strong>");
                    if ($valeur['comment']) {
                        $rowPrint .= pmb_bidi("<br /><small>(" . $valeur['comment'] . ")</small>");
                    }
                    $rowPrint .= pmb_bidi("</a></td>");
                    $rowPrint .= pmb_bidi(aff_cart_nb_items_reduit($myCart));
                    if ($lien_creation) {
                        $classementGen = new classementGen('caddie', $valeur['idcaddie']);
                        $rowPrint .= pmb_bidi("<td class='classement15'>" . $aff_lien . "&nbsp;" . caddie::show_actions($valeur['idcaddie'], $valeur['type']) . "</td>");
                        $rowPrint .= pmb_bidi("<td class='classement5'>" . $classementGen->show_selector($baselink, $PMBuserid) . "</td>");
                    } else {
                        $rowPrint .= pmb_bidi("<td class='classement20'>{$aff_lien}</td>");
                    }
                    $rowPrint .= pmb_bidi("</tr>");
                }
                $print_cart[$myCart->type]["classement_list"][$valeur["caddie_classement"]]["titre"] = stripslashes($valeur["caddie_classement"]);
                $print_cart[$myCart->type]["classement_list"][$valeur["caddie_classement"]]["cart_list"] .= $rowPrint;
            }
        }
        if ($lien_creation) {
            print "<script src='./javascript/classementGen.js' type='text/javascript'></script>";
        }
        //Tri des classements
        foreach ($print_cart as $key => $cart_type) {
            ksort($print_cart[$key]["classement_list"]);
        }
        // affichage des paniers par type
        foreach ($print_cart as $key => $cart_type) {
            //on remplace les clés à cause des accents
            $cart_type["classement_list"] = array_values($cart_type["classement_list"]);
            $contenu = "";
            foreach ($cart_type["classement_list"] as $keyBis => $cart_typeBis) {
                $contenu .= gen_plus($key . $keyBis, $cart_typeBis["titre"], "<table border='0' cellspacing='0' width='100%' class='classementGen_tableau'>" . $cart_typeBis["cart_list"] . "</table>", 1);
            }
            print gen_plus($key, $cart_type["titre"], $contenu, 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>";
    }
}
Exemplo n.º 5
0
function infopage_form($id = 0, $title_infopage = "", $content_infopage = "", $valid_infopage = 1, $restrict_infopage = 0)
{
    global $msg, $pmb_javascript_office_editor;
    global $admin_infopages_form;
    global $charset, $PMBuserid;
    if ($pmb_javascript_office_editor) {
        print $pmb_javascript_office_editor;
    }
    $admin_infopages_form = str_replace('!!id!!', $id, $admin_infopages_form);
    if (!$id) {
        $admin_infopages_form = str_replace('!!form_title!!', $msg['infopages_creer'], $admin_infopages_form);
    } else {
        $admin_infopages_form = str_replace('!!form_title!!', $msg['infopages_modifier'], $admin_infopages_form);
    }
    $admin_infopages_form = str_replace('!!title_infopage!!', htmlentities($title_infopage, ENT_QUOTES, $charset), $admin_infopages_form);
    $admin_infopages_form = str_replace('!!libelle_suppr!!', htmlentities(addslashes($title_infopage), ENT_QUOTES, $charset), $admin_infopages_form);
    $admin_infopages_form = str_replace('!!content_infopage!!', htmlentities($content_infopage, ENT_QUOTES, $charset), $admin_infopages_form);
    if ($valid_infopage) {
        $checkbox = "checked";
    } else {
        $checkbox = "";
    }
    $admin_infopages_form = str_replace('!!checkbox!!', $checkbox, $admin_infopages_form);
    if ($restrict_infopage) {
        $restrict_checkbox = "checked";
    } else {
        $restrict_checkbox = "";
    }
    $admin_infopages_form = str_replace('!!restrict_checkbox!!', $restrict_checkbox, $admin_infopages_form);
    $classementGen = new classementGen('infopages', $id);
    $admin_infopages_form = str_replace("!!object_type!!", $classementGen->object_type, $admin_infopages_form);
    $admin_infopages_form = str_replace("!!classements_liste!!", $classementGen->getClassementsSelectorContent($PMBuserid, $classementGen->libelle), $admin_infopages_form);
    if ($id) {
        $admin_infopages_form = str_replace("!!duplicate!!", "<input class='bouton' type='button' value=' " . $msg["infopages_duplicate_bouton"] . " ' onClick=\"document.location='./admin.php?categ=infopages&sub=infopages&action=duplicate&id=" . $id . "'\" />", $admin_infopages_form);
    } else {
        $admin_infopages_form = str_replace("!!duplicate!!", "", $admin_infopages_form);
    }
    print confirmation_delete("./admin.php?categ=infopages&sub=infopages&action=del&id=");
    print "<script type=\"text/javascript\">\n\t\tfunction test_form(form) {\n\t\tif(form.form_title_infopage.value.length == 0) {\n\t\t\talert(\"" . $msg[98] . "\");\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t\t}\n\t\t</script>";
    print $admin_infopages_form;
}
Exemplo n.º 6
0
<?php

// +-------------------------------------------------+
// © 2002-2004 PMB Services / www.sigb.net pmb@sigb.net et contributeurs (voir www.sigb.net)
// +-------------------------------------------------+
// $Id: classementGen.inc.php,v 1.1 2015-03-30 07:14:52 jpermanne Exp $
if (stristr($_SERVER['REQUEST_URI'], ".inc.php")) {
    die("no access");
}
require_once $class_path . "/classementGen.class.php";
$classementGen = new classementGen($object_type, $object_id);
switch ($action) {
    case "update":
        print $classementGen->saveLibelle($classement_libelle);
        break;
}
Exemplo n.º 7
0
<?php

// +-------------------------------------------------+
// © 2002-2004 PMB Services / www.sigb.net pmb@sigb.net et contributeurs (voir www.sigb.net)
// +-------------------------------------------------+
// $Id: classementGen.inc.php,v 1.1 2015-03-30 07:14:52 jpermanne Exp $
if (stristr($_SERVER['REQUEST_URI'], ".inc.php")) {
    die("no access");
}
$classementGen = new classementGen($categ, 0);
switch ($action) {
    case "edit":
        print $classementGen->show_form_edit_classement($classement, $baseLink);
        break;
    case "update":
        $classementGen->update_classement($oldClassement, $newClassement, $PMBuserid);
        print $classementGen->show_list_classements($PMBuserid, $baseLink);
        break;
    case "delete":
        $classementGen->delete_classement($oldClassement, $PMBuserid);
        print $classementGen->show_list_classements($PMBuserid, $baseLink);
        break;
    default:
        print $classementGen->show_list_classements($PMBuserid, $baseLink);
        break;
}
Exemplo n.º 8
0
function aff_paniers_empr($item = 0, $lien_origine = "./circ.php?", $action_click = "add_item", $titre = "", $restriction_panier = "", $lien_edition = 0, $lien_suppr = 0, $lien_creation = 1, $post_param_serialized = "")
{
    global $msg;
    global $PMBuserid;
    global $charset;
    global $myCart;
    global $sub, $quoi;
    global $action;
    global $baselink;
    if ($lien_edition) {
        $lien_edition_panier_cst = "<input type=button class=bouton value='{$msg['caddie_editer']}' onclick=\"document.location='{$lien_origine}&action=edit_cart&idemprcaddie=!!idemprcaddie!!';\" />";
    } else {
        $lien_edition_panier_cst = "";
    }
    if ($sub != 'gestion' && $sub != 'action') {
        print "<form name='print_options' action='{$lien_origine}&action={$action_click}&item={$item}' method='post'>";
    }
    $liste = empr_caddie::get_cart_list($restriction_panier);
    print "<script type='text/javascript' src='./javascript/tablist.js'></script>";
    print "<hr />";
    if ($lien_creation) {
        print "<div class='row'>";
        if ($sub != 'gestion') {
            print $boutons_select . "<input class='bouton' type='button' value=' {$msg['new_cart']} ' onClick=\"this.form.action='{$lien_origine}&action=new_cart&item={$item}'; this.form.submit();\" />";
        } else {
            print $boutons_select . "<input class='bouton' type='button' value=' {$msg['new_cart']} ' onClick=\"document.location='{$lien_origine}&action=new_cart&item={$item}'\" />";
        }
        print "</div><br>";
    }
    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\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&item={$item}&idemprcaddie=");
        print "<script type='text/javascript'>\n\t\t\tfunction add_to_cart(form) {\n        \t\tvar inputs = form.getElementsByTagName('input');\n        \t\tvar count=0;\n        \t\tfor(i=0;i<inputs.length;i++){\n\t\t\t\t\tif(inputs[i].type=='checkbox' && inputs[i].checked==true)\n        \t\t\t\tcount ++;\n\t\t\t\t}\n\t\t\t\tif(count == 0){\n\t\t\t\t\talert(\"{$msg['no_emprcart_selected']}\");\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\treturn true;\n   \t\t\t}\n   \t\t</script>";
        if ($sub == "gestion" && $quoi == "panier") {
            print "<script src='./javascript/classementGen.js' type='text/javascript'></script>";
        }
        $parity = 0;
        while (list($cle, $valeur) = each($liste)) {
            $rqt_autorisation = explode(" ", $valeur['autorisations']);
            if (array_search($PMBuserid, $rqt_autorisation) !== FALSE || $PMBuserid == 1) {
                $classementRow = $valeur['empr_caddie_classement'];
                if (!trim($classementRow)) {
                    $classementRow = classementGen::getDefaultLibelle();
                }
                $link = "{$lien_origine}&action={$action_click}&idemprcaddie=" . $valeur['idemprcaddie'] . "&item={$item}";
                if ($parity = 1 - $parity) {
                    $pair_impair = "even";
                } else {
                    $pair_impair = "odd";
                }
                $lien_edition_panier = str_replace('!!idemprcaddie!!', $valeur['idemprcaddie'], $lien_edition_panier_cst);
                $aff_lien = $lien_edition_panier;
                $myCart = new empr_caddie(0);
                $myCart->nb_item = $valeur['nb_item'];
                $myCart->nb_item_pointe = $valeur['nb_item_pointe'];
                $myCart->type = 'EMPR';
                $print_cart[$classementRow]["titre"] = stripslashes($classementRow);
                $tr_javascript = " onmouseover=\"this.className='surbrillance'\" onmouseout=\"this.className='{$pair_impair}'\" ";
                if ($item) {
                    $print_cart[$classementRow]["cart_list"] .= pmb_bidi("<tr class='{$pair_impair}' {$tr_javascript} ><td class='classement60'>");
                    if ($action != "transfert" && $action != "del_cart" && $action != "save_cart") {
                        $print_cart[$classementRow]["cart_list"] .= pmb_bidi("<input type='checkbox' id='id_" . $valeur['idemprcaddie'] . "' name='caddie[" . $valeur['idemprcaddie'] . "]' value='" . $valeur['idemprcaddie'] . "'>&nbsp;");
                        $print_cart[$classementRow]["cart_list"] .= pmb_bidi("<a href='#' onClick='javascript:document.getElementById(\"id_" . $valeur['idemprcaddie'] . "\").checked=true; document.forms[\"print_options\"].submit();' /><strong>" . $valeur['name'] . "</strong>");
                    } else {
                        $print_cart[$classementRow]["cart_list"] .= pmb_bidi("<a href='{$link}' /><strong>" . $valeur['name'] . "</strong>");
                    }
                    if ($valeur['comment']) {
                        $print_cart[$classementRow]["cart_list"] .= pmb_bidi("<br /><small>(" . $valeur['comment'] . ")</small>");
                    }
                    $print_cart[$classementRow]["cart_list"] .= pmb_bidi("</td>\n\t            \t\t" . aff_cart_nb_items_reduit($myCart) . "\n\t            \t\t<td class='classement20'>{$aff_lien}</td>\n\t\t\t\t\t\t</tr>");
                } else {
                    $print_cart[$classementRow]["cart_list"] .= pmb_bidi("<tr class='{$pair_impair}' {$tr_javascript} >");
                    $print_cart[$classementRow]["cart_list"] .= pmb_bidi("<td class='classement60'>");
                    if ($sub != 'gestion' && $sub != 'action' && $action != "save_cart") {
                        $print_cart[$classementRow]["cart_list"] .= pmb_bidi("<input type='checkbox' id='id_" . $valeur['idemprcaddie'] . "' name='caddie[" . $valeur['idemprcaddie'] . "]' value='" . $valeur['idemprcaddie'] . "'>&nbsp;");
                        $print_cart[$classementRow]["cart_list"] .= pmb_bidi("<a href='#' onClick='javascript:document.getElementById(\"id_" . $valeur['idemprcaddie'] . "\").checked=true; document.forms[\"print_options\"].submit();' /><strong>" . $valeur['name'] . "</strong>");
                    } else {
                        $print_cart[$classementRow]["cart_list"] .= pmb_bidi("<a href='{$link}' /><strong>" . $valeur['name'] . "</strong>");
                    }
                    if ($valeur['comment']) {
                        $print_cart[$classementRow]["cart_list"] .= pmb_bidi("<br /><small>(" . $valeur['comment'] . ")</small>");
                    }
                    $print_cart[$classementRow]["cart_list"] .= pmb_bidi("</a></td>");
                    $print_cart[$classementRow]["cart_list"] .= pmb_bidi(aff_cart_nb_items_reduit($myCart));
                    if ($sub == "gestion" && $quoi == "panier") {
                        $print_cart[$classementRow]["cart_list"] .= pmb_bidi("<td class='classement15'>" . $aff_lien . "&nbsp;" . empr_caddie::show_actions($valeur['idemprcaddie']) . "</td>");
                        $classementGen = new classementGen('empr_caddie', $valeur['idemprcaddie']);
                        $print_cart[$classementRow]["cart_list"] .= pmb_bidi("<td class='classement5'>" . $classementGen->show_selector($baselink, $PMBuserid) . "</td>");
                    } else {
                        $print_cart[$classementRow]["cart_list"] .= pmb_bidi("<td class='classement20'>{$aff_lien}</td>");
                    }
                    $print_cart[$classementRow]["cart_list"] .= pmb_bidi("</tr>");
                }
            }
        }
        //on trie
        ksort($print_cart);
        //on remplace les clés à cause des accents
        $print_cart = array_values($print_cart);
        foreach ($print_cart as $key => $type) {
            print gen_plus($key, $type["titre"], "<table class='classementGen_tableau'>" . $type["cart_list"] . "</table>", 1);
        }
    } else {
        print $msg[398];
    }
    if ($sub != 'gestion' && $sub != 'action' && $action != "del_cart") {
        $boutons_select = "<input type='submit' value='" . $msg["print_cart_add"] . "' class='bouton' onclick=\"return add_to_cart(this.form);\"/>&nbsp;<input type='button' value='" . $msg["print_cancel"] . "' class='bouton' onClick='self.close();'/>&nbsp;";
    }
    if ($lien_creation) {
        print "<div class='row'><hr />";
        if ($sub != 'gestion') {
            print $boutons_select . "<input class='bouton' type='button' value=' {$msg['new_cart']} ' onClick=\"this.form.action='{$lien_origine}&action=new_cart&item={$item}'; this.form.submit();\" />";
        } else {
            print $boutons_select . "<input class='bouton' type='button' value=' {$msg['new_cart']} ' onClick=\"document.location='{$lien_origine}&action=new_cart&item={$item}'\" />";
        }
        print "</div>";
    } else {
        print "<div class='row'><hr />\n\t\t\t{$boutons_select}\n\t\t\t</div>";
    }
    if ($post_param_serialized != "") {
        print unserialize($post_param_serialized);
    }
    if ($sub != 'gestion') {
        print "</form>";
    }
}
Exemplo n.º 9
0
 print "<h3>" . $msg["print_cart_title"] . "</h3>\n";
 print "<form name='print_options' action='print_cart.php?action=print' method='post'>";
 //Affichage de la sélection des paniers
 $requete = "select caddie.*,count(object_id) as nb_objects, count(flag=1) as nb_flags from caddie left join caddie_content on caddie_id=idcaddie group by idcaddie order by type, name, comment";
 $resultat = pmb_mysql_query($requete);
 $ctype = "";
 while ($ca = pmb_mysql_fetch_object($resultat)) {
     $ca_auth = explode(" ", $ca->autorisations);
     $as = in_array(SESSuserid, $ca_auth);
     if ($as !== false && $as !== null) {
         if ($ca->type != $ctype) {
             $ctype = $ca->type;
             $print_cart[$ctype]["titre"] = "<b>" . $msg["caddie_de_" . $ca->type] . "</b><br />";
         }
         if (!trim($ca->caddie_classement)) {
             $ca->caddie_classement = classementGen::getDefaultLibelle();
         }
         $print_cart[$ctype]["classement_list"][$ca->caddie_classement]["title"] = stripslashes($ca->caddie_classement);
         if ($parity = 1 - $parity) {
             $pair_impair = "even";
         } else {
             $pair_impair = "odd";
         }
         $tr_javascript = " onmouseover=\"this.className='surbrillance'\" onmouseout=\"this.className='{$pair_impair}'\" ";
         $print_cart[$ctype]["classement_list"][$ca->caddie_classement]["cart_list"] .= pmb_bidi("<tr class='{$pair_impair}' {$tr_javascript} ><td class='classement60'><input type='checkbox' id='id_" . $ca->idcaddie . "' name='caddie[" . $ca->idcaddie . "]' value='" . $ca->idcaddie . "' />&nbsp;");
         $link = "print_cart.php?action=print&object_type=" . $object_type . "&idcaddie=" . $ca->idcaddie . "&item={$item}&current_print={$current_print}";
         $print_cart[$ctype]["classement_list"][$ca->caddie_classement]["cart_list"] .= pmb_bidi("<a href='javascript:document.getElementById(\"id_" . $ca->idcaddie . "\").checked=true;document.forms[\"print_options\"].submit();' /><strong>" . $ca->name . "</strong>");
         if ($ca->comment) {
             $print_cart[$ctype]["classement_list"][$ca->caddie_classement]["cart_list"] .= pmb_bidi("<br /><small>(" . $ca->comment . ")</small>");
         }
         $print_cart[$ctype]["classement_list"][$ca->caddie_classement]["cart_list"] .= pmb_bidi("</td>\n            \t<td><b>" . $ca->nb_flags . "</b>" . $msg['caddie_contient_pointes'] . " / <b>{$ca->nb_objects}</b> </td>\n            \t<td>{$aff_lien}</td>\n\t\t\t\t</tr>");