<?php include_once APP_PATH.'template/business/tplblocks/header.php';?>

<div class="section bg-gradient-3" id="cards">
  <div class="container">
    <?php if (JAK_CLIENTID && $jakclient->getVar("frontendadmin") == 1) { ?>
              <div class="col-md-8 ml-auto mr-auto text-center mb-1">
                <button class="btn btn-sm btn-primary firefrontedit b-<?php echo $pageid;?>" data-area="blog-<?php echo $pageid;?>" data-pageid="b-<?php echo $pageid;?>" data-lighteditor="false" type="button"><?php echo $jkl['hd66'];?></button>
                <button class="btn btn-sm btn-success firefrontsave b-<?php echo $pageid;?>" data-area="blog-<?php echo $pageid;?>" data-pageid="b-<?php echo $pageid;?>" type="button"><?php echo $jkl['hd53'];?></button>
                <button class="btn btn-sm btn-danger firefrontclose b-<?php echo $pageid;?>" data-area="blog-<?php echo $pageid;?>" data-pageid="b-<?php echo $pageid;?>" type="button"><?php echo $jkl['hd162'];?></button>
              </div>
          <?php } ?>
    <div class="blog-<?php echo $pageid;?>">
      <?php if (isset($cms_text) && !empty($cms_text)) foreach ($cms_text as $t) { if ($t["cmsslug"].$t["cmsid"] == 'blog-'.$pageid) { echo $t["description"]; break; } } ?>
    </div>

    <?php if (JAK_BLOG_A && isset($jak_blogs) && is_array($jak_blogs)) { ?>

      <div class="card-columns">
        <?php foreach($jak_blogs as $bl) {
          $blogparseurl = JAK_rewrite::jakParseurl(JAK_BLOG_URL, 'a', $bl["id"], JAK_rewrite::jakCleanurl($bl["title"]));
          ?>
          <div class="card card-blog">
            <div class="card-image">
              <a href="<?php echo $blogparseurl;?>">
                <img class="img" src="<?php echo $bl["previmg"];?>" alt="<?php echo $bl["title"];?>">
              </a>
            </div>
            <div class="card-body text-center">
              <h4 class="card-title">
                <?php echo $bl["title"];?>
              </h4>
              <div class="card-description">
                <?php echo jak_cut_text($bl["content"], 200, '...');?>
              </div>
              <div class="card-footer">
                <a href="<?php echo $blogparseurl;?>" class="btn btn-danger btn-round"><?php echo $jkl['hd135'];?></a>
                <hr>
              </div>

              <div class="card-footer pb-4">
                <div class="author float-left">
                  <a href="#">
                    <img src="<?php echo BASE_URL.JAK_FILES_DIRECTORY.$bl["picture"];?>" alt="<?php echo $bl["name"];?>" class="avatar img-raised">
                    <span><?php echo $bl["name"];?></span>
                  </a>
                </div>
                <div class="stats">
                  <i class="fa fa-clock-o" aria-hidden="true"></i> <?php echo JAK_base::jakTimesince($bl['time'], JAK_DATEFORMAT, JAK_TIMEFORMAT);?>
                </div>
              </div>
            </div>
          </div>

        <?php } ?>
      </div>
      <div class="row mt-3">
        <div class="pagination-area">
          <?php if ($JAK_PAGINATE) echo $JAK_PAGINATE;?>
        </div>
      </div>
    <?php } else { ?>
      <div class="row">
        <div class="col-md-12">
          <div class="alert alert-info">
            <?php echo $jkl['hd17'];?>
          </div>
        </div>
      </div>
    <?php } ?>
  </div>
</div>

<?php include_once APP_PATH.'template/business/tplblocks/footer.php';?>
