dossier) { $docs[ID][$f]=$res->id; $docs[LIBELLE][$f]=$res->libelle; $f++; } else { $folders[ID][$d]=$res->id; $folders[LIBELLE][$d]=$res->libelle; $d++; } } if (!isset($folders[ID])) $folders[ID]=array(); for ($i=0; $i"; $t_l=explode(",",$last_before); for ($j=0; $j<$level-1; $j++) { if (!$t_l[$j]) $img_vert="$base_path/images/tree/ftv2vertline.gif"; else $img_vert="$base_path/images/tree/ftv2blank.gif"; echo ""; } if (($i==count($folders[ID])-1)&&(count($docs)==0)) $img_node="$base_path/images/tree/ftv2plastnode.gif"; else $img_node="$base_path/images/tree/ftv2pnode.gif"; if (($i==count($folders[ID])-1)&&(count($docs)==0)) $last=1; else $last=0; echo ""; echo ""; $nb_notices=$cnt[$folders[ID][$i]]; $link=str_replace("!!id!!",$folders[ID][$i],$js); if ($nb_notices) echo "".$folders[LIBELLE][$i]." ($nb_notices)"; else echo $folders[LIBELLE][$i]; flush(); echo "
"; $last_before_=$last_before; if ($last_before_!="") $last_before_.=","; $last_before_.=$last; gen_div($folders[ID][$i],$level+1,$prefix_name.".".$i,$last,$last_before_,$js); echo "
\n"; echo "\n"; } for ($i=0; $i"; $t_l=explode(",",$last_before); for ($j=0; $j<$level-1; $j++) { if (!$t_l[$j]) $img_vert="$base_path/images/tree/ftv2vertline.gif"; else $img_vert="$base_path/images/tree/ftv2blank.gif"; echo ""; } if ($i==count($docs[ID])-1) $img_node="$base_path/images/tree/ftv2lastnode.gif"; else $img_node="$base_path/images/tree/ftv2node.gif"; echo ""; echo ""; $nb_notices=$cnt[$docs[ID][$i]]; if ($nb_notices!=0) echo "".$docs[LIBELLE][$i]." ($nb_notices)"; else echo $docs[LIBELLE][$i]; echo "\n"; flush(); } } function tree($js) { global $base_path; global $cnt; echo "
Catégories"; $categ_id=0; $level=1; $prefix_name="1"; for ($i=1; $i<=4; $i++) { $requete="select count(notice_id), categ$i from notices group by categ$i"; $resultat=mysql_query($requete); while (list($n,$c)=mysql_fetch_row($resultat)) { $cnt[$c]+=$n; } } gen_div($categ_id,$level,$prefix_name,1,"",$js); echo "
"; }