<!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/all.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">
<!-- InstanceBeginEditable name="doctitle" -->
<title>
<translate>{ls_title}</translate>
</title>
<!-- InstanceEndEditable -->
<meta name="Keywords" content="{ls_keywords}" />
<meta name="Description" content="{ls_description}" />
<link type="text/css" rel="stylesheet" href="../bootstrap/css/bootstrap.min.css" />
<link type="text/css" rel="stylesheet" href="../css/style.css" />
<link type="text/css" rel="stylesheet" href="../css/banner2.css" />
<script src="../bootstrap/js/jquery.js"></script>
<script src="../bootstrap/js/bootstrap.min.js" type="text/javascript"></script>
<script src="../bootstrap/js/bootstrap-dropdown-on-hover.js" type="text/javascript"></script>
<script type="text/javascript" src="../js/superslide.2.1.js"></script>
<script type="text/javascript" src="../js/gundong.js"></script>
<script>
    $(document).ready(function() {
        $('.dropdown' ).hover(
            function(){
                $(this).children('.sub-menu').slideDown(200);
            },
            function(){
                $(this).children('.sub-menu').slideUp(200);
            }
        );
    }); // end ready
</script>
<script src="../js/wow.min.js"></script>
<script>
new WOW().init();
</script>
<!-- 网站后台访问统计代码 start 注：需jQuery支持-->
<script type="text/javascript">
$(document).ready(function(form){
	//var action = $("#feedback-form").attr('action');
	var action = "../ls_admin/ls_statistics.php";
	$.ajax({
		type: "POST",
		url: action,
		error: function(request) {
		},
		success: function(response)
		{
			if(response == "fail"){
				//alert("error!");
			}else{
				//alert("succuss!");
			}
		}
	});
});
</script>
<script type="text/javascript" src="../js/google_links.js"></script>
<script type="text/javascript"> 
<!-- 
document.oncontextmenu=function(e){return false;} 
//--> 
</script>
<!-- InstanceBeginEditable name="head" -->
<!-- InstanceEndEditable -->
</head>
<body onselectstart="return false">
<div class="navbar navbar-default nav-head" style=" margin: auto;
    border: aliceblue;">
  <div class="logobar">
    <div class="container">
      <div class="navbar-header"> <a href="index.html" class="navbar-brand">Shijiazhuang Wantie Trade Co., Ltd.</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>
        <p class="navbar-text" id="companyName" style="overflow:hidden;">Shijiazhuang Wantie Trade Co., Ltd. </br>
          <!--<span style="margin-left:15px; font-size:14px;color:#b9b9b9;">Rain Poncho / Raincoat / Bag</span>--> </p>
      </div>
      <div class="navbar-text navbar-right" id="head-contact">
        <p class="navbar-text navbar-right" id="head-contact"><img src="../images/whatsapp_34.png"/><span>+86-311-87063602</span><br />
          <a href="mailto:info@sjzwantie.com" class="navbar-link"><img src="../images/eml_09.jpg"/><span>info@sjzwantie.com</span></a></p>
      </div>
    </div>
  </div>
  <div class="navbar-lg">
    <div class="container nav-padding">
      <div class="collapse navbar-collapse" id="navbar-collapse">
        <ul id="primary-menu" class="nav-default no-responsive" style="float:left;">
          <li class="active"><a href="../index.html">Home</a></li>
          <li><a href="../aboutus.html">About Us</a> </li>
          <li class="dropdown"><a href="../{ls_addprolink}" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">Products</a> {ls_s_cate} </li>
          <li><a href="../feedback.html">Inquiry </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="Search"/>
              <div class="input-group-btn">
                <button class=" btn-default search-btn"><span class="glyphicon glyphicon-search"></span></button>
              </div>
            </div>
          </form>
      </div>
    </div>
  </div>
</div>
<div id="banner" class="fullSlide">
  <div class="bd">
    <ul class="slides_container">
      <li class="banner-img" _src="url('../images/banner-1.jpg')" style="background:#fff center 0 no-repeat;"></li>
      <li class="banner-img" _src="url('../images/banner2-1.jpg')" style="background:#fff center 0 no-repeat;"></li>
      <li class="banner-img" _src="url('../images/banner3-1.jpg')" style="background:#fff center 0 no-repeat;"></li>
    </ul>
  </div>
  <div class="hd">
    <ul>
    </ul>
  </div>
  <span class="prev"></span> <span class="next"></span> </div>
<script type="text/javascript" src="../js/banner.js"></script>
<div class="tab1">
  <div class="container">
    <div class="row tab_row">
	<!-- InstanceBeginEditable name="main" -->
<div class="col-md-9">
        <div class="container-fluid">
          <div class="row">
				<div class="container-fluid">
					<h3 class="title-h3-1">
                    	 <ol class="breadcrumb all-breadcrumb">
                        	<li><a href="../index.html">Home</a></li>
                            <li>Search</li>
                        </ol>
                        <span><translate>Search</translate></span>
                    </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 = 15;
        
        // 
        /********************************************************************************/
            $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']."/".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']."/".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']."/".$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>
                </div>
                      <div class="caption pro-name1">
                        <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);
		$href = "";
		switch($newscate_rows['functionName']){
			
			case "新闻分类":
				$href = "newspage/news".$newscate_rows['suffStr'].$my_rows['ID'].".html";
			break;
			
			case "常见问题":
				$href = "faqpage/faq".$newscate_rows['suffStr'].$my_rows['ID'].".html";
			break;
			
			case "博客分类":
				$href = "blog/blog".$newscate_rows['suffStr'].$my_rows['ID'].".html";
			break;
			
		}

		$page_string = getSearchPages($row2, $page, $page2, $PageSize2, $searchproductName, "list");
        $new_str .= "<li><span style=\"float:right;\">[".$my_rows['newsDate']."]</span><a href=\"".$href."\" 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>
<!-- InstanceEndEditable -->
      <div class="col-md-3 info-right hidden-xs hidden-sm">
        <div class="side-title">
          <blockquote>
            <h3>Product List</h3>
          </blockquote>
        </div>
        <div class="side-pro-list"> {ls_p_cate} </div>
      </div>
    </div>
  </div>
</div>
<div class="footer">
  <div class="container">
    <div class="row foot row1">
      <div class="col-lg-3 col-md-3 col-sm-3 col-xs-12">
        <h3>Home</h3>
         <ul class="list">
          <li><a href="../aboutus.html">About Us</a> </li>
          <li><a href="../{ls_addprolink}">Products</a> </li>
          <li><a href="../feedback.html">Inquiry </a></li>
          <li><a href="../contact.html">Contact Us</a></li>
         </ul>
        </div>
      <div class="col-lg-5 col-md-5 col-sm-5 col-xs-12">
        <h3>Contact Us</h3>
        <dl class="dl-horizontal contact">
          <dt><img src="../images/1_03.jpg"></dt>
          <dd> +86-311-87063602</dd>
          <dt><img src="../images/1_06.jpg"></dt>
          <dd>+86-311-87063302</dd>
          <dt><img src="../images/1_08.jpg"/></dt>
          <dd><a href="mailto:info@sjzwantie.com">info@sjzwantie.com</a></dd>
          <dt><img src="../images/1_10.png"></dt>
          <dd style="line-height:50px; padding-top:5px;">486 Heping West Road, Shijiazhuang, China</dd>
        </dl>
      </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/people_22.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 class="areLi2">
              <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()'" class="areLi-img"/>
              <input type="hidden" name="ls2" value="sendmail" />
              <input class="btnSubmit" type="submit" value="Send" style="font-weight:bold;"/>
            </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" >
 <span style="color:#fff;"> Copyright &copy;<a href="../index.html"> Shijiazhuang Wantie Trade Co., Ltd.</a> All Rights Reserved.</span></div>
</div>
<script>
$("#codeImg").click(function(){$("#codeImg").attr('src','../ls_admin/inc/code.php?m='+Math.random());});
</script>
{ls_statistics}
</body>
<!-- InstanceEnd --></html>
