<?php echo !defined("GUVENLIK") ? die("Vaoww! Bu ne cesaret?") : null;?>
<?php
$page_header_setting = $db->prepare("select * from page_header where page_id='blog' order by id");
$page_header_setting->execute();
$pagehead = $page_header_setting->fetch(PDO::FETCH_ASSOC);
?>
<?php
$blogsettings = $db->prepare("select * from blog_ayar where id=:id");
$blogsettings->execute(array(
        'id' => '1'
));
$blogsett = $blogsettings->fetch(PDO::FETCH_ASSOC);
$num = 1;
?>
<?php
$Sayfa = @intval($_GET['page']); if(!$Sayfa) $Sayfa = 1;
$Say = $db->query("select * from blog where durum='1' and dil='$_SESSION[dil]' order by id DESC");
$ToplamVeri = $Say->rowCount();
$Limit = 12;
$Sayfa_Sayisi = ceil($ToplamVeri/$Limit); if($Sayfa > $Sayfa_Sayisi){$Sayfa = 1;}
$Goster = $Sayfa * $Limit - $Limit;
$GorunenSayfa = 5;
$Blog_listele = $db->query("select * from blog where durum='1' and dil='$_SESSION[dil]' order by id DESC limit $Goster,$Limit");
$BlogAl = $Blog_listele->fetchAll(PDO::FETCH_ASSOC);
?>
<title><?php echo ucwords_tr($diller['blog']) ?> | <?php echo $ayar[site_baslik]?></title>
<meta name="description" content="<?php echo"$blogset[meta_desc]" ?>">
<meta name="keywords" content="<?php echo"$blogset[tags]" ?>">
<meta name="news_keywords" content="<?php echo"$blogset[tags]" ?>">
<meta name="author" content="<?php echo"$ayar[site_baslik]" ?>" />
<meta itemprop="author" content="<?php echo"$ayar[site_baslik]" ?>" />
<meta name="robots" content="index follow">
<meta name="googlebot" content="index follow">
<meta property="og:type" content="website" />

<?php include "includes/config/header_libs.php";?>

</head>
<body>
<?php include 'includes/template/pre-loader.php'?>
<?php include 'includes/template/header.php'?>


<!-- Page Header ====================== !-->
<style>
    .blog-box-in img{border-radius: <?php echo $blogsett[border_radius] ?>px}
    .page-headers-main{width:<?php if($pagehead[width]==1){?> 90%; <?php }else {?> 100% <?php }?> ;  padding:<?php echo $pagehead[padding] ?>px 0 <?php echo $pagehead[padding] ?>px 0 ; border:1px solid #<?php echo $pagehead[border_color] ?>;

        <?php if($pagehead[shadow] == 1 ) {?>

        -webkit-box-shadow: inset 0px 5px 10px -7px rgba(0,0,0,0.1);
        -moz-box-shadow: inset 0px 5px 10px -7px rgba(0,0,0,0.1);
        box-shadow: inset 0px 5px 10px -7px rgba(0,0,0,0.1);

        <?php } ?>

        <?php if($pagehead[tip] == 0 ) {?>

        background:#<?php echo $pagehead[bg_color] ?> ;

        <?php } ?>

        <?php if($pagehead[tip] == 1 ) {?>

        background:url(images/uploads/<?php echo $pagehead[bg_image] ?>) ;

        box-shadow: inset 5000px 0 0 0 rgba(0, 0, 0, 0.7); border-color: rgba(0, 0, 0, 1);

        <?php } ?>

    }
</style>
<div class="page-headers-main page-headers-main about-title about-title-bg">
    <div class="d-table">
        <div class="d-table-cell">
            <div class="container">
                <div class="about-title-text">
                    <h2 style="color:#<?php echo $pagehead[text_color] ?>">
                        <?php echo ucwords_tr($diller['blog']) ?>
                    </h2>
                    <span style="color:#<?php echo $pagehead[pasif_text_color] ?>; padding-right: 15px;"><?php echo $diller['buradasiniz'] ?>:</span>
                    <ul>
                        <li>
                            <a href="index.html" style="color:#<?php echo $pagehead[text_color] ?> !important;"><span style="padding-right: 15px; font-weight: 600;color:#<?php echo $pagehead[text_color] ?> !important;"><?php echo $diller['anasayfa'] ?></span></a>
                        </li>
                        <li>
                            <i class="icofont-rounded-double-right" style="color:#<?php echo $pagehead[pasif_text_color] ?>; padding-right: 15px;"></i>
                            <span style="padding-right: 15px; color:#<?php echo $pagehead[text_color] ?>;"><?php echo ucwords_tr($diller['blog']) ?></span>
                        </li>
                    </ul>
                </div>
            </div>
        </div>
    </div>
</div>
<div class="main-blog-post pt-100 blog-post-top">
    <div class="container">
      <div class="section-head blue-title text-center">
        <h2>
            <?php echo ucwords_tr($diller['blog']) ?>
        </h2>
        <p>
            <?php echo $diller['blog-aciklamasi'] ?>
        </p>
    </div>
    <div class="row">
        <?php foreach($BlogAl as $blog){?>
            <div class="col-lg-4 col-md-6">
                <div class="blog-area">
                    <div class="blog-img">
                       <a href="blog/<?php echo seo($blog[id])?>/<?php echo seo($blog[baslik]) ?>">
                        <img src="images/blog/<?php echo $blog[gorsel] ?>" alt="<?php echo $blog[baslik] ?>">
                    </a>
                    </div>
                    <div class="blog-text">
                        <h4><a href="blog/<?php echo seo($blog[id])?>/<?php echo seo($blog[baslik]) ?>">
                                    <?php echo $blog[baslik] ?>
                        </a></h4>
                        <?php if($blog[spot] == !null) {?>
                            <p><?php echo $blog[spot] ?></p>
                        <?php }?>
                        <a class="blog-btn" href="blog/<?php echo seo($blog[id])?>/<?php echo seo($blog[baslik]) ?>" style="color:tomato">
                            <?php echo $diller['blog-devamini-oku']?> <i class="fa fa-long-arrow-right"></i>
                        </a>
                    </div>
                </div>
            </div>
        <?php } ?>
        </div>
          <!---- Sayfalama Elementleri ================== !-->

            <?php if($Sayfa >= 1){?>
                <nav aria-label="Page navigation example" style="margin-top: 50px;">
                    <ul class="pagination  justify-content-center">
            <?php } ?>

            <?php if($Sayfa > 1){?>

                <li class="page-item"><a class="page-link" href="bloglar/1"><?=$diller['sayfalama-ilk']?></a></li>
                <li class="page-item"><a class="page-link" href="bloglar/<?=$Sayfa - 1?>"><i class="icofont-rounded-left"></i></a></li>

            <?php } ?>
            <?php
            for($i = $Sayfa - $GorunenSayfa; $i < $Sayfa + $GorunenSayfa +1; $i++){ if($i > 0 and $i <= $Sayfa_Sayisi){
                if($i == $Sayfa){
                    echo '    
    
                            <li class="page-item" aria-current="page">
                              <a class="page-link active" href="bloglar/'.$i.'">'.$i.'<span class="sr-only">(current)</span></a>
                            </li>
                            
                            ';
                }else{
                    echo '
                    <li class="page-item"><a class="page-link" href="bloglar/'.$i.'">'.$i.'</a></li>
                    ';
                }
            }
            }
            ?>

            <?php if($Blog_listele->rowCount() <=0) { } else { ?>
            <?php if($Sayfa != $Sayfa_Sayisi){?>

                    <li class="page-item"><a class="page-link" href="bloglar/<?=$Sayfa + 1?>"><i class="icofont-rounded-right"></i></a></li>
                    <li class="page-item"><a class="page-link" href="bloglar/<?=$Sayfa_Sayisi?>"><?=$diller['sayfalama-son']?></a></li>


            <?php }} ?>

          <?php if($Sayfa >= 1){?>
                    </ul>
                </nav>
          <?php } ?>
    </div>
</div>

          


<?php include 'includes/template/footer.php'?>
</body>
    </html>
<?php include "includes/config/footer_libs.php";?>

