<?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>Authors <i class="fa fa-chevron-right"></i></span></p>
            <h1 class="mb-0 bread pt-5">Authors</h1>
          </div>
        </div>
      </div>
    </section>
		<center>
      <div class="form-group mt-3"id="searchbox">
<form method="post">
<input type="text" class="" name="search" id="" aria-describedby="helpId" placeholder="Find Authors Here...">
<input type="submit" name="enter" id="" class="btn btn-danger" value="Search">

</form>
</div>
</center>
<center>
<h6> <span class="subheading">Authors</span></h6>
<h4>Our Authors</h4>
</center>
	<section class="">
      <div class="container">
        <div class="row justify-content-center mb-5">
        </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 authors WHERE name LIKE '%$search%'");

}
else{

 $sql=mysqli_query($db, "SELECT * FROM authors ORDER BY id DESC limit 12 ");
}
 while($row=mysqli_fetch_assoc($sql)){
$image=$row['image'];
$idn=$row['idn'];
$name=$row['name'];

?>
          <div class="col-md-3 col-4 d-flex ftco-animate">
          	<div class="blog-entry justify-content-end">
              <div class="text text-center">
            <a  href="authoridn.php?idn=<?php echo $idn?>">
			  <img src="admin/authorimage/<?php echo $image?>" class="img-fluid " alt="">
        </a>
	              <div class="meta text-center mb-2 d-flex align-items-center justify-content-center">
                	<div>
                		<span class="day"></span>
                		
                	</div>
                </div>
                <h3 class="heading mb-3"><a href="authoridn.php?idn=<?php echo $idn?>"><?php echo $name?></a></h3>
				
         

							</div>
            </div>
          </div>
          <?php }?>

        </div>
      </div>
      <i><p class="text-center ml-5"><a class="center text-danger" style="font-size:20px;" href="authorex.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') ?>