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":
        include './catalog/caddie/pointage/main_ajax.inc.php';
        break;
Example #2
0
                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);
                }
            }
            $c->compte_items();
            $message .= sprintf($msg["print_cart_n_added"] . "\\n", $c->nb_item - $nb_items_before, $c->name);
        }
        print "<script>alert(\"{$message}\"); self.close();</script>";
    } else {
        print "<script>alert(\"" . $msg["print_cart_no_cart_selected"] . "\"); history.go(-1);</script>";
    }
    $_SESSION["PRINT_CART"] = false;
}
print $footer;