HOME


sh-3ll 1.0
DIR:/chroot/home/laughingplants/laughingplants.com/html/
Upload File :
Current File : /chroot/home/laughingplants/laughingplants.com/html/main-search.php
<?php  include 'config.php';
$q = $_GET['q']; 

if(!isset($q))
{
	 header('location:index.php', true);
	echo "<script>window.location='index.php'</script>";
} ?>
<!DOCTYPE html>
<html class="no-js">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Laughing Plants</title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="robots" content="all,follow">
<link rel="stylesheet" href="css/font-awesome.min.css">
<link rel="stylesheet" href="css/bootstrap.css">
<link rel="stylesheet" href="css/innerpage.css">
<link rel='stylesheet' href='css/animate.css' type='text/css' media='all' />
<link href="https://fonts.googleapis.com/css?family=Lato:300,400,700" rel="stylesheet">
<link rel="shortcut icon" href="images/leaf.png">
<!-- Tweaks for older IEs--><!--[if lt IE 9]>
        <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
        <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script><![endif]-->
</head>
<style>
#search
{
padding-bottom:0
}
.stylish-input-group
{
 border: 1px solid rgba(128, 128, 128, 0.37);
}
</style>
<body>
	<header>
	  <div class="top_div"></div>
		<div class="container">
		   <nav class="navbar navbar-default">
	        <div class="container-fluid">
	          <div class="navbar-header">
	            <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
		              <span class="sr-only">Toggle navigation</span>
		              <span class="icon-bar"></span>
		              <span class="icon-bar"></span>
		              <span class="icon-bar"></span>
		         </button>
	            <a class="navbar-brand" href="index.php"><img class="img-responsive" src="images/logo.png" alt=""></a>
	          </div>
	          <div id="navbar" class="navbar-collapse collapse" aria-expanded="false">
	            <ul class="nav navbar-nav navbar-right">
	                <li><a href="index.php">Home</a></li>
                        <li><a href="plant-finder.php" class="active">Plant Finder</a></li>
                        <li><a href="about-us.php">About Us</a></li>
                        <li><a href="community.php">Community</a></li>
                        <li><a href="contact.php">Contact Us</a></li>
	            </ul>
	          </div><!--/.nav-collapse -->
	        </div><!--/.container-fluid -->
	      </nav>
		</div>
	</header>

	<section id="search">

		<img src="images/PF-Banner.png" />
		<div class="container text-center">
			<i class="fa fa-filter" aria-hidden="true"></i>
			<h4>Search our plant finder</h4>
			
			<div class="col-md-12">
				<div class="">
				
				  <form action="main-search.php">
					 <div class="input-group stylish-input-group">
	                    	<input type="text" name="q"  class="form-control" value="<?php echo $_GET['q']; ?>" placeholder="Search">
		                    <span class="input-group-addon">
		                        <button type="submit" required>
		                            <span class="fa fa-search"></span>
		                        </button>  
		                    </span>
	                 </div>
	              </form>
	                 
				</div>
			</div>
			<p class="mt_75">Explore our plants to find the perfect look for your home and yard. Discover the best varities, plant combinations and more. It's fun!</p>
		              <?php 
				$q = $_GET['q'];
				$query = "SELECT * FROM tbl_plants WHERE pl_name LIKE ? ";
				$params = array("%$q%");
				$stmt = $con->prepare($query);
				$stmt->execute($params);
				
				$number = $stmt->rowCount();
				if(!$number || empty($q))
				{
					echo "<h2 style='margin-top: 10%;'>Sorry... nothing found.</h2>";
				}
				?>
		</div>
	</section>

	<section id="product_white">
		<div class="container">
			<div class="col-md-12">
				<div class="row">
				<?php  	
				if(!empty($q))
				{	
					while($fetch_plants = $stmt->fetch(PDO::FETCH_ASSOC))
					{	
					?>
					
						<div class="col-md-3 col-sm-6 search_blok">
							<a href="plants.php?id=<?php echo $fetch_plants['id'];?>"><img src="plant_images/<?php echo $fetch_plants['plant_image']; ?>" class="img-responsive"><span class="price_tag"><?php echo $fetch_plants['plant_price'];?></span></a>
							<a href="plants.php?id=<?php echo $fetch_plants['id'];?>"><h3><?php echo $fetch_plants['pl_name']; ?></h3> </a>
							<p><?php echo substr($fetch_plants['pl_slogan'],0,90).'.....'; ?><p> 
						</div>
					<?php 
					}
				}	
				?>	
					 
				</div>
			</div>
		</div>
	</section>

<?php include 'footer.php'?>