<?php
//主菜单 product 下拉菜单，大类横向，中小类下拉产品菜单, hbforrest菜单样式 275 public   {ls_s_cate}， 把下面内容复制到 _menu_product_down.php 并修改样式 

	$pro_cate_sql="select * from ls_products where midcateName is null and subcateName is null and subcateFolders is null and subcateBrief is null and subcateID is null and productPic is null and productItemNo is null and productName is null and productSpecification is null and productID is null and enable=1 order by Num asc";
	$pro_cate_query=$opendb->query($pro_cate_sql);
	$pro_num=mysql_num_rows($pro_cate_query);
	
	$cateclass="2";
	
	$pro_cate.="\n ";
	while($pro_cate_rows=mysql_fetch_assoc($pro_cate_query))
	{
		
	  if($cateclass=="2")
	 	 {$cateclass="";}
	  else
	 	 {$cateclass="2";}
	  
	  $pro_midcate_sql="select * from ls_products where cateName is null and subcateName is null and subcateFolders is null and subcateBrief is null and subcateID is null and productPic is null and productItemNo is null and productName is null and productSpecification is null and productID is null and enable=1 and midcateID=".$pro_cate_rows['ID']." order by Num asc";
	  $pro_midcate_query=$opendb->query($pro_midcate_sql);
	  $pro_midcate_num=mysql_num_rows($pro_midcate_query);
	  
	  if($pro_midcate_num==0)//主菜单：大类菜单横向菜单
	  {
		$pro_cate.="<li   class='dropdown' > \n 
		                   <a class='dropdown-toggle' data-toggle='dropdown' role='button' aria-haspopup='true' aria-expanded='false' href='../".rawurlencode($pro_cate_rows['cateFolders'])."/".rawurlencode($pro_cate_rows['cateFolders']).".html' > \n".$CateMenuPrefix.$pro_cate_rows['cateName']."</a>";		//大类菜单项，li css:menu2; a css:cate_menu
		$pro_cate.="\n	 		<ul class='sub-menu  styled dl-submenu-disabled'>\n";
	  }
	  else//大类中类
	  {
		$pro_cate.="<li class='dropdown'  > \n 
		                   <a  href='../search.php?cateid=".$pro_cate_rows['ID']."&catename=".$pro_cate_rows['cateName']."&brief=".substr($pro_cate_rows['cateBrief'],0,$CateLength)."' class='dropdown-toggle' data-toggle='dropdown' role='button' aria-haspopup='true' aria-expanded='false'> \n".$CateMenuPrefix.$pro_cate_rows['cateName']."</a>";		//大类菜单  li css:menu2; a css:cate_menu
		$pro_cate.="\n	 				<ul class='sub-menu  styled dl-submenu-disabled'>\n";
		while($pro_midcate_rows=mysql_fetch_assoc($pro_midcate_query))
		{
			$pro_subcate_sql="select * from ls_products where midcateName is null and cateName is null and cateFolders is null and catePagePic is null and catePagePicWidth is null and catePagePicHeight is null and cateBrief is null and productPic is null and productItemNo is null and productName is null and productSpecification is null and productID is null and enable=1 and subcateID=".$pro_midcate_rows['ID']." order by Num asc";
			$pro_subcate_query=$opendb->query($pro_subcate_sql);
			$pro_subcate_num=mysql_num_rows($pro_subcate_query); 
		
			if($pro_subcate_num==0)//没小类
			{
			//$pro_cate.="&nbsp;<img src='../Templates/".$templates_var."/images/cate.gif' border='0'> \n";	//中类有前导图，下无小类
			$pro_cate.="	 	<li class='menu-item'>	<a   href='../".rawurlencode($pro_cate_rows['cateFolders'])."/".rawurlencode($pro_midcate_rows['midcateFolders'])."/".rawurlencode($pro_midcate_rows['midcateFolders']).".html' >\n".$midCateMenuPrefix.$pro_midcate_rows['midcateName']."</a> </li>\n";	//中类下拉菜单项，css：cate_menu2
			}
			else//有小类
			{
			//$pro_cate.="&nbsp;<img src='../Templates/".$templates_var."/images/cate2.gif' border='0'> \n";	//中类有前导图，下有小类
			$pro_cate.="	 	<li class='menu-item'>	<a  href='../search.php?cateid=".$pro_cate_rows['ID']."&midcatename=".$pro_midcate_rows['midcateName']."&midcateid=".$pro_midcate_rows['ID']."&brief=".substr($pro_midcate_rows['midcateBrief'],0,$CateLength)."' >\n".$midCateMenuPrefix.$pro_midcate_rows['midcateName']."</a> </li>\n";	//中类下拉菜单项，css：cate_menu2
			}
		
			while($pro_subcate_rows=mysql_fetch_assoc($pro_subcate_query))
			 {
				//$pro_cate.="&nbsp;<img src='../Templates/".$templates_var."/images/subcate.gif' border='0' > \n";	//小类有前导图
				$pro_cate.="	 	<li class='menu-item'>	<a   href=\"../".rawurlencode($pro_cate_rows['cateFolders'])."/".rawurlencode($pro_midcate_rows['midcateFolders'])."/".rawurlencode($pro_subcate_rows['subcateFolders'])."/".rawurlencode($pro_subcate_rows['subcateFolders']).".html\" >\n ".$SubCateMenuPrefix.$pro_subcate_rows['subcateName']."</a></li>\n";	//小类菜单项，css：cate_menu2
			 }
		} 
	  }//if($pro_midcate_num==0)//dalei
		 $pro_cate.="	 			</ul>\n 
	                 </li>\n";
	}
	$pro_cate.=" \n ";
		
	$cate=str_replace("../","",$pro_cate);//cate
	$pro2_cate=str_replace("../","../../",$pro_cate);//pro2_cate
	$pro3_cate=str_replace("../","../../../",$pro_cate);//pro3_cate
	$pro4_cate=str_replace("../","../../../../",$pro_cate);//pro4_cate
	
	
	$m_cate=$cate;//cate
	$p_m_cate=$pro_cate;//pro1_cate
	$p_m_cate1=$pro2_cate;//pro2_cate
	$p_m_cate2=$pro3_cate;//pro3_cate
	$p_m_cate3=$pro4_cate;//pro4_cate
	
	//echo $s_pro_cate;
/*	hbforrest

	$s_pro_cate=$pro_cate;
	$s_cate=str_replace("../","",$s_pro_cate);//cate
	$s_cate0 = $s_cate;
	$s_pro2_cate=str_replace("../","../../",$s_pro_cate);//pro2_cate
	$s_pro3_cate=str_replace("../","../../../",$s_pro_cate);//pro3_cate
	$s_pro4_cate=str_replace("../","../../../../",$s_pro_cate);//pro4_cate */

	//echo $s_pro_cate;
?>
