<?php
//中类页生成。catedetail.html 生成index.html $catedetailStytle="allCateProducts"; ls_syscode writeProPageIndex 611 {ls_behalf}   Click for details 631 $behalf = $sub_pic,  728 $behalf = $sub_pic;  writeIndexPages 1815  _products_catedetail

	switch($catedetailStytle){
			// 中类下的各小类代表图
			case "catePic":
				//小类代表图
				$subcate_pic_sql="SELECT * FROM `ls_products` WHERE `subcateID`=".$midcateid."";
				$subcate_pic_query=$opendb->query($subcate_pic_sql);
				$sub_pic = "<ul class=\"pro_list\">";
				while($subcate_pic_rows=mysqli_fetch_assoc($subcate_pic_query)){
					if($subcate_pic_rows['catePic'] != null){
						$sub_pic .= "<li><a href=\"".$subcate_pic_rows['subcateFolders']."/\"><img src=\"".$subcate_pic_rows['subcateFolders']."/".$subcate_pic_rows['catePic']."\"  name=\"imgs\" alt=\"".$products_rows['productItemNo']."\" /></a>".$subcate_pic_rows['subcateName']."</li>";
					}
				}
				$sub_pic .= "</ul>";			
			break;

			case "selectProducts":  //类产品
				$addstr=" and AdditionalAttributesClassPro=1 ";
			
			case "allCateProducts":  // 本类全部产品 Click for details
				if($catedetailStytle=="allCateProducts") $addstr=" "; //全部
			
			 
				$subcate_pic_sql="SELECT * FROM `ls_products` WHERE `subcateID`=".$midcateid."";
				$subcate_pic_query=$opendb->query($subcate_pic_sql);
				$sub_pic = "<ul class=\"pro_list\">";

				while($subcate_pic_rows=mysqli_fetch_assoc($subcate_pic_query)){
					$catedetail_sql="SELECT * FROM `ls_products` WHERE `productID`=".$subcate_pic_rows['ID'].$addstr." and enable=1 order by Num ";
					$catedetail_query=$opendb->query($catedetail_sql);
					while($catedetail_rows=mysqli_fetch_assoc($catedetail_query)){
						$filenameprodetail1=$catedetail_rows['filename']==""?clearFolder(strtolower(pathProName($catedetail_rows['productName'])))."-".$catedetail_rows['ID'].".html":$catedetail_rows['filename']; //21-7-28
						$filenameprodetail= $subcate_pic_rows['subcateFolders']."/".$filenameprodetail1; //21-7-28
						$cateproimgpic= $subcate_pic_rows['subcateFolders']."/".$SmallFoldersProducts."/".$catedetail_rows['productPic'];
						$picsrc= $catedetail_rows['wholepathpic']; //  21-7-11 换后台，新传图片优先使用，新图为空，使用老图
						$cateproimgpic= $picsrc!=NULL?"../".$picsrc:$cateproimgpic;
						
						
// 相册 
/*						$sub_pic .= " 
						<li class=\"prodt\">
						 
						<a class=\"prog\" href=\"".$filenameprodetail."\">
						<img src=\"".$cateproimgpic."\" name=\"imgs\" alt=\"<translate>".$catedetail_rows['productName']."</translate>\" title=\"<translate>".$catedetail_rows['productName']."</translate>\" /></a>
						 
			  <span>
						<a href=\"".$filenameprodetail."\"><translate>".$catedetail_rows['productName']."</translate></a>
						 
						</span> </li>
						";*/
						
//列表
						$sub_pic.="<div>
						 <div class=\"col-lg-3 col-md-3 col-sm-3 col-xs-6 prolist\" >
						 <div class=\"proimg_list\">
						<a href=\"".$filenameprodetail."\" alt=\"<translate>".$catedetail_rows['productName'].", ".$catedetail_rows['productName']."</translate>\" title=\"<translate>".$catedetail_rows['productName']."</translate>\" ><img src=\"".$cateproimgpic."\" alt=\"<translate>".$catedetail_rows['productName'].", ".$catedetail_rows['productName']."</translate>\" title=\"<translate>".$catedetail_rows['productName']."</translate>\" width='240' /></a></div>
						<div class=\"prowenzi\" >
						<a class=\"mingzi\" href=\"".$filenameprodetail."\" alt=\"<translate>".$catedetail_rows['productName'].", ".$catedetail_rows['productName']."</translate>\" title=\"<translate>".$catedetail_rows['productName']."</translate>\" class='pn' >".$catedetail_rows['productName']."</a>
					
			 </div>
			  
				 </div>
			</div>
				";
					
			}
		}
   
		$sub_pic .= "";//echo $sub_pic;
		break;
	}
	$sub_pic .= "";//echo $sub_pic;
	
 
			
?>
