<?php
//主菜单 product 下拉菜单 56 public   {ls_s_cate} 

	$s_pro_cate="<ul class=\"sub-menu  styled dl-submenu-disabled\">";
	$x = $pro_num;
	$y = 0;
	while($pro_cate_rows=mysql_fetch_assoc($pro_cate_query))
	{
	  $y++;
	  $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)//大类
	  {
		//$s_pro_cate.="&nbsp;<img src='../Templates/images/cate.gif' border='0'> \n";
		//$s_pro_cate.="\n<dt>".$pro_cate_rows['cateName']."</dt>";

		  $s_pro_cate.="<li class=\"menu-item\"><a href='../".$pro_cate_rows['cateFolders']."/'><translate>".$pro_cate_rows['cateName']."</translate></a></li>";

		//".$pro_cate_rows['cateFolders'].".html $s_pro_cate.="\n <div class=\"cate_list\">\n"; //大类菜单样式，div css:cate_list
	  } 
	  else//大类中类
	  {
		//$s_pro_cate.="&nbsp;<img src='../Templates/".$templates_var."/images/cate.gif' border='0'> \n";  //大类引导图
		$detailsfile="../".$pro_cate_rows['cateFolders']."/"; //".$pro_cate_rows['cateFolders'].".html
		$detailsfile2="../".$templates_var."/catedetail.html";
		if(file_exists($detailsfile2)){
			//../{ls_addprolink}
			$s_pro_cate.="\n<li class=\"menu-item\"><a href='".$detailsfile."' ><translate>".$pro_cate_rows['cateName']."</translate></a><ul class=\"list-unstyled\" id=\"content".$pro_cate_rows['ID']."\" >";
		}else{
			$s_pro_cate.="\n<li class=\"menu-item\"><a href='".$detailsfile."'  ><translate>".$pro_cate_rows['cateName']."</translate></a><ul class=\"list-unstyled\" id=\"content".$pro_cate_rows['ID']."\" >";
		}
		
		//？ 不应该有$s_pro_cate.="\n <div class=\"cate_list\">\n"; onclick=\"turnit(".$pro_cate_rows['ID'].",".$pro_cate_rows['ID'].");this.href=this.href+'?menuId='+".$pro_cate_rows['ID']."+'&cate='+".$pro_cate_rows['ID'].";\"
		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);

			//$s_pro_cate.="<div class=\"midcate_list\">"; //中类菜单样式
	
			if($pro_subcate_num==0)//没小类
			{
				$s_pro_cate.="\n<li class=\"menu-item\"><a href='../".$pro_cate_rows['cateFolders']."/".$pro_midcate_rows['midcateFolders']."/' ><translate>".$pro_midcate_rows['midcateName']."</translate></a></li>";
				// ".$pro_midcate_rows['midcateFolders'].".html  onclick=\"turnit(".$pro_cate_rows['ID'].",".$pro_cate_rows['ID'].");this.href=this.href+'?menuId='+".$pro_cate_rows['ID']."+'&cate='+".$pro_cate_rows['ID'].";\"
			}
			else//有小类
			{
			//$s_pro_cate.="&nbsp;<img src='../Templates/".$templates_var."/images/midcate.gif' border='0'> \n"; //中类引导图
			$detailsfile="../".$pro_cate_rows['cateFolders']."/".$pro_midcate_rows['midcateName']."/"; //".$pro_midcate_rows['midcateName'].".html
			if(file_exists($detailsfile))
			{$s_pro_cate.="<li class=\"menu-item\"><a href='".$detailsfile."'><translate>".$pro_midcate_rows['midcateName']."<translate></a><ul>";}
			else
			{$s_pro_cate.="\n<li class=\"menu-item\"> <a href='".$detailsfile."' ><span class=\"glyphicon glyphicon-forward\"></span> <translate>".$pro_midcate_rows['midcateName']."</translate></a>\n<ul class=\"sub-menu\">\n";}
			//$s_pro_cate.="<div class=\"subcate_list\">";//小类菜单样式
			while($pro_subcate_rows=mysql_fetch_assoc($pro_subcate_query))		//小类生成
			 {
				$s_pro_cate.="<li class=\"menu-item\"> <a href=\"../".$pro_cate_rows['cateFolders']."/".$pro_midcate_rows['midcateFolders']."/".$pro_subcate_rows['subcateFolders']."/\" ><translate>".$pro_subcate_rows['subcateName']."</translate></a></li>\n"; //".$pro_subcate_rows['subcateFolders'].".html
			 }
			$s_pro_cate.="</ul>\n</li>\n"; 
			} 
		}
		$s_pro_cate.="</ul>";
	  }//if($pro_midcate_num==0)//dalei
	
	}
	$s_pro_cate.="\n </ul>";
?>
