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

	switch($catedetailStytle){
			// 大类下的各中类代表图
			case "catePic":
			
				$mid_pic = "<div class=\"row pro_list\">";
				while($midcate_pic_rows=mysqli_fetch_assoc($midcate_pic_query)){
					if($midcate_pic_rows['catePic'] != null){
						$cateproimgpic=$midcate_pic_rows['midcateFolders']."/".$midcate_pic_rows['catePic'];
						
						$picsrc= $midcate_pic_rows['wholepathpic']; //  21-7-11 换后台，新传图片优先使用，新图为空，使用老图
						$cateproimgpic= $picsrc!=NULL?"../".$picsrc:$cateproimgpic;
						
						$mid_pic .= "<div class=\"col-xs-4\"><div class=\"thumbnail\"><div class=\"img-pic\"><a href=\"".$midcate_pic_rows['midcateFolders']."/".($oldcatepath?$midcate_pic_rows['midcateFolders'].".html":"")."\"><img src=\"".$cateproimgpic."\" name=\"imgs\" alt=\"<translate>".$midcate_pic_rows['midcateName']."</translate>\" title=\"<translate>".$midcate_pic_rows['midcateName']."</translate>\"/></a></div><div class=\"caption \" align='center'><a href=\"".$midcate_pic_rows['midcateFolders']."/".($oldcatepath?$midcate_pic_rows['midcateFolders'].".html":"")."\" ><translate>".$midcate_pic_rows['midcateName']."</translate></a></div></div>
						</div>";
					}
				}
				
				$mid_pic .= "</div>";//echo $mid_pic;
			
			break;

			case "selectProducts":  //类产品
				$addstr=" and AdditionalAttributesClassPro=1 ";
			
			case "allCateProducts":  // 本类全部产品 Click for details
				if($catedetailStytle=="allCateProducts") $addstr=" "; //全部
			
				$mid_pic = "";
				while($midcate_pic_rows=mysqli_fetch_assoc($midcate_pic_query)){
						$catedetail_sql="SELECT * FROM `ls_products` WHERE `productID`=".$midcate_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=$midcate_pic_rows['midcateFolders']."/".$filenameprodetail1; //21-7-28
							$cateproimgpic=$midcate_pic_rows['midcateFolders']."/".$SmallFoldersProducts."/".$catedetail_rows['productPic'];
							$picsrc= $catedetail_rows['wholepathpic']; //  21-7-11 换后台，新传图片优先使用，新图为空，使用老图
							$cateproimgpic= $picsrc!=NULL?"../".$picsrc:$cateproimgpic;
							
							
	// 相册 
	/*						$mid_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>
							";*/
							
	//列表
							$mid_pic.="<div>
							 <div class=\"col-lg-3 col-md-3 col-sm-3 col-xs-6 prolist1\" >
							<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 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>
				  <form action=\"/select.php\" method=\"post\">
					<input name=\"detail".$products_rows['ID']."\" type=\"button\" class='btn' value=\"Detail\" onclick=\"window.location.href='".$filenameprodetail."'\">  
					<input style=\"font-size:\" name=\"Order\" type=\"submit\" class='btn'  value=\"Quick Quote\" />
					<input name=\"proitemno\" type=\"hidden\" value=\"".$products_rows['productItemNo']."\" />
					<input name=\"proname\" type=\"hidden\" value=\"".$products_rows['productName']."\" />
					<input name=\"proshow\" type=\"hidden\" value=\"../images/".$products_rows['productPic']."\" />
					<input name='url' id='url' type='hidden' value='' />
					<script>document.getElementById('url').value=this.location.href;</script>
				</form>
					 </div>
				</div>
					";
						
				}
			}
			$mid_pic .= "";//echo $mid_pic;

				
			break;
	}
	$mid_pic .= "";//echo $mid_pic;
	
 
			
?>
