// !! 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; case "collecte": include './catalog/caddie/collecte/main_ajax.inc.php'; break; default: break; }
aff_paniers_empr($idemprcaddie, "./circ.php?categ=caddie&sub=action&quelle=transfert&idemprcaddie_origine={$idemprcaddie}", "transfert_suite", $msg["caddie_select_transfert_dest"], "", 0, 0, 0); break; case 'transfert_suite': $idemprcaddie_origine = verif_droit_empr_caddie($idemprcaddie_origine); if ($idemprcaddie_origine) { $myCartOrigine = new empr_caddie($idemprcaddie_origine); // procédure d'ajout print aff_empr_cart_titre($myCartOrigine); print aff_empr_cart_nb_items($myCartOrigine); print aff_empr_choix_quoi("./circ.php?categ=caddie&sub=action&quelle=transfert&action=transfert_final&idemprcaddie={$idemprcaddie}&idemprcaddie_origine={$idemprcaddie_origine}", "./circ.php?categ=caddie&sub=action&quelle=transfert&action=&idemprcaddie=", $msg["caddie_choix_transfert"], $msg["caddie_bouton_transferer"]); print aff_empr_cart_titre($myCart); print aff_empr_cart_nb_items($myCart); } break; case 'transfert_final': $idemprcaddie_origine = verif_droit_empr_caddie($idemprcaddie_origine); if ($idemprcaddie_origine) { $myCartOrigine = new empr_caddie($idemprcaddie_origine); print aff_empr_cart_titre($myCart); print aff_empr_cart_nb_items($myCart); if ($elt_flag) { $liste = $myCartOrigine->get_cart("FLAG"); while (list($cle, $object) = each($liste)) { $myCart->add_item($object); } } if ($elt_no_flag) { $liste = $myCartOrigine->get_cart("NOFLAG"); while (list($cle, $object) = each($liste)) { $myCart->add_item($object); }
function caddie_pointage_raz($caddie_id) { global $dbh; global $msg; global $charset; global $PMBuserid; $caddie_id += 0; $myCart = new empr_caddie($caddie_id); print aff_empr_cart_titre($myCart); $droit = verif_droit_empr_caddie($caddie_id); if ($droit) { $myCart->depointe_items(); } return $this->build_ok($infos); }
<?php // +-------------------------------------------------+ // © 2002-2004 PMB Services / www.sigb.net pmb@sigb.net et contributeurs (voir www.sigb.net) // +-------------------------------------------------+ // $Id: pointage_raz.inc.php,v 1.1 2007-07-14 10:48:51 touraine37 Exp $ if (stristr($_SERVER['REQUEST_URI'], ".inc.php")) { die("no access"); } if ($idemprcaddie) { $myCart = new empr_caddie($idemprcaddie); print aff_empr_cart_titre($myCart); $droit = verif_droit_empr_caddie($idemprcaddie); if ($droit) { $myCart->depointe_items(); } print aff_empr_cart_nb_items($myCart); } else { aff_paniers_empr($idemprcaddie, "./circ.php?categ=caddie&sub=gestion&quoi=razpointage&moyen=raz", "", $msg[caddie_pointage_raz], "", 0, 0, 0); }