Beispiel #1
0
 function constitution($modif = 1)
 {
     global $dbh;
     global $PMBuserid;
     global $msg;
     $ret .= "<table><tr><th style='text-align:right;'>" . $msg['etagere_caddie_inclus'] . "</th><th>" . $msg['caddie_name'] . "</th></tr>";
     $rqt_caddie = "SELECT idcaddie, name, comment FROM caddie where type='NOTI' order by name ";
     $rescaddie = @pmb_mysql_query($rqt_caddie, $dbh);
     $parity = 1;
     while ($caddie = pmb_mysql_fetch_object($rescaddie)) {
         if ($PMBuserid == 1 || verif_droit_caddie($caddie->idcaddie)) {
             if ($parity % 2) {
                 $pair_impair = "even";
             } else {
                 $pair_impair = "odd";
             }
             $parity += 1;
             $tr_javascript = " onmouseover=\"this.className='surbrillance'\" onmouseout=\"this.className='{$pair_impair}'\" ";
             $link_visu_caddie = "<a href='./catalog.php?categ=caddie&sub=gestion&quoi=panier&action=&idcaddie=" . $caddie->idcaddie . "' target='_blank'>";
             $ret .= "<tr class='{$pair_impair}' {$tr_javascript}>";
             $ret .= "<td style='text-align:right;'><input type=checkbox name=idcaddie[] value='" . $caddie->idcaddie . "' class='checkbox' ";
             if ($this->caddie_inclus($caddie->idcaddie)) {
                 $ret .= " checked ";
             }
             if (!$modif) {
                 $ret .= " disabled='disabled' ";
             }
             $ret .= " />&nbsp;</td>";
             $ret .= "<td>" . $link_visu_caddie . $caddie->name;
             if ($caddie->comment) {
                 $ret .= " (" . $caddie->comment . ")";
             }
             $ret .= "</a>";
             $ret .= "</td>";
             $ret .= "</tr>";
         }
     }
     $ret .= "</table>";
     return $ret;
 }
         // procédure d'ajout
         print pmb_bidi(aff_cart_titre($myCartOrigine));
         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) {
// !! 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;
}
Beispiel #4
0
// +-------------------------------------------------+
// $Id: constitution.inc.php,v 1.6 2007-03-10 09:03:18 touraine37 Exp $
if (stristr($_SERVER['REQUEST_URI'], ".inc.php")) {
    die("no access");
}
if (!verif_droit_etagere($idetagere)) {
    $action = "aucune";
}
switch ($action) {
    case 'edit_etagere':
        $myEtagere = new etagere($idetagere);
        $etagere_constitution_form = str_replace('!!formulaire_titre!!', $msg['etagere_constitution_de'] . " " . $myEtagere->name, $etagere_constitution_form);
        $etagere_constitution_form = str_replace('!!idetagere!!', $idetagere, $etagere_constitution_form);
        $etagere_constitution_form = str_replace('!!constitution!!', $myEtagere->constitution(1), $etagere_constitution_form);
        print pmb_bidi($etagere_constitution_form);
        break;
    case 'save_etagere':
        $myEtagere = new etagere($idetagere);
        // suppression
        $rqt = "delete from etagere_caddie where etagere_id='" . $idetagere . "' ";
        $res = mysql_query($rqt, $dbh);
        for ($i = 0; $i < sizeof($idcaddie); $i++) {
            if (verif_droit_caddie($idcaddie[$i])) {
                $myEtagere->add_panier($idcaddie[$i]);
            }
        }
        aff_etagere("constitution", 0);
        break;
    default:
        aff_etagere("constitution", 0);
}