<?php

// 主菜单 PRIDUCTS 类链接页面，产品总页面 prolist.html（模板） templ_index 576 {ls_classpro},  老网站 是 {ls_pro}

	//类产品展示 Start
	$products_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 subcateName is null and subcateFolders is null and subcateBrief is null and subcateID is null and AdditionalAttributesClassPro&1 and enable=1";
	$products_sql.=" order by NoClassPro asc";
	$products_query=$opendb->query($products_sql);
	$classpro="";
	while($products_rows=mysqli_fetch_assoc($products_query)){
					
		if(hassameclass($products_rows['productID'])){
			continue;
		}
		
		$p_id = $products_rows['productID'];
		$sql2 = "select * from ls_products where ID = ".$p_id." ";
		$products_query2=$opendb->query($sql2);
		$products_rows2=mysqli_fetch_assoc($products_query2);
		
		$class_name = "";
		if($products_rows2['cateBrief'] != null){
			$class_name = $products_rows2['cateName'];
		}elseif($products_rows2['midcateBrief'] != null){
			$class_name = $products_rows2['midcateName'];
		}elseif($products_rows2['subcateBrief'] != null){
			$class_name = $products_rows2['subcateName'];
		}
		
		$pro_i++;
		$profile=getproductfolder($products_rows['productID']);
		$prosrc=$profile."/".$SmallFoldersProducts."/".$products_rows['productPic'];
	//$prolink=$profile."/".$showproductsFolders."/".trim(str_replace(substr($products_rows['productPic'],-4),"",$products_rows['productPic'])).".html"; 原来类产品链接
		$prolink=$profile."/index.html";//类分类的链接
		$classpro.="<li><a href=\"".$prolink."\" ><img src=\"".$prosrc."\" width=\"188\" height=\"188\" border=\"0\" alt=\"".$class_name."\" title=\"".$class_name."\"></a><span>".$class_name."</span></li>";
	}		
	$ls_pro=$classpro;

/*$prolistcatepic=$pro_pic_rows['cateFolders']."/".$pro_pic_rows['cateIconPic']."jpg"; //catePagePic是banner

if($prolistStytle=="cateIconPic") { $prolistpic=$prolistcatepic; } // 使用cateIconPic代表图，第一个产品链接

if($prolistStytle=="selectProducts") {$prolistpro=getpiclink($pro_pic_rows['ID'],"",""," and AdditionalAttributesClassPro=1 "); $prolistpic=$prolistpro['picsrc'];   } // 使用类代表图

if(!file_exists("../".$prolistpic) || $prolistpic=="" || substr($prolistpic,-1)=="/" ){ $prolistpic="images/noimage.jpg"; echo "<br/> ".$pro_pic_rows['cateName']." 本类别没有设值代表图，或者不存在。<br/>";}*/


//大类 图片相册

/*	$ls_pro .= "<div class=\"col-lg-3 col-md-4 col-sm-6 col-xs-12\"><div class=\"thumbnail\"><div class=\"img-pic\"><a href=\"".$pro_pic_rows['cateFolders']."/\">
<img src=\"".$_SESSION['dda'].$prolistpic."\" name=\"imgs\" alt=\"<translate>".$pro_pic_rows['midcateName']."</translate>\" /></a></div><div class=\"caption pro-name\">
<a href=\"".$pro_pic_rows['cateFolders']."/\"><translate>".$pro_pic_rows['cateName']."</translate></a></div></div></div>";
*/	

//大类 图片列表
/*	$ls_procatebrief=trim(substr(strip_tags(htmlspecialchars_decode($pro_pic_rows['cateBrief'])),0,$prolistbrieflen));

	$ls_pro.="<li>
	<a href=\"".$pro_pic_rows['cateFolders'].($oldcatepath?$pro_pic_rows['cateFolders'].".html":"")."\" alt=\"<translate>".$pro_pic_rows['cateName']."</translate>\" title=\"<translate>".$pro_pic_rows['cateName']."</translate>\" >
	<img src=\"".$_SESSION['dda'].$prolistpic."\" alt=\"<translate>".$pro_pic_rows['cateName']."</translate>\" title=\"<translate>".$pro_pic_rows['cateName']."</translate>\" width='240' /></a>
	<span>
	".$pro_pic_rows['cateName']."
	</span></li>

";*/
		
//大类名及大类产品相册，全部或类产品
/*
		if($catedetailStytle=="selectProducts") $addstr=" and AdditionalAttributesClassPro=1 "; else $addstr=" "; //类产品
				
		$ls_pro .= "<div style=\"float:left;width:100%\" >"; 
		$ls_pro .= "<div class=\"pro_list\"><h2 class=\"proName1\" ><a href=\"".$pro_pic_rows['cateFolders'].($oldcatepath?$pro_pic_rows['cateFolders'].".html":"")."\"><translate>".$pro_pic_rows['cateName']."</translate></a></h2></div>";		
		
		$catedetail_sql="SELECT * FROM `ls_products` WHERE `productID`=".$pro_pic_rows['ID'].$addstr."  order by Num ";
		$catedetail_query=$opendb->query($catedetail_sql);
		while($catedetail_rows=mysqli_fetch_assoc($catedetail_query)){
			$filenameprodetail=$catedetail_rows['filename']==""?clearFolder(strtolower(pathProName($catedetail_rows['productName'])))."-".$catedetail_rows['ID'].".html":$catedetail_rows['filename'];
			$prolistpro=getpiclink($pro_pic_rows['ID'],$catedetail_rows['productPic']," "); 
			$prolistpic=$prolistpro['picsrc']; 

			$ls_pro .= " 
			<div class=\"prodt\">
			<div class=\"proimg\">
			<a class=\"prog\" href=\"".$pro_pic_rows['cateFolders']."/".$filenameprodetail."\">
			<img src=\"".$_SESSION['dda'].$prolistpic."\" name=\"imgs\" alt=\"<translate>".$catedetail_rows['productName']."</translate>\" title=\"<translate>".$catedetail_rows['productName']."</translate>\" /></a>
			</div>
<div class=\" prowenzi\" >
  <span class=\"ns\">
			<div class=\"mingzi\"><a href=\"".$pro_pic_rows['cateFolders']."/".$filenameprodetail."\"><translate>".$catedetail_rows['productName']."</translate></a>
			</div>
			</span></div>
 
 </div> 
			";
		}
		$ls_pro .= "</div>"; 		
*/		
?>
