<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<?php
	require_once('../ls_admin/inc/conn.php');
	require_once('../ls_admin/inc/constant.php');
	$opendb = new mydb();
	require_once('../ls_admin/inc/ls_syscode.php');
	$uploadfilesPath="ls_admin/";
	//echo "---友情链接". $pro_link['友情链接']."---机构名片". $pro_link['机构名片'];
	require('../ls_admin/inc/char_set.php');
	
	if($_POST['keywords'] != NULL){
		$searchproductName=addslashes($_POST['keywords']);
	}else{
		$searchproductName=addslashes($_GET['keywords']);
	}
	
	
	// 获取当前页数
	if(isset($_GET['page']) ){
	   $page = intval( $_GET['page'] );
	}
	else{
	   $page = 1;
	}
	
	// 获取当前文章页数
	if(isset($_GET['page2']) ){
	   $page2 = intval( $_GET['page2'] );
	}
	else{
	   $page2 = 1;
	}

?>
<html xmlns="http://www.w3.org/1999/xhtml"><!-- InstanceBegin template="/Templates/mall.dwt" codeOutsideHTMLIsLocked="false" -->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<!-- InstanceBeginEditable name="doctitle" -->
<title>{ls_title}</title>
<!-- InstanceEndEditable -->
<meta name="Keywords" content="{ls_keywords}" />
<meta name="Description" content="{ls_description}" />
<link rel="stylesheet" href="../bootstrap/css/bootstrap.min.css">
<!--[if lt IE 9]>
      <script src="bootstrap/js/html5shiv.min.js"></script>
      <script src="bootstrap/js/respond.min.js"></script>
    <![endif]-->
<link rel="stylesheet" type="text/css" href="../css/index.css"/>
<link rel="stylesheet" type="text/css" href="../css/banner.css"/>
<script src="../bootstrap/js/jquery.js"></script>
<script src="../bootstrap/js/bootstrap.min.js" type="text/javascript"></script>
<script type="text/javascript" src="../js/scroll.js"></script>
<script type="text/javascript" src="../js/gundong.js"></script>
<script type="text/javascript" src="../js/jquery2.js"></script>
<!-- InstanceBeginEditable name="head" -->
<!-- InstanceEndEditable -->
</head>

<body>

<div class="top">
<div class="container">
<div class="welcom">Welcome to Shijiazhuang Baisheng Chemical Co., Ltd</div>
<p class="navbar-text navbar-right" id="languages"> <img src="../images/language.jpg" usemap="#Map"/>
      <map name="Map" id="Map">
        <area shape="rect" coords="1,1,36,22" href="../cn" />
        <area shape="rect" coords="45,0,79,22" href="http://translate.google.com/translate?hl=&sl=en&tl=fr&u=http://www.sjzbshg.com" />
        <area shape="rect" coords="84,-6,120,22" href="http://translate.google.com/translate?hl=&sl=en&tl=ru&u=http://www.sjzbshg.com" />
        <area shape="rect" coords="124,0,159,22" href="http://translate.google.com/translate?hl=&sl=en&tl=es&u=http://www.sjzbshg.com" />
        <area shape="rect" coords="167,-3,205,22" href="http://translate.google.com/translate?hl=&sl=en&tl=pt&u=http://www.sjzbshg.com" />
        <area shape="rect" coords="210,-2,260,22" href="http://translate.google.com/translate?hl=&sl=en&tl=it&u=http://www.sjzbshg.com" />
        <area shape="rect" coords="253,-1,315,22" href="http://translate.google.com/translate?hl=&sl=en&tl=it&u=http://www.sjzbshg.com" />
      </map>
  </p>
</div>
</div>
<div class="header">
<div class="container">
	<div class="logo">
    	<a href="../index.html"><img src="../images/logo_07.jpg"></a>
            <button type="button" class="navbar-toggle m-toggle" data-toggle="collapse" data-target="#navbar-collapse"> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button>
    </div>


       	 <div class="navbar-lg">
    <div class="container nav-padding">
      <div class="collapse navbar-collapse" id="navbar-collapse">
       <ul class="nav navbar-nav nav-ul">
          <li class="active"><a href="../index.html" class="orange">Home</a></li>
          <li><a href="../aboutus.html" class="green">About Us</a></li>
          <li class="dropdown"><a href="../{ls_addprolink}" class="dropdown-toggle blue" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">Products <span class="caret"></span></a>
          	{ls_s_cate}
          </li>
          <li class="dropdown"><a href="javascript:void(0)" class="dropdown-toggle blue" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">News</a>
                <ul class="protit dropdown-menu">
                    <li><a href='../newsnews.html'>Company News</a></li>
                    <li><a href='../newsindustry.html'>Industry News</a></li>
                </ul>
            </li>
          <li><a href="../workshop.html">Workshop</a></li>
          <li><a href="../certificate.html"> C&amp;Q </a></li>
          <li><a href="../download.html">Download</a></li>
          <li><a href="../contact.html">Contact Us</a></li>
        </ul>
        <form name="search" method="post" action="../search.php" class="navbar-left search">
      <div class="input-group" style="width:100%;">
        <input type="text" name="keywords" class="form-control search-inp" placeholder="Enter your keywords"/>
        <div class="input-group-btn">
          <button class="btn btn-default search-btn"><span class="glyphicon glyphicon-search"></span></button>
        </div>
      </div>
      </form>
      </div>
    </div>
  </div>
</div>
</div>

 
  <!--banner轮播开始-->
  <div id="slideBox" class="slideBox ">
    <div class="hd">
      <ul>
        <li class="on"></li>
        <li class=""></li>
        <li class=""></li>
      </ul>
    </div>
    <div class="bd">
      <ul>
        <li style="display:list-item;"><a href="../{ls_addprolink}"><img src="../images/banner3.jpg"></a> </li>
        <li style="display:list-item;"><a href="../{ls_addprolink}"><img src="../images/banner2.jpg"></a> </li>
        <li style="display:none;"><a href="../{ls_addprolink}"><img src="../images/sea.jpg"></a></li>
      </ul>
    </div>
    <!-- 下面是前/后按钮代码，如果不需要删除即可 -->
    <a class="prev" href="javascript:void(0)"></a> <a class="next" href="javascript:void(0)"></a> </div>
  <script type="text/javascript">
		jQuery(".slideBox").slide({mainCell:".bd ul",autoPlay:true});
		</script>
  <!--banner轮播结束-->
  <!-- InstanceBeginEditable name="EditRegion3" -->
<div id="information2">
	<div class="container">
		<div class="row">
			<div class="col-xs-3 info-right hidden-xs hidden-sm">
           	  <div class="side-title">
                    <blockquote>
                        <h3>Products List</h3>
                    </blockquote>
              </div>
                <div class="side-pro-list">
                	{ls_p_cate}
                </div>
			</div>
            <div class="col-xs-12 col-lg-9 col-md-9 col-sm-12">
				<div class="container-fluid">
					<h3 class="title-h3">
                    	<ol class="breadcrumb all-breadcrumb">
                        	<li><a href="../index.html">Home</a></li>
                            <li>Search</li>
                        </ol>
                        <b>Search</b>
                    </h3>
					<div class="all-content">
          <h3 class="proName " align="center" style="padding:10px 0px">About &quot;<font color="#006600"><?=$searchproductName?></font>&quot;  search results</h3>
            <?php 
    if( isset($_GET['page']) ){
           $page = intval( $_GET['page'] );
        }
        else{
           $page = 1;
        }
        // 
        $PageSize = 6;
        
        // 
        /********************************************************************************/
            $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 ";
			require('ls_admin/inc/char_set.php');
            $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!="allProducts")
                {
                    $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;
	
	//文章统计
	$PageSize2 = 10;
	$newssql = "SELECT * FROM ls_news WHERE newsTitle LIKE  '%".$searchproductName."%' or newsText LIKE  '%".$searchproductName."%'";
	$news_sql = "SELECT * FROM ls_news WHERE newsTitle LIKE  '%".$searchproductName."%' or newsText LIKE  '%".$searchproductName."%' order by Num  DESC limit ". ($page2-1)*$PageSize2 .",".$PageSize2." ";

    $news_query=$opendb->query($news_sql);
	$result2=$opendb->query($newssql);
    $row2 = mysql_num_rows($result2);

?>
            <div class="search-title">Total station search results: Product
              <?=$amount?>, Article
              <?=$row2?>.</div>
            <?php

                $page_string = getSearchPages($amount, $page, $page2, $PageSize, $searchproductName, "pro");
                    /*\***************************************************************************\*/
                    /*\								ѯݿ					\*/
                    /*\***************************************************************************\*/ 

                $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>";}
                    
                ?>
            <div class="row pro_list">
              <?
                $i=1;
                if($amount==0){ 
					//echo "没有找到相关的产品信息！";
				}
                while($products_rows=mysql_fetch_assoc($products_query))
                 {
                    
                    ?>
              <div class="col-lg-4 col-md-4 col-sm-6 col-xs-12">
                    <div class="thumbnail">
                      <div class="img-pic">
                <?
                    
                    $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']."/".$SmallFoldersProducts."/".$products_rows['productPic'];
                            /*$piclink=$pic_myrows['cateFolders']."/".$showproductsFolders."/".$showproductsFolders."/".$pic_myrows['cateFolders']."-".pathProName($products_rows['productName'])."-".$products_rows['ID'].".html";*/
						$piclink=$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']."/".$SmallFoldersProducts."/".$products_rows['productPic'];
                           /* $piclink=$pic_myrows2['cateFolders']."/".$pic_myrows['midcateFolders']."/".$showproductsFolders."/".$pic_myrows['midcateFolders']."-".pathProName($products_rows['productName'])."-".$products_rows['ID'].".html";*/
						   $piclink=$pic_myrows2['cateFolders']."/".$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']."/".$SmallFoldersProducts."/".$products_rows['productPic'];
							
                            $piclink=$pic_myrows3['cateFolders']."/".$pic_myrows2['midcateFolders']."/".$showproductsFolders."/".$pic_myrows['subcateFolders']."/".$pic_myrows['subcateFolders']."-".pathProName($products_rows['productName'])."-".$products_rows['ID'].".html";
                    }
                    ?>
                <a class="c-img-height" href="<?=$piclink?>"><img src='<?=trim($picsrc)?>' border="0" alt='<?=$products_rows['productName']?>' /></a>
                </div>
                      <div class="caption pro-name col-xs-12">
                        <h5><a href="<?=$piclink?>"><?=substr($products_rows['productName'],0,40)?></a></h5>
                      </div>
                    </div>
              </div>
              <? $i++; }?>
            </div>
            <?php if($amount>$PageSize){
                	echo "<div style='width:100%; float:left; padding-bottom:26px; font-size: 13px; '>".$page_string."</div>";
                    }

    $new_str ="<ul class=\"list-unstyled n-list\">";
    while($my_rows=mysql_fetch_assoc($news_query)){
		
		$newscate_sql = "SELECT * FROM ls_functioncates WHERE cateName LIKE '".$my_rows['cate']."'";
		$newscate_query=$opendb->query($newscate_sql);
		$newscate_rows=mysql_fetch_assoc($newscate_query);

		$page_string = getSearchPages($row2, $page, $page2, $PageSize2, $searchproductName, "list");
        $new_str .= "<li><span style=\"float:right;\">[".$my_rows['newsDate']."]</span><a href=\"newspage/news".$newscate_rows['suffStr'].$my_rows['ID'].".html\" target=\"_blank\">".$my_rows['newsTitle']." &nbsp; </a></li>";

    }
    $new_str .= "</ul>";
    
    if($row2 != 0){
        echo $new_str;
    }else{
        //echo "没有找到相关的文章信息！";
    }

    ?>
            <div id="page" style="width:100%; float:left; padding-bottom:26px; font-size: 13px;">
              <?php if($row2>$PageSize2) {echo $page_string;}?>
            </div>
          </div>
				</div>
			</div>
		</div>
	</div>
</div>
<!-- InstanceEndEditable -->
<div class="footer">
  <div class="container">
    <div class="row foot">
      <div class="col-lg-4 col-md-4 col-sm-4 col-xs-12">
        <h3><a href="../contact.html">Contact Us</a></h3>
        <div class="contact">
          <dl class="dl-horizontal">
            <dt><img src="../images/2_10.png" /></dt>
            <dd>Wancheng Industrial Area, Gaoyi 
              County, Shijiazhuang, Hebei, China</dd>
            <dt><img src="../images/tel_10.png" /></dt>
            <dd>+ 86 - 311 - 83954899</dd>
            <dt><img src="../images/1_10.png" /></dt>
            <dd>+ 86 - 311 - 84061390</dd>
             <dt><img src="../images/url.png"></dt>
            <dd><a href="http://www.sjzbshg.com"> www.sjzbshg.com</a></dd>
          </dl>
        </div>
        <h3 class="social-h3">Follow Us</h3>
        <div class='social'> {ls_weibo} </div>
      </div>
      <div class="col-lg-4 col-md-4 col-sm-4 col-xs-12">
    
        <h3 class="erweima">For Mobile</h3>
         <div class="erweima">
        	<img src="../images/erweima1.jpg">
        </div>
        
      </div>
      <div class="col-lg-4 col-md-4 col-sm-4 col-xs-12">
        <h3>Feedback</h3>
        <form action='../sendmail.php' id="feedback-form" name="sendmailform" method='post' onSubmit="return check(this);">
          <ul class="list-unstyled m_form fl " id="leavewordform">
            <li>
              <label> <img src="../images/manager.png" /></label>
              <input class="iptTxt" type="text" id="txtname" name="Name" value="Name" onBlur="if(this.value==''){this.value='Name'}"
                                    onfocus="if(this.value=='Name'){this.value=''}" />
            </li>
            <li>
              <label> <img src="../images/email.png" /></label>
              <input class="iptTxt"
                                    type="text" id="txtemail" name="Mail" value="Email" onBlur="if(this.value==''){this.value='Email'}"
                                    onfocus="if(this.value=='Email'){this.value=''}" />
            </li>
            <li>
              <label> <img src="../images/tel.png"  /></label>
              <input class="iptTxt"
                                    type="text" id="txtemail" name="Tel" value="Tel" onBlur="if(this.value==''){this.value='Tel'}"
                                    onfocus="if(this.value=='Tel'){this.value=''}" />
            </li>
            <li class="areLi">
              <label> <img src="../images/mess.png" /></label>
              <textarea class="txtAre" name="Comments"
                                    id="txtshortdesc" onBlur="if(this.value==''){this.value='Message'}" onFocus="if(this.value=='Message'){this.value=''}">Message</textarea>
            </li>
            <li>
              <label><img src="../images/yzm.png" /></label>
              <input class="iptTxt2" type="text" id="input1" name="code" />
              &nbsp; <img src="../ls_admin/inc/code.php" onClick="this.src='ls_admin/inc/code.php?code=Math.random()'" /> &nbsp;
              <input type="hidden" name="ls2" value="sendmail" />
              <input class="btnSubmit" type="submit" value="SEND"  />
            </li>
          </ul>
        </form>
        <script type="text/javascript" charset="utf-8" src="../js/check.js"></script>
      </div>
    </div>
  </div>
</div>

<div class="copyright">
  <div class="container" > Copyright &copy; 
   <a href="index.html">Shijiazhuang Baisheng Chemical Co., Ltd. </a> All Rights Reserved. 
  </div>
</div>
</body>
<!-- InstanceEnd --></html>
