<?php
//支类列表面生成 templ_index 240 {ls_classpro},  $ls_classproType="cateList" 产品分类展开列表，
//大类，中类，小类，<ul class=\"ls_classpro\">

		if($pro_midcate_num==0)//大类
		{
	  //$s_classpro.="&nbsp;<img src='../Templates/images/cate.gif' border='0'> \n";
	  //$s_classpro.="\n<dt>".$classpro_rows['cateName']."</dt>";

		  $myproid=$classpro_rows['ID'];
		  $catehref="../".$classpro_rows['cateFolders']."/";
		  $cateurl1= catepro1($myproid);//大类下1个产品
		  $catehref=$cateurl1!=">1"?$cateurl1:$catehref; //1个产品跳过列表页

		  $s_classpro.="<li><img src='../".$templates_var."/images/name_prefix.gif' border='0'> <a href='".$catehref."'>".$classpro_rows['cateName']."</a></li><ul> \r\n";
		  // $s_classpro.="\n <div class=\"cate_list\">\n"; //大类菜单样式，div css:cate_list
		} 
		else//大类中类
		{
			//$s_classpro.="&nbsp;<img src='../Templates/".$templates_var."/images/cate.gif' border='0'> \n";  //大类引导图
			$detailsfile="../".$classpro_rows['cateFolders']."/indexdetails.html";
			if(file_exists($detailsfile))
			{ 	$s_classpro.=" <dt><a href='".$detailsfile."'>".$classpro_rows['cateName']."</a></dt>\r\n";}
			else
			{	$s_classpro.=" <li><img src='../".$templates_var."/images/name_prefix.gif' border='0'> <a href='javascript:void(0)'>".$classpro_rows['cateName']."</a><ul>\r\n";}
		
			//？ 不应该有$s_classpro.="\n <div class=\"cate_list\">\n";
				while($pro_midcate_rows=mysqli_fetch_assoc($pro_midcate_query))
				{
					$pro_subcate_sql="select * from ls_products where branchID=0 and 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=mysqli_num_rows($pro_subcate_query); 

				//$s_classpro.="<div class=\"midcate_list\">"; //中类菜单样式
	
					if($pro_subcate_num==0)//没小类
					{
					//$s_classpro.="&nbsp;<img src='../Templates/".$templates_var."/images/midcate.gif' border='0'> \n";  //中类引导图
						$mmyproid=$pro_midcate_rows['ID'];
						$mcatehref="../".$classpro_rows['cateFolders']."/".$pro_midcate_rows['midcateFolders']."/";
						$cateurl1= catepro1($mmyproid);//类下1个产品
						$mcatehref=$cateurl1!=">1"?$cateurl1:$mcatehref; //1个产品跳过列表页
					
						$s_classpro.="<li><a href='".$mcatehref."'>".$pro_midcate_rows['midcateName']."</a></li>\r\n";
					}
					else//有小类
					{
					//$s_classpro.="&nbsp;<img src='../Templates/".$templates_var."/images/midcate.gif' border='0'> \n"; //中类引导图
						$detailsfile="../".$classpro_rows['cateFolders']."/".$pro_midcate_rows['midcateName']."/indexdetails.html";
						if(file_exists($detailsfile))
						{$s_classpro.="<a href='".$detailsfile."'>".$pro_midcate_rows['midcateName']."</a>\r\n";}
						else
						{$s_classpro.="\n<dd><a href='javascript:void(0)'>".$pro_midcate_rows['midcateName']."</a>\n<ul>\r\n";}
					//$s_classpro.="<div class=\"subcate_list\">";//小类菜单样式
						while($pro_subcate_rows=mysqli_fetch_assoc($pro_subcate_query))		//小类生成
						{
							
							$smyproid=$pro_subcate_rows['ID'];
							$scatehref="../".$classpro_rows['cateFolders']."/".$pro_midcate_rows['midcateFolders']."/".$pro_subcate_rows['subcateFolders']."/";
							$cateurl1= catepro1($smyproid);//类下1个产品
							$scatehref=$cateurl1!=">1"?$cateurl1:$scatehref; //1个产品跳过列表页
						
														
							$s_classpro.="<li><a href=\"".$scatehref."\" >".$pro_subcate_rows['subcateName']."</a></li>\r\n";						 }
					$s_classpro.="</ul>\n</dd>\r\n"; 
					}
				}
				$s_classpro.="</ul></li>\r\n";
			}//if($pro_midcate_num==0)//dalei
				
?>
