"; print "

".$msg["print_cart_title"]."

\n"; print "
"; //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"]="".$msg["caddie_de_".$ca->type]."
"; } 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(" "); $link = "print_cart.php?action=print&object_type=".$object_type."&idcaddie=".$ca->idcaddie."&item=$item¤t_print=$current_print"; $print_cart[$ctype]["classement_list"][$ca->caddie_classement]["cart_list"].= pmb_bidi( "".$ca->name."") ; if ($ca->comment) $print_cart[$ctype]["classement_list"][$ca->caddie_classement]["cart_list"].= pmb_bidi("
(".$ca->comment.")"); $print_cart[$ctype]["classement_list"][$ca->caddie_classement]["cart_list"].= pmb_bidi(" ".$ca->nb_flags."". $msg['caddie_contient_pointes']." / $ca->nb_objects $aff_lien "); } } print "  ".$msg["print_size_current_page"]."
 ".$msg["print_size_all"]."
 ".$msg["cart_include_child"]; print "

$boutons_select 
"; print "
"; print pmb_bidi("
".$msg['caddie_add_search']."
"); if (count($print_cart)) { foreach($print_cart as $key => $cart_type) { ksort($print_cart[$key]["classement_list"]); } 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["title"],"".$cart_typeBis["cart_list"]."
",1); } print gen_plus($key,$cart_type["titre"],$contenu,1); } } print ""; $boutons_select = ''; if (count($print_cart)) { $boutons_select = ""; } $boutons_select.= " "; $object_type="NOTI"; print "

$boutons_select 
"; print "
"; } if ($action=="print") { if ($_SESSION["session_history"][$current_print]) { if($_SESSION["session_history"][$current_print]["NOTI"]) $_SESSION["PRINT_CART"]=$_SESSION["session_history"][$current_print]["NOTI"]; else if($_SESSION["session_history"][$current_print]["EXPL"]) $_SESSION["PRINT_CART"]=$_SESSION["session_history"][$current_print]["EXPL"]; $_SESSION["PRINT_CART"]["caddie"]=$caddie; $_SESSION["PRINT_CART"]["pager"]=$pager; $_SESSION["PRINT_CART"]["include_child"]=$include_child; echo ""; } else { echo ""; } } if ((($action=="") || ($action=="add_item"))&&($_SESSION["PRINT_CART"])) { $environement=$_SESSION["PRINT_CART"]; $object_type="NOTI"; if ($environement["TEXT_QUERY"]) { $requete=$environement["TEXT_QUERY"]; if ($_SESSION["tri"]) { $sort=new sort('notices','base'); //$requete = $sort->appliquer_tri($_SESSION["tri"], $requete, "notice_id"); if ($nb_per_page_search) { //$requete .= " LIMIT ".$page*$nb_per_page_search.",".$nb_per_page_search; $requete = $sort->appliquer_tri($_SESSION["tri"], $requete, "notice_id" , $page*$nb_per_page_search , $nb_per_page_search); } else { $requete = $sort->appliquer_tri($_SESSION["tri"], $requete, "notice_id" ,0 ,0); } } if (!$environement["pager"]) { $p=stripos($requete,"limit"); if ($p) { $requete=substr($requete,0,$p); } } } else { switch ($environement["SEARCH_TYPE"]) { case "extended": $sh=new search(); $table=$sh->make_search(); $requete="select ".$table.".* from $table"; if ($_SESSION["tri"]) { $sort=new sort('notices','base'); if ($nb_per_page_search) { $requete = $sort->appliquer_tri($_SESSION["tri"], $requete, "notice_id" , $page*$nb_per_page_search , $nb_per_page_search); } else { $requete = $sort->appliquer_tri($_SESSION["tri"], $requete, "notice_id" ,0 ,0); } if (!$environement["pager"]) { $p=stripos($requete,"limit"); if ($p) { $requete=substr($requete,0,$p); } } } else { $requete .= ",notices where notices.notice_id=$table.notice_id"; if ($environement["pager"]) $requete.=" limit ".$nb_per_page_search*$page.",$nb_per_page_search"; } break; case "cart": $requete="select object_id as notice_id from caddie_content"; if ($_SESSION["tri"]) { $requete.=" where caddie_id=".$idcaddie; $sort=new sort('notices','base'); if ($nb_per_page_search) { $requete = $sort->appliquer_tri($_SESSION["tri"], $requete, "notice_id" , $nb_per_page_search*($page-1) , $nb_per_page_search); } else { $requete = $sort->appliquer_tri($_SESSION["tri"], $requete, "notice_id" ,0 ,0); } if (!$environement["pager"]) { $p=stripos($requete,"limit"); if ($p) { $requete=substr($requete,0,$p); } } } else { $requete.= ",notices where notices.notice_id=caddie_content.object_id and caddie_id=".$idcaddie; $orderby = " order by index_sew"; if ($environement["pager"]) $requete.=$orderby." limit ".($nb_per_page_search*($page-1)).",$nb_per_page_search"; } break; case "expl": $sh=new search(true,"search_fields_expl"); $table=$sh->make_search(); if ($environement["pager"]) $limit="limit ".($nb_per_page_search*$page).",$nb_per_page_search"; $requete="select expl_id as notice_id from $table ".$limit; $object_type="EXPL"; break; } } if ($environement["caddie"]) { foreach ($environement["caddie"] as $environement_caddie) { $c=new caddie($environement_caddie); $nb_items_before=$c->nb_item; $resultat=@pmb_mysql_query($requete); print pmb_mysql_error(); while (($r=pmb_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 ""; } else { print ""; } $_SESSION["PRINT_CART"]=false; } print $footer; ?>