<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<?php
/* 上一页的搜索变量的变量名必须是 keywords
*/
require_once('ls_admin/inc/conn.php');
require_once('ls_admin/inc/constant.php');
require_once('ls_admin/inc/ls_syscode.php');
require_once('ls_admin/inc/public.php'); //main menu & left menu
$opendb=new mydb();
require_once('ls_admin/inc/char_set.php');

$ls=$_GET['ls'];
$id=$_GET['id'];
$searchproductName=addslashes($_POST['keywords']);
if($_GET['search']!=''){$searchproductName=$_GET['search'];}
//$productid=$search;
$cateid=$_GET['cateid'];
$catename=$_GET['catename'];
$midcateid=$_GET['midcateid'];
$midcatename=$_GET['midcatename'];
$subcateid=$_GET['subcateid'];
$subcatename=$_GET['subcatename'];
$brief=$_GET['brief'];



$searchItem=$_POST['searchItem'];
if($searchItem!="" && $searchItem!="productName"&&$keywords!="")
{
	     
	$select_sql2="select * from ls_prospec where specName = '".$searchItem."' and specValue='".$keywords."' ";
	$select_query2=$opendb->query($select_sql2);
	$select_rows2=mysql_num_rows($select_query2); //总产品数
	if($select_rows2!=0)
	{
		$prospec_row=mysql_fetch_assoc($select_query2); //循环处理变量处理 变量名
		$getProductID=$prospec_row['productID'];  //产品ID
		//echo 	$getProductID."nn";
	
		$select_sql2="select * from ls_products where ID = '".$getProductID."' ";
		$select_query2=$opendb->query($select_sql2);
		$prospec_row=mysql_fetch_assoc($select_query2); //循环处理变量处理 变量名
		$propiclink=getpiclink($prospec_row['productID'],$prospec_row['productPic']);
		header("Location:".$propiclink['piclink']);

	}
}
//echo $_POST['searchItem']."ww".$keywords."--".$searchproductName."==".$searchItem;
?>
<html xmlns="http://www.w3.org/1999/xhtml"><!-- InstanceBegin template="/Templates/all_ru.dwt" codeOutsideHTMLIsLocked="false" -->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- InstanceBeginEditable name="doctitle" -->
<title>HEBEI XIAOPENG HOISTING EQUIPMENT FACTORY</title>
<!-- InstanceEndEditable -->
<meta name="keywords" content="HEBEI XIAOPENG HOISTING EQUIPMENT FACTORY" />
<meta name="description" content="HEBEI XIAOPENG HOISTING EQUIPMENT FACTORY" />
<link href="css/index.css" rel="stylesheet" type="text/css" />
<link href="css/all.css" rel="stylesheet" type="text/css" />
<link rel="stylesheet" type="text/css" href="css/lrtk.css" />
<script type="text/javascript" src="js/jquery.js"></script>
<script type="text/javascript" src="js/lihe.js"></script>
<!-- InstanceBeginEditable name="head" -->
<!-- InstanceEndEditable -->
</head>
<body>
<div id="head">
	<div id="header">
    <div id="top">
      <div id="top1">
        <div id="top1_l">
          <div id="tl1">
            <table width="366" border="0">
              <tr>
                <td width="38"><img src="images/gg.jpg" width="38" height="37" /></td>
                <td width="318">Добро пожаловать в <a href="index.html" style="color:#FFF">HEBEI XIAOPENG</a> !</td>
              </tr>
            </table>
          </div>
          <div id="tl2">
            <FORM name="search" method="post" action="search.php" >
              <input type="text" id="searchbox" size="35" height="25" value="" name="keywords"
  onfocus="if (this.value==this.defaultValue) this.value=''; else this.select()"
  onblur="if (!this.value) this.value=this.defaultValue" />
              <script type="text/javascript">
				document.getElementById('searchbox').defaultValue = ' Поиск ключевых слов продукта...';
				document.getElementById('searchbox').value = ' Поиск ключевых слов продукта...';
            </script>
              <input class="sear"border="0" value="&nbsp;&nbsp;" type="submit" name="Submit" />
            </FORM>
          </div>
        </div>
        <div id="top1_r">
          <table width="380" border="0" align="right">
            <tr>
              <td height="41" align="right">
              <table width="100%" border="0">
  <tr>
  	<td><a href="http://www.hoistcn.com/index.html" style="color:#FFF;"><img src="images/en.jpg" /></a></td>
    <td><a href="http://www.hoistcn.com/index.html" style="color:#FFF;">English</a></td>
    <td><a href="http://www.hoistcn.com/ru/index.html" style="color:#FFF;"><img src="images/ru.jpg" /></a></td>
    <td><a href="http://www.hoistcn.com/ru/index.html" style="color:#FFF;">русский</a></td>
    <td><a href="http://www.hoistcn.com/pt/index.html" style="color:#FFF;"><img src="images/pt.jpg" /></a></td>
    <td><a href="http://www.hoistcn.com/pt/index.html" style="color:#FFF;">Português</a></td>
    <td><div class='social'>
	<ul>
		<li><a href='https://www.facebook.com/ktxfactory/' target="_blank" ><img src='ls_admin/images/social_ico/facebook.jpg' width='24' title='Follow on Facebook'/></a></li>
		<li><a href='https://twitter.com/KtxTianqin' target="_blank" ><img src='ls_admin/images/social_ico/twitter.jpg'  width='24' title='Twitter'/></a></li>
		<li><a href='http://www.linkedin.com/in/霄鹏-河北-120b83121?trk=nav_responsive_tab_profile_pic' target="_blank" ><img src='ls_admin/images/social_ico/linkedin.jpg'  width='24' title='Follow on LinkedIn'/></a></li>
		<li><a href='' target="_blank" ><img src='ls_admin/images/social_ico/google+.jpg'  width='24' title='Follow on Google'/></a></li>
	</ul>
	</div></td>
  </tr>
</table>
              </td>
            </tr>
            <tr>
              <td height="46" style="color:#ffe504" align="right">Электронная почта: <strong style="font-size:24px; font-family:Impact;"><a href="mailto:admin@hoistcn.com">admin@hoistcn.com</a></strong></td>
            </tr>
          </table>
        </div>
      </div>
      <div id="nav">
        <ul>
          <!-- InstanceBeginEditable name="nav" -->
          <li class="navli"><a href="index.html">Домой</a></li>
          <li><a href="aboutus.html">О нас</a></li>
          <li class="navli" id="nav1"><a href="cd1-electric-wire-rope-hoist/cd1-electric-wire-rope-hoist.html">Продукция</a></li>
          <li id="nav2"><a href="workshop.html">Производство</a></li>
          <li><a href="feedback.html">Обратная связь</a></li>
          <li><a href="contact.html">Контакты</a></li>
          <!-- InstanceEndEditable -->
        </ul>
      </div>
    </div>
  </div>
</div>
<div id="ny_banner"></div>
<div id="ny_main">
  <div id="ny_main1">
    <div id="ny_left">
      <div id="nyp_tit">Каталог</div>
      <div id="nyp_con"> <ul class="sub-menu"><li> <a href='cd1-electric-wire-rope-hoist/cd1-electric-wire-rope-hoist.html'>Канатные электротельферы CD1</a></li><li> <a href='md1-electric-wire-rope-hoist/md1-electric-wire-rope-hoist.html'>Канатные электротельферы MD1</a></li><li> <a href='owheadroomelectrichoist/owheadroomelectrichoist.html'>Электротельфер для низких помещений  CDL/MDL</a></li><li> <a href='h-sd-electric-wire-rope-hoist/h-sd-electric-wire-rope-hoist.html'>Канатные электротельферы H-SD</a></li><li> <a href='european-electric-wire-rope-hoist/european-electric-wire-rope-hoist.html'>Европейский Электрический электротельфер веревки провода</a></li></ul>
  </div>
      <div id="ny_gg"><img src="images/ny_gg.jpg" width="320" height="503" /></div>
      <div id="nyc_tit">Контакты</div>
      <div id="nyc_con">
        <table width="100%" border="0">
          <tr>
            <td width="10%" valign="top" style="padding-top:8px;"><img src="images/con1.jpg" width="20" height="22" /></td>
            <td width="90%">Китай, провинция Хэбэй, город Хэншуи, зона развития Тхаочхэн</td>
          </tr>
          <tr>
            <td><img src="images/con2.jpg" width="20" height="22" /></td>
            <td> +86-318-5111881<br /></td>
          </tr>
          <tr>
            <td><img src="images/con3.jpg" width="20" height="22" /></td>
            <td> +86-318-5111551<br /></td>
          </tr>
          <tr>
            <td valign="top"><img src="images/con4.jpg" width="20" height="22" /></td>
            <td><a href="mailto:admin@hoistcn.com">admin@hoistcn.com</a> <br />
              <a href="mailto:ktxfactory@163.com">ktxfactory@163.com</a></td>
          </tr>
        </table>
      </div>
    </div>
    <div id="ny_right"><!-- InstanceBeginEditable name="all" -->
      
<div id="ny_tit"><span><a href="index.html">Домой</a> -&gt; <a href="#">поиск</a></span>Продукция</div>
<div id="ny_con">
<h2 class="proName" align="center"><?=$searchproductName?> </h2>
				 <?php 
				if( isset($_GET['page']) ){
					   $page = intval( $_GET['page'] );
					}
					else{
					   $page = 1;
					}
					// 
					$PageSize = $PageNum;
					
					// 
					/********************************************************************************/
						$sql="select * from ls_products where midcateName is null and cateName is null and cateFolders is null and cateTitle is null and cateKeywords is null and cateDescription 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 ";
						$products_sql="";
													//
						if($cateid!="" && $midcateid=="" && $subcateid=="")
						{
							//大类下有中类
							$displaycatename=$catename;
							$sqlstr1="select ID from ls_products where midcateID =".$cateid." ";
							$query1=$opendb->query($sqlstr1);
							$mynum1=mysql_num_rows($query1);
							if($mynum1!=0)//有中类
							{
								$i=1;
								while($myrows1=mysql_fetch_assoc($query1))
								{
									$sqlstr2="select ID from ls_products where subcateID =".$myrows1['ID']." ";
									$query2=$opendb->query($sqlstr2);
									$mynum2=mysql_num_rows($query2);
									if($mynum2!=0) //有小类
									{
										while($myrows2=mysql_fetch_assoc($query2))
										{
												if($i==1)
												{
													$productID.=" productID=".$myrows2['ID'];
												}
												else
												{
													$productID.=" or productID=".$myrows2['ID'];
												}
												$i++;
										}
									}
									else //没有小类
									{
										if($i==1)
										{
											$productID.=" productID=".$myrows1['ID'];
										}
										else
										{
											$productID.=" or productID=".$myrows1['ID'];
										}
										$i++;
									}
								}
								$products_sql.=" and ".$productID;
				
							}
							else
							{
								$products_sql.=" and productID=".$cateid;
								
							}
						}
				
						
						//中类
							if($cateid!="" && $midcateid!="" && $subcateid=="")
							{
							//中类下有小类
							$displaycatename=$midcatename;
							$sqlstr="select ID from ls_products where subcateID =".$midcateid." ";
							$query1=$opendb->query($sqlstr);
							$mynum=mysql_num_rows($query1);
							if($mynum!=0)
							{
								$i=1;
								while($myrows=mysql_fetch_assoc($query1))
								{
									if($i==1)
									{
										$productID.=" productID=".$myrows['ID'];
									}
									else
									{
										$productID.=" or productID=".$myrows['ID'];
									}
									$i++;
								}
								//	echo $productID."<br>";
								$products_sql.=" and ".$productID;
							}
							else
							{//中类下没有小类
								$products_sql.=" and productID=".$midcateid;
							}
						}
													
				
													
							//小类
							if($cateid!="" && $midcateid!=""&& $subcateid!="")
							{
								$displaycatename=$subcatename;
								$products_sql.=" and productID=".$subcateid;
								
							}
							//echo 	$products_sql;
							if($_GET['keywords']!='') {
									$keywords=$_GET['keywords'];
									$searchproductName=$_GET['keywords'];
								}
														
							if($searchproductName!="")
							{
								$products_sql.=" and (productName like '%".$searchproductName."%' or productItemNo like '%".$searchproductName."%') ";
							}
							if($productid!="" && $productid!="allПродукция")
							{
								$products_sql.=" and productID=".$productid."";
							}
							if($showOn==1)
							{
								$products_sql.=" and (showOn=2  or showOn=1) ";
							}
							if($showOn==2)
							{
								$products_sql.=" and showOn=2 ";
							}
							$products_sql.=" order by Num asc ";	
				
							$sql.=$products_sql;
				
													
							//echo "products sql".$sql."<br>";
							//$sql = "select * from ls_products where cateName is null and cateFolders is null and cateTitle is null and cateKeywords is null and cateDescription 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 order by Num desc";
							
							$result=$opendb->query($sql);
					
							/********************************************************************************/
							// ȡ
							
							$row = mysql_num_rows($result);
							$amount = $row;
							// ܹжҳ
							if( $amount )
							{
							   if( $amount < $PageSize ){ $page_count = 1; }               //С$PageSizeôֻһҳ
							   if( $amount % $PageSize )
							   {                                  //ȡÿҳ
								   $page_count = (int)($amount / $PageSize) + 1;           //ҳÿҳĽȡټһ
							   }else
							   {
								   $page_count = $amount / $PageSize;                      //ûҳÿҳĽ
							   }
							}
							else
							{
							   $page_count = 0;
							}
							
							$page_string = '';
							$pagecatestr="subcateid=".$subcateid."&midcateid=".$midcateid."&cateid=".$cateid."&keywords=".urlencode($keywords)."&catename=".urlencode($catename)."&midcatename=".urlencode($midcatename)."&subcatename=".urlencode($subcatename)."&showOn=".$showOn."&search=".urlencode($searchproductName);
								
							if( $page == 1 )
							{
							   $page_string .= 'First | Previous |';
							}
							else
							{
							   $page_string .= '<a href=?page=1&'.$pagecatestr.'><u><font color=\"#0000FF\">First</font></u></a> | <a href=?page='.($page-1).'&'.$pagecatestr.'><u><font color=\"#0000FF\">Previous</font></u></a> | ';
							}
							if( ($page == $page_count) || ($page_count == 0) )
							{
							   $page_string .= ' Next | End';
							}
							else
							{
							   $page_string .= ' <a href=?page='.($page+1).'&'.$pagecatestr.'><u><font color=\"#0000FF\">Next</font></u></a> | <a href=?page='.$page_count.'&'.$pagecatestr.'><u><font color=\"#0000FF\">End</font></u></a>';
							}
								 $page_string .= " &nbsp;&nbsp;<font color='#FF0000'><b>".$page."</b></font>/<b>".$page_count."</b> page";
								 $page_string .= " &nbsp;&nbsp; <b>".$PageSize."</b> / page &nbsp;&nbsp;total <b>".$amount."</b> ";
							
							
								 
								/*\***************************************************************************\*/
								/*\								ѯݿ					\*/
								/*\***************************************************************************\*/ 
				
						
							$products_sql=$sql." limit ". ($page-1)*$PageSize .",".$PageSize." ";	
				
							//echo "products sql".$products_sql."<br>"; exit;
							$products_query=$opendb->query($products_sql);
								/*\***************************************************************************\*/
								/*\								ѯݿ					\*/
								/*\***************************************************************************\*/ 
							if($displaycatename!="")
							{echo "<div class=\"cateName\">".$displaycatename."</div>";}
					
							if($brief!="")
							{echo "<div id=\"brief\">"."<b>Brief: </b>".$brief."</div>";}
								
							?>
                            <ul class="pro_list" style="float:left;">
                            <?
							$i=1;
							if($amount==0){ echo "No products found.";}
							while($products_rows=mysql_fetch_assoc($products_query))
							 {
								
								?>
                                 <li>
									
                                 <?
								
								$pic_sql="select * from ls_products where ID=".$products_rows['productID']."";
								$pic_query=$opendb->query($pic_sql);
								$pic_myrows=mysql_fetch_assoc($pic_query);
				
				
								if($pic_myrows['subcateFolders']=="")
								{
									if($pic_myrows['midcateFolders']=="") //产品在大类下
									{
										$picsrc=$pic_myrows['cateFolders']."/".$SmallFoldersПродукция."/".$products_rows['productPic'];
										$piclink=$pic_myrows['cateFolders']."/".$showproductsFolders."/".$pic_myrows['cateFolders']."-".pathProName($products_rows['productName'])."-".$products_rows['ID'].".html";
									}
									else//产品在中类下
									{
										$pic_sql="select * from ls_products where ID=".$pic_myrows['midcateID']."";
										$pic_query=$opendb->query($pic_sql);
										$pic_myrows2=mysql_fetch_assoc($pic_query);
				
										$picsrc=$pic_myrows2['cateFolders']."/".$pic_myrows['midcateFolders']."/".$SmallFoldersПродукция."/".$products_rows['productPic'];
										$piclink=$pic_myrows2['cateFolders']."/".$pic_myrows['midcateFolders']."/".$showproductsFolders."/".$pic_myrows['midcateFolders']."-".pathProName($products_rows['productName'])."-".$products_rows['ID'].".html";
									}
								}
								else//产品在小类下
								{
										$pic_sql="select * from ls_products where ID=".$pic_myrows['subcateID']."";
										$pic_query=$opendb->query($pic_sql);
										$pic_myrows2=mysql_fetch_assoc($pic_query);
				
										$pic_sql="select * from ls_products where ID=".$pic_myrows2['midcateID']."";
										$pic_query=$opendb->query($pic_sql);
										$pic_myrows3=mysql_fetch_assoc($pic_query);
										
										$picsrc=$pic_myrows3['cateFolders']."/".$pic_myrows2['midcateFolders']."/".$pic_myrows['subcateFolders']."/".$SmallFoldersПродукция."/".$products_rows['productPic'];
										$piclink=$pic_myrows3['cateFolders']."/".$pic_myrows2['midcateFolders']."/".$pic_myrows['subcateFolders']."/".$showproductsFolders."/".$pic_myrows['subcateFolders']."-".pathProName($products_rows['productName'])."-".$products_rows['ID'].".html";
								}
								?>
									
										<a href="<?=$piclink?>"><img src='<?=trim($picsrc)?>' border=0 alt='<?=$products_rows['productName']?>'></a>
								    
																	
									<?=substr($products_rows['productItemNo'],0,40)?>
									
								
								 </li>
                                <? $i++; }?>
							</ul>
							<br/><div align="center"  style="width:inherit; float:left;  padding-top:26px; padding-bottom:26px; font-size: 12px; width:100%; "><?=($amount<=$PageSize?"":$page_string)?>
						</div>
</div>
      <!-- InstanceEndEditable --> </div>
  </div>
</div>
<div id="main4">
  <div id="bottom">
    <div id="bottom1">
      <div id="bottom2">
        <div id="bottom2_tit">Каталог</div>
        <div id="bottom2_con"> <ul class="sub-menu"><li> <a href='cd1-electric-wire-rope-hoist/cd1-electric-wire-rope-hoist.html'>Канатные электротельферы CD1</a></li><li> <a href='md1-electric-wire-rope-hoist/md1-electric-wire-rope-hoist.html'>Канатные электротельферы MD1</a></li><li> <a href='owheadroomelectrichoist/owheadroomelectrichoist.html'>Электротельфер для низких помещений  CDL/MDL</a></li><li> <a href='h-sd-electric-wire-rope-hoist/h-sd-electric-wire-rope-hoist.html'>Канатные электротельферы H-SD</a></li><li> <a href='european-electric-wire-rope-hoist/european-electric-wire-rope-hoist.html'>Европейский Электрический электротельфер веревки провода</a></li></ul>
  </div>
      </div>
      <div id="bottom3">
        <div id="bottom3_tit">Контакты</div>
        <div id="bottom3_con"> HEBEI XIAOPENG HOISTING EQUIPMENT FACTORY<br />
          Адрес: Китай, провинция Хэбэй, город Хэншуи, зона развития Тхаочхэн.<br />
          ТЕЛ: +86-318-5111881<br />
          ФАКС: +86-318-5111551<br />
          Электронная почта: <a href="mailto:admin@hoistcn.com">admin@hoistcn.com</a> <a href="mailto:ktxfactory@163.com">ktxfactory@163.com</a><br />
          Индекс: 053000</div>
      </div>
      <div id="bottom4">
        <div id="bottom4_tit">QR - код</div>
        <div id="bottom4_con">
          <p><img src="images/ewm.png" width="180" height="180" /></p>
          <p><div class='social'>
	<ul>
		<li><a href='https://www.facebook.com/ktxfactory/' target="_blank" ><img src='ls_admin/images/social_ico/facebook.jpg' width='24' title='Follow on Facebook'/></a></li>
		<li><a href='https://twitter.com/KtxTianqin' target="_blank" ><img src='ls_admin/images/social_ico/twitter.jpg'  width='24' title='Twitter'/></a></li>
		<li><a href='http://www.linkedin.com/in/霄鹏-河北-120b83121?trk=nav_responsive_tab_profile_pic' target="_blank" ><img src='ls_admin/images/social_ico/linkedin.jpg'  width='24' title='Follow on LinkedIn'/></a></li>
		<li><a href='' target="_blank" ><img src='ls_admin/images/social_ico/google+.jpg'  width='24' title='Follow on Google'/></a></li>
	</ul>
	</div></p>
        </div>
      </div>
    </div>
    <div id="banquan">&copy; 2016 <a href="index.html">HEBEI XIAOPENG HOISTING EQUIPMENT FACTORY</a> | All Rights Reserved.</div>
  </div>
</div>
<div class="side_nav">
  <ul>
    <li class="tel"> <a href="mailto:admin@hoistcn.com" title="admin@hoistcn.com"> <span>Электронная&nbsp;почта</span> </a> </li>
    <li class="QQ"> <a href="skype:ktxhoistcn@126.com?chat" title="ktxhoistcn@126.com"> <span>Online</span> </a> </li>
    <li class="sub_QR"> <a href="javascript:;"> <span><img src="../images/ewm.png" width="148" /></span> </a> </li>
    <li class="back_top"> <a href="#" title="Top"> <span>сверху</span> </a> </li>
  </ul>
  <div class="c"></div>
</div>
</body>
<!-- InstanceEnd --></html>
