"; else $lien_edition_panier_cst = ""; if($sub!='gestion' && $sub!='action') { print "
"; } $liste = empr_caddie::get_cart_list($restriction_panier); print "
"; if(sizeof($liste)) { print "
$titre
"; print confirmation_delete("$lien_origine&action=del_cart&item=$item&idemprcaddie="); print ""; print ""; $parity=0; while (list($cle, $valeur) = each($liste)) { $rqt_autorisation=explode(" ",$valeur['autorisations']); if (array_search ($PMBuserid, $rqt_autorisation)!==FALSE || $PMBuserid==1) { $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=$valeur['type']; $print_cart[$myCart->type]["titre"]="".$msg["caddie_de_".$myCart->type]."
"; $tr_javascript=" onmouseover=\"this.className='surbrillance'\" onmouseout=\"this.className='$pair_impair'\" "; if($item) { $print_cart[$myCart->type]["cart_list"].= pmb_bidi(""); } else { $print_cart[$myCart->type]["cart_list"].= ""; } } } // affichage des paniers par type foreach($print_cart as $key => $cart_type) { print $cart_type["cart_list"]; } print "
"); if($action != "transfert" && $action != "del_cart" && $action!="save_cart") { $print_cart[$myCart->type]["cart_list"].= pmb_bidi(" "); $print_cart[$myCart->type]["cart_list"].= pmb_bidi("".$valeur['name'].""); // form_filters_cart //$print_cart[$myCart->type]["cart_list"].= pmb_bidi("".$valeur['name'].""); } else { $print_cart[$myCart->type]["cart_list"].= pmb_bidi("".$valeur['name'].""); } if ($valeur['comment']) $print_cart[$myCart->type]["cart_list"].= pmb_bidi("
(".$valeur['comment'].")"); $print_cart[$myCart->type]["cart_list"].= pmb_bidi("
".aff_cart_nb_items_reduit($myCart)." $aff_lien
"; if($sub!='gestion' && $sub!='action' && $action!="save_cart") { $print_cart[$myCart->type]["cart_list"].= " "; $print_cart[$myCart->type]["cart_list"].= "".$valeur['name'].""; } else $print_cart[$myCart->type]["cart_list"].= "".$valeur['name'].""; if ($valeur['comment']) $print_cart[$myCart->type]["cart_list"].= "
(".$valeur['comment'].")"; $print_cart[$myCart->type]["cart_list"].="
".aff_cart_nb_items_reduit($myCart)." $aff_lien
"; } else { print $msg[398]; } if($sub!='gestion' && $sub!='action'&& $action != "del_cart") { $boutons_select="  "; } if ($lien_creation) { print "

"; if($sub!='gestion') print $boutons_select.""; else print $boutons_select.""; print "
"; } else { print "

$boutons_select
"; } if ($post_param_serialized != "") { print unserialize($post_param_serialized); } if($sub!='gestion') print"
"; } // ******************************************************************************** function aff_empr_cart_titre ($myCart) { global $msg; if ($myCart->comment) $aff_tit_panier = $myCart->name." - ".$myCart->comment; else $aff_tit_panier = $myCart->name; return "

$aff_tit_panier

"; } // ******************************************************************************** function aff_empr_cart_nb_items ($myCart) { global $msg; return "
$msg[caddie_contient]
$msg[caddie_contient_total]
$msg[caddie_contient_nb_pointe]
$msg[caddie_contient_total]
$myCart->nb_item
$myCart->nb_item_pointe

"; } // ****************************** aff_empr_cart_objects function aff_empr_cart_objects ($idemprcaddie=0, $url_base="./circ.php?categ=caddie&sub=gestion&quoi=panier&idemprcaddie=0", $no_del=false,$rec_history=0 ) { global $msg, $begin_result_liste; global $dbh; global $nbr_lignes, $page, $nb_per_page_search ; global $url_base_suppr_empr_cart ; $url_base_suppr_empr_cart = $url_base ; // 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 empr_caddie_content where empr_caddie_id='".$idemprcaddie."' "; $res = mysql_query($requete, $dbh); $nbr_lignes = mysql_result($res, 0, 0); } if(!$page) $page=1; $debut =($page-1)*$nb_per_page; //Calcul des variables pour la suppression d'items $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 empr_caddie($idemprcaddie); $from = " empr_caddie_content left join empr on id_empr = object_id "; $order_by = " empr_nom, empr_prenom " ; $requete = "SELECT object_id, flag FROM $from where empr_caddie_id='".$idemprcaddie."' order by $order_by"; $requete.= " LIMIT $debut,$nb_per_page "; $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 = @mysql_query($requete, $dbh); if(mysql_num_rows($result)) { while ($temp = mysql_fetch_object($result)) $liste[] = array('object_id' => $temp->object_id, 'flag' => $temp->flag ) ; } if(!sizeof($liste) || !is_array($liste)) { print $msg[399]; return; } else { print $begin_result_liste; while(list($cle, $object) = each($liste)) { // affichage de la liste des emprunteurs $requete = "SELECT * FROM empr WHERE id_empr=$object[object_id] LIMIT 1"; $fetch = mysql_query($requete); if(mysql_num_rows($fetch)) { $empr = mysql_fetch_object($fetch); // emprunteur $link = './circ.php?categ=pret&form_cb='.rawurlencode($empr->empr_cb); if ($object[flag]) $marque_flag ="" ; else $marque_flag ="" ; if (!$no_del) $lien_suppr_cart = "basket $marque_flag"; else $lien_suppr_cart = $marque_flag ; $empr = new emprunteur($empr->id_empr, "", FALSE, 3); $empr->fiche_consultation = str_replace('!!image_suppr_caddie_empr!!' , $lien_suppr_cart , $empr->fiche_consultation); $empr->fiche_consultation = str_replace('!!lien_vers_empr!!' , $link , $empr->fiche_consultation); print $empr->fiche_consultation; } } // fin de liste } print "
".$nav_bar ; return; } //********************************************************************************* function aff_empr_choix_quoi($action="", $action_cancel="", $titre_form="", $bouton_valider="",$onclick="") { global $empr_cart_choix_quoi; $empr_cart_choix_quoi = str_replace('!!action!!', $action, $empr_cart_choix_quoi); $empr_cart_choix_quoi = str_replace('!!action_cancel!!', $action_cancel, $empr_cart_choix_quoi); $empr_cart_choix_quoi = str_replace('!!titre_form!!', $titre_form, $empr_cart_choix_quoi); $empr_cart_choix_quoi = str_replace('!!bouton_valider!!', $bouton_valider, $empr_cart_choix_quoi); if ($onclick!="") $empr_cart_choix_quoi = str_replace('!!onclick_valider!!','onClick="'.$onclick.'"',$empr_cart_choix_quoi); else $empr_cart_choix_quoi = str_replace('!!onclick_valider!!','',$empr_cart_choix_quoi); return $empr_cart_choix_quoi; } // ******************************************************************************** function verif_droit_proc_empr_caddie($id) { global $msg; global $PMBuserid; global $dbh; if ($id) { $requete = "SELECT autorisations FROM empr_caddie_procs WHERE idproc='$id' "; $result = @mysql_query($requete, $dbh); if(mysql_num_rows($result)) { $temp = mysql_fetch_object($result); $rqt_autorisation=explode(" ",$temp->autorisations); if (array_search ($PMBuserid, $rqt_autorisation)!==FALSE || $PMBuserid == 1) return 1 ; else return 0 ; } else return 0; } else return 0 ; } // ******************************************************************************** function verif_droit_empr_caddie($id) { global $msg; global $PMBuserid; global $dbh ; if ($id) { $requete = "SELECT autorisations FROM empr_caddie WHERE idemprcaddie='$id' "; $result = @mysql_query($requete, $dbh); if(mysql_num_rows($result)) { $temp = mysql_fetch_object($result); $rqt_autorisation=explode(" ",$temp->autorisations); if (array_search ($PMBuserid, $rqt_autorisation)!==FALSE || $PMBuserid == 1) return $id ; else return 0 ; } else return 0; } else return 0 ; }