<?php /* <!-- Main content -->
    <main class="main_content">
<h2><b><?= $title ?></b></h2>
<?php foreach($posts as $post) : ?>
	<h4><?php echo $post['title']; ?></h4>
	<div class="row">
		<div class="col-md-3">
			<img class = "post-thumb" src="<?php echo site_url();?>assets/images/posts/<?php echo $post['post_image']; ?> ">
		</div>
		<div class="col-md-9">
			<small class="post-date">Posted On: <?php echo $post['created_at']; ?> in <strong><?php echo $post['name']; ?></strong></small><br>
			<?php echo word_limiter($post['body'], 60)?>
			<br> <br>
			<p><a class = "btn btn-default" href="<?php echo site_url('/posts/'.$post['slug']); ?>">Read More</a></p>
		</div>
	</div>
<?php endforeach; ?>

<div class="paginate-link">
	<?php //echo $this->pagination->create_links(); ?>
</div>

    </main>
    <!-- Main content end --> */ ?>

<!-- Main content -->
<main class="main_content">
   	<!-- Hero section -->
    <section class="hero_section">
        <div class="container">
            <div class="col-lg-12">
                <div class="wrap_heroContent">
                    <img src="<?php echo site_url();?>assets/assets/images/book-logo.png" alt="logo">
                    <h1>WELCOME TO THE DAILY</h1>
                    <h2>CHALLENGE!</h2>
                    <p>Learn something new everyday with today's featured business book summary!</p>
                    <a href="<?php echo site_url('/book/'.$posts_random[0]['slug']); ?>" title="Click here">Click Here</a>
                    <div class="right_artImg">
                        <img src="<?php echo site_url();?>assets/assets/images/home_hero_img.png" alt="Art image">
                    </div>
                </div>
            </div>
        </div>
    </section>

    <!--top Book Summary section -->
    <section class="top_book_summarySection mt-4">
        <div class="container">
            <div class="col-lg-12">
                <div class="section_heading text-center">
                    <h2>TOP BOOK SUMMARIES</h2>
                    <p>TOP BOOK SUMMARY BELOW</p>
                </div>
            </div>
        </div>
        <div class="container mt-5">
            <div class="row">
                <div class="col-lg-8 mx-auto book_list">
                        <div class="row gy-4">
                        	<?php foreach($posts as $post) : ?>
                        		<div class="col-md-4 col-6 ">
	                                <a href="<?php echo site_url('/book/'.$post['slug']); ?>"><img src="<?php echo site_url();?>assets/images/posts/<?php echo $post['post_image']; ?>" class="img-fluid" alt="Book img"></a>
	                            </div>
                        	<?php endforeach; ?>
                            <!-- <div class="col-md-4">
                                <img src="<?php echo site_url();?>assets/assets/images/BOOKS/traction.png" class="img-fluid" alt="Book img">
                            </div>
                            <div class="col-md-4">
                                <img src="<?php echo site_url();?>assets/assets/images/BOOKS/explosive1.png" class="img-fluid" alt="Book img">
                            </div>
                            <div class="col-md-4">
                                <img src="<?php echo site_url();?>assets/assets/images/BOOKS/hard-s.png" class="img-fluid" alt="Book img">
                            </div>
                            <div class="col-md-4">
                                <img src="<?php echo site_url();?>assets/assets/images/BOOKS/traction.png" class="img-fluid" alt="Book img">
                            </div>
                            <div class="col-md-4">
                                <img src="<?php echo site_url();?>assets/assets/images/BOOKS/traction.png" class="img-fluid" alt="Book img">
                            </div>
                            <div class="col-md-4">
                                <img src="<?php echo site_url();?>assets/assets/images/BOOKS/traction.png" class="img-fluid" alt="Book img">
                            </div> -->

                            <!-- Show more -->
                            <!-- <div class="w-100 text-center">
                                <a href="#" title="show more">Show More
                                    <i class="fas fa-caret-down d-block"></i>
                                </a>
                            </div> -->
                        </div>
                </div>
            </div>
        </div>
    </section>

    <!-- Popular Article -->
    <section class="popular_article_section">
        <div class="container">
            <div class="col-lg-12">
                <div class="section_heading text-center">
                    <h2>Popular Article</h2>
                </div>
            </div>
        </div>
        <div class="container mt-5">
            <div class="row">
                <div class="col-lg-10 mx-auto article_book_list">
                        <div class="row">
                            <?php foreach($posts_random as $post) : ?>
	                            <div class="col-md-4">
                                   <div class="articleBook_card text-center">
                                       <div class="article_img">
                                        <img src="<?php echo site_url();?>assets/images/posts/<?php echo $post['post_image']; ?>" class="img-fluid" alt="Book img" style="height:250px !important">
                                       </div><br>
                                       <p><?php echo $post['title']; ?> </p>
                                        <a href="<?php echo site_url('/book/'.$post['slug']); ?>" class="primary_btn" title="Read more">Read More</a>
                                   </div>
                                </div>
                        	<?php endforeach; ?>
                            <!--<div class="col-md-4">
                               <div class="articleBook_card text-center">
                                   <div class="article_img">
                                    <img src="<?php echo site_url();?>assets/assets/images/BOOK1.png" class="img-fluid" alt="Book img">
                                   </div>
                                   <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Quis ipsum suspendisse ultrices gravida. 
                                       Risus commodo viverra maecenas accumsan lacus vel facilisis. </p>
                                    <a href="#" class="primary_btn" title="Read more">Read More</a>
                               </div>
                            </div>
                            <div class="col-md-4">
                                <div class="articleBook_card  text-center">
                                    <div class="article_img">
                                     <img src="<?php echo site_url();?>assets/assets/images/BOOK1.png" class="img-fluid" alt="Book img">
                                    </div>
                                    <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Quis ipsum suspendisse ultrices gravida. 
                                        Risus commodo viverra maecenas accumsan lacus vel facilisis. </p>
                                     <a href="#" class="primary_btn" title="Read more">Read More</a>
                                </div>
                             </div>
                             <div class="col-md-4">
                                <div class="articleBook_card  text-center">
                                    <div class="article_img">
                                     <img src="<?php echo site_url();?>assets/assets/images/BOOK1.png" class="img-fluid" alt="Book img">
                                    </div>
                                    <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Quis ipsum suspendisse ultrices gravida. 
                                        Risus commodo viverra maecenas accumsan lacus vel facilisis. </p>
                                     <a href="#" class="primary_btn" title="Read more">Read More</a>
                                </div>
                             </div>-->
                            
                        </div>
                </div>
            </div>
        </div>
    </section>

    <?php /*<section class="above_footer">
        <div class="container">
            <div class="row">
                <div class="col-lg-12 text-center ab_footer_content">
                    <a href="#">reallycreativeideas.com</a>
                    <h5>Biz Summary O Day</h5>
                    <ul class="link_wrap">
                        <li><a href="#" title="Terms of use">Terms of use</a></li>
                        <li><a href="#" title="Contact Us">Contact Us</a></li>
                        <li><a href="#" title="Privacy Policy">Privacy Policy</a></li>
                    </ul>
                </div>
            </div>
        </div>
    </section> */ ?>

</main>
<!-- Main content end -->