<?php
$this->load->view('wpstemplate/top_header');
?>
<!-- Heading Banner--->
<section class="heading_banner" style="background-image: url(<?php echo theme_url(); ?>designer/images/blog/blog.jpg)">
  <div class="container">
    <div class="row">
      <div class="col-lg-12 text-center">
        <div class="cat_title">Our Blog</div>
        <div class="clearfix"></div>
        <div class="cat_title2">We Are Available For You</div>
      </div>
    </div>
  </div>
</section>
<!-- Breadcrumb--->
<section class="inner_breadcrumb hidden-xs">
  <div class="container">
    <div class="row">
      <div class="col-lg-12">
        <ul class="breadcrumb">
          <li><a href="<?php echo comp_url(); ?>" title="Home">Home</a></li>
          <li class="active">Our Blog</li>
        </ul>
      </div>
    </div>
  </div>
</section>
<!-- Home About--->
<section class="blog_page">
  <div class="container">
    <div class="row">
      <div class="col-md-9">
        <div class="blog_left">
          <h1>Our Blog</h1>
          <div class="row">
            <?php
            if (is_array($res) && !empty($res)) {
              foreach ($res as $blog) {
                ?>
                <div class="col-md-6 col-lg-6 col-sm-6 col-xs-12">
                  <div class="row">
                    <div class="col-md-12">
                      <aricle>
                        <div class="blog_grid">
                          <a href="<?php echo site_url() . $blog['friendly_url']; ?>">
                            <div class="image"><img src="<?php echo get_image('clients/blog', $blog['article_image'], '420', '290', 'R'); ?>"></div></a>
                          <div class="article_title ">
                            <hr class="article_line">
                            <h4 class="text-limit-100px"><a href="<?php echo site_url() . $blog['friendly_url']; ?>"><?php echo $blog['article_title']; ?></a></h4>
                            <span class="article_category_name">
                              <a href="<?php echo site_url() . $blog['friendly_url']; ?>"><span>View Details</span></a>
                            </span>
                          </div>
                        </div>
                      </aricle>
                    </div>
                  </div>
                </div>
                <?php
              }
              ?>
              <div class="col-md-12 col-lg-12 col-sm-12 col-xs-12">
                <p class="paging">
                  <?php echo $page_links; ?>
                </p>
              </div>
              <?php
            } else {
              ?>
              <div class="col-xs-12">
              <div class="alert alert-danger text-center" role="alert">
                <strong>Oh snap!</strong> No Blog Found.
              </div>
              </div>
              <div class="col-xs-12">
                <div class="input-field s12 text-center">
                  <div class="row">
                    <div class="input-field s4 "><a href="<?php echo site_url(); ?>members/add_blog" class="waves-effect waves-light btn-large" >Add New Blog Now!</a></div>
                  </div>
                </div>
              </div>
              <?php
            }
            ?>
          </div>

        </div>
      </div>

      <div class="col-md-3">
        <div class="left_sidebar">
          <?php
          if (is_array($leftBlog) && !empty($leftBlog)) {
            ?>
            <div class="left_title1">Popular Post</div>
            <?php
            foreach ($leftBlog as $lBlog) {
              ?>
              <div class="right_news">
                <a href="<?php echo site_url() . $lBlog['friendly_url']; ?>">
                  <div class="image">
                    <img src="<?php echo get_image('clients/blog', $lBlog['article_image'], '260', '180', 'R'); ?>" />
                  </div>
                </a>
                <h5><a href="<?php echo site_url() . $lBlog['friendly_url']; ?>"><?php echo $lBlog['article_title']; ?></a></h5>
              </div>
              <?php
            }
          }
          if (is_array($catRes) && !empty($catRes)) {
            ?>
            <div class="left_sidebar">
              <div class="left_title">Popular Category</div>
              <ul>
                <?php
                foreach ($catRes as $catVal) {
                  ?>
                  <li><a href="<?php echo site_url() . $catVal['friendly_url']; ?>" title="<?php echo $catVal['category_name']; ?>"><?php echo $catVal['category_name']; ?></a></li>
                  <?php
                }
                ?>
              </ul>
            </div>
          </div>
          <?php
        }
        ?>
      </div>

    </div>
  </div>
</div>
</section>
<!-- Home Clients -->
<?php echo comp_clients(); ?>
<?php $this->load->view('wpstemplate/bottom_footer'); ?>