<?php 
//_home_pro.php 首页产品列表 temp_index.php 517 {ls_homepro} 

$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 AdditionalAttributes&1 and enable=1";
	$products_sql.=" order by Num asc ";
	$products_query=$opendb->query($products_sql);
	$homepro="";
	$count=1;
	while($products_rows=mysqli_fetch_assoc($products_query)){
		if(hassameclass($products_rows['productID'])){
			continue;
		}
		$pro_i++;
		$profile=getproductfolder($products_rows['productID']);
		$prosrc=$profile."/".$SmallFoldersProducts."/".$products_rows['productPic'];
		$prolink=$profile."/index.html";
		
		$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);
		
		$p_c_name = "";
		$brief = "";
		if($products_rows2['cateBrief'] != null){
			$p_c_name = $products_rows2['cateName'];
			$brief = $products_rows2['cateBrief'];
		}elseif($products_rows2['midcateBrief'] != null){
			$p_c_name = $products_rows2['midcateName'];
			$brief = $products_rows2['midcateBrief'];
		}elseif($products_rows2['subcateBrief'] != null){
			$p_c_name = $products_rows2['subcateName'];
			$brief = $products_rows2['subcateBrief'];
		}
		
		$homepro.="<li class=\"p_bg\"><a href=\"".$prolink."\" target=\"_blank\"><img src=\"".$prosrc."\" width=\"127\" height=\"124\" border=\"0\" alt=\"".$products_rows['productName']."\" title=\"".$products_rows['productName']."\"></a><div class=\"cate_p\"><div class=\"cateName\">".$p_c_name."</div><div class=\"productsCate\">".substr($brief,0,225)."..."."</div></div></li>";
		$count++;
	}
	//首页产品展示 End
	
/*	  $prosrc=$profile."/".$SmallFoldersProducts."/".$products_rows['productPic'];
	  $picsrc= $products_rows['wholepathpic']; //7-15
      $prosrc= $picsrc!=NULL?$picsrc:$prosrc; 
	  
	  $prolink=$profile."/".$showproductsFolders."/".trim(str_replace(substr($products_rows['productPic'],-4),"",$products_rows['productPic'])).".html"; //没用
	  $showpro1=$products_rows['productName']; $showpro2=$products_rows['productItemNo'];
	  $showpro3=$showpro1."  ".$showpro2;
	  $showpro= $pronameno==1? $showpro1:($pronameno==2? $showpro2:$showpro3);
	  if($showpro1==$showpro2){$showpro=$showpro1;$showpro3=$showpro1;}
	  $filename=$products_rows['filename']==""?clearFolder(strtolower(pathProName($products_rows['productName'])))."-".$products_rows['ID'].".html":$products_rows['filename']; //21-7-28
	  $homehref = $profile."/".$filename; //21-7-28
	  
	  switch($homehrefStytle){
		  case "prohref":
			  break;
		  
		  case "classhref":
			  $homehref = $profile."/".getproductpath($products_rows['productID']).".html";
		  break;
	  }
	  
	//$homehref=mb_substr($homehref,0,strrpos($homehref,"-") ).".html"; //大类链接?1
	//$homecate=substr($homehref,0,strrpos($homehref,"/"));
	//$homehref=$homecate; //大类链接2

//格式1：图上标题下

	$homepro.="
	<li class=\"p_bg\">
			<a href=\"".$homehref."\"><img src=\"".$_SESSION['dda'].$prosrc."\" width=\"127\" height=\"124\" alt=\"".$showpro3."\" title=\"".$showpro3."\"/></a>
	   <div class=\"cate_p\">
			<div class=\"cateName\"> <translate>".$showpro."</translate></div>
			<div class=\"productsCate\"><p><translate>".mb_substr(strip_tags($products_rows['productSpecification']),0,500, 'utf-8')."... </translate></p></div>
         </li>
		";
 */

//格式2：4列，图上文下和图下文上交错排列

/*	$homepro.= "<div class=\"col-lg-3 col-md-4 col-sm-6 col-xs-12 a1\">";
	$homepro.= $count%2 ? "
	    		<div class=\"HQ\"> 
			<a href=\"".$homehref."\"><img src=\"".$_SESSION['dda'].$prosrc."\"  alt=\"".$showpro3."\" title=\"".$showpro3."\"/></a>
				<span class=\"HQcenter\"> <a href=\"".$homehref."\"  title=\"".$showpro3."\"><translate>".$showpro."</translate></a></span>
				<span class=\"HQcenter2\"> ".mb_substr(strip_tags($products_rows['productSpecification']),0,500, 'utf-8')."</span>
				<div class=\"HQcenter3\" > <a href=\"".$homehref."\"  title=\"".$showpro3."\"> More </a></div>
			</div> "
			:
			"
			<div class=\"HQ\"> 
			<span class=\"HQcenter\"> <a href=\"".$homehref."\"  title=\"".$showpro3."\"><translate>".$showpro."</translate></a></span>
			<span class=\"HQcenter2\"> ".mb_substr(strip_tags($products_rows['productSpecification']),0,500, 'utf-8')."</span>
			<div class=\"HQcenter3\" > <a href=\"".$homehref."\"  title=\"".$showpro3."\"> More </a></div>
			<a href=\"".$homehref."\"><img src=\"".$_SESSION['dda'].$prosrc."\"  alt=\"".$showpro3."\" title=\"".$showpro3."\"/></a>
				
			</div>";
		$homepro.= "	
         </div>
		";
*/
?>

 
            
            
            