
<?php include("includes/db.php");?>
<?php include('includes/header.php') ?>
    <section class="hero-wrap hero-wrap-2" style="background-image: url('images/bg_5.jpg');" data-stellar-background-ratio="0.5">
      <div class="overlay"></div>
      <div class="container">
        <div class="row no-gutters slider-text align-items-center justify-content-center">
          <div class="col-md-9 ftco-animate mb-0 text-center">
          	<p class="breadcrumbs mb-0"><span class="mr-2"><a href="index.html">Home <i class="fa fa-chevron-right"></i></a></span> <span>Book Store <i class="fa fa-chevron-right"></i></span></p>
            <h1 class="mb-0 bread pt-5">Books</h1>
          </div>
        </div>
      </div>
<center>
      <div class="form-group mt-3"id="searchbox">
<form method="post">
<input type="text" class="" name="search" id="" aria-describedby="helpId" placeholder="Find Books Here...">
<input type="submit" name="enter" id="" class="btn btn-danger" value="Search">

</form>
</div>
</center>
	  <section class="ftco-section">
      <div class="container">
        <div class="row justify-content-center mb-5">
          <div class="col-md 7heading-section text-center ftco-animate">
          	<span class="subheading">Book</span>
            <h4>Some Of Our Books</h4>
          </div>
        </div>
        <div class="row d-flex">
        <?php
              if(isset($_POST['enter'])){
                $search= mysqli_real_escape_string($db, $_POST['search']);
                $sql=mysqli_query($db,"SELECT * FROM books WHERE btitle LIKE '%$search%'");
  
            }
            else{
              $sql=mysqli_query($db, "SELECT * FROM books ORDER BY id DESC limit 12");

            }
 while($row=mysqli_fetch_assoc($sql)){
$image=$row['image'];
$idn=$row['idn'];
$title=$row['btitle'];

?>
          <div class="col-md-3 col-4 d-flex ftco-animate">
          	<div class="blog-entry justify-content-end">
              <div class="text text-center">
              <a name="" id=""  href="bookidn.php?idn=<?php echo $idn?>">
              	<img src="admin/bookimage/<?php echo $image?>" class="img-fluid" alt="">
                </a>	
                </div>
				<center>
				<h6 class="heading mb-3"><a  href="bookidn.php?idn=<?php echo $idn?>"><?php echo $title?></a></h6>
       
				</center>	
				</div>
                </div>
                <?php }?>
        
				
		</div>
	</div>
  <i><p class="text-center ml-5"><a class="center text-danger" style="font-size:20px;" href="bookex.php">See More...</a></p></i>

</section>

	<!-- whatsapp starts here -->

	<div class="whaticon">
	<a href="https://api.whatsapp.com/send/?phone=2348055877829&text&app_absent=0"><img src="images/what.png" class="img-fluid rounded-circle" alt=""></a>

	</div>
	<!-- whatsapp ends here -->



    <?php include('includes/footer.php') ?>


	