<!DOCTYPE html>
<html lang="tr">
<?php require view('include/head'); ?>
<body>
  <?php require view('include/header'); ?>
  <link rel="stylesheet" href="<?= public_url(); ?>css/custom/blog-list.css">
  <section class="single-banner">
    <div class="container">
      <div class="row">
        <div class="col-lg-12">
          <div class="single-content">
            <h2>Haberler</h2>
            <ol class="breadcrumb">
              <li class="breadcrumb-item"><a href="index">Anasayfa</a></li>
              <li class="breadcrumb-item active" aria-current="page">
                Haberler
              </li>
            </ol>
          </div>
        </div>
      </div>
    </div>
  </section>
  <section class="blog-part">
    <div class="container">
      <div class="row content-reverse">
        <div class="col-lg-4">
          <div class="row"> 
            <div class="col-md-7 col-lg-12">
              <div class="blog-filter">
                <h3>En Son Haberler</h3>
                <ul class="blog-suggest">
                 <?php  while($rowa=$querys->fetch(PDO::FETCH_ASSOC)) { ?>
                  <li>
                    <div class="suggest-img">
                      <a href="haber-detay/<?= $rowa['seourl']?>"
                      ><img src="<?= public_url()."".$rowa['image'] ?>" alt="<?= $rowa['haber'] ?>"
                      /></a>
                    </div>
                    <div class="suggest-content">
                      <div class="suggest-title">
                        <h4>
                          <a href="haber-detay/<?= $rowa['seourl']?>"><?= $rowa['haber'] ?></a
                          >
                        </h4>
                      </div>
                      <div class="suggest-meta">
                        <div class="suggest-date">
                          <i class="far fa-calendar-alt"></i>
                          <p><?= $rowa['edit_date'] ?></p>
                        </div> 
                      </div>
                    </div>
                  </li> 
                <?php } ?>
              </ul>
            </div>
          </div> 
 
        </div>
      </div>


      <div class="col-lg-8">
        <div class="row">
          <?php  while($row=$query->fetch(PDO::FETCH_ASSOC)) { ?>
            <div class="col-sm-6 col-md-6 col-lg-6">
              <div class="blog-card">
                <img src="<?= public_url()."".$row['image'] ?>" alt="<?= $row['haber'] ?>" />
                <div class="blog-overlay">
                  <p><?= $row['edit_date'] ?></p>
                  <h3>
                    <a href="haber-detay/<?= $row['seourl']?>"><?= $row['haber'] ?></a>
                    </h3>
                    <a class="btn btn-outline" href="haber-detay/<?= $row['seourl']?>">Devamı...</a>
                  </div>
                </div>
              </div>
            <?php } ?>
          </div>

          <?php if ($toplam_sayfa>1) { ?>
            <div class="row">
              <div class="col-lg-12">
                <ul class="pagination"> 
                  <?php 
                  for($s = 1; $s <= $toplam_sayfa; $s++) {
                    if($sayfa == $s) { ?>
                      <li class="page-item"> <a class="page-link active"><?= $s; ?></a></li>
                    <?php } else { ?>
                      <li class="page-item"><a class="page-link" href="haber?sayfa=<?= $s; ?>"><?= $s; ?></a></li> 
                    <?php } } ?> 
                  </ul>
                </div>
              </div>
            <?php } ?> 
          </div> 
        </div>
      </div>
    </section>
    <?php require view('include/footer'); ?>