<?php echo !defined("GUVENLIK") ? die("Vaoww! Bu ne cesaret?") : null;?>
<?php
$blogsettings = $db->prepare("select * from blog_ayar where id='1'");
$blogsettings->execute();
$blogsett = $blogsettings->fetch(PDO::FETCH_ASSOC);
$bloglimit = $blogsett["blog_limit"];
?>
<?php
$num = 1;
$blogliste = $db->prepare("select * from blog where durum='1' and dil='$_SESSION[dil]' and anasayfa='1' order by id desc limit $bloglimit");
$blogliste->execute();
?>
<style>
    .blog-home-main-div{width:<?php if($blogsett[width]==1){?> 90%; <?php }else {?> 100% <?php }?> ; height: auto; overflow: hidden; background-color: #<?php echo $blogsett[back_color] ?>; padding: <?php echo $blogsett[padding] ?>px 0 <?php echo $blogsett[padding] ?>px 0;margin: auto; text-align: center; }
    .blog-box{background: #<?php echo $blogsett[box_bg_color]?>}
    .blog-box-in-spot{color:#<?php echo $blogsett[box_spot_color]?>}
    .blog-box-in-readmore a{color:#<?php echo $blogsett[box_more_color]?>}
    .blog-box-in img{border-radius: <?php echo $blogsett[border_radius] ?>px}
</style>
<section class="blog-section pt-100 blog-home-main-div">
    <div class="container">
        <div class="section-head text-center">
            <h2 class="font-<?php echo $blogsett[font_weight] ?> font-spacing" style="color:#<?php echo $blogsett[baslik_color] ?>">
                <?php echo $diller['blog']?></h2>
            <p style="color:#<?php echo $blogsett[spot_color] ?>; letter-spacing: 0.07em">
                <?php echo $diller['blog-aciklamasi']?></p>
        </div>
        <?php if ($blogliste->rowCount() >0) { ?>
            <div class="blog-slider owl-carousel owl-theme">
             <?php foreach ($blogliste as $blog) { ?>

                <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]) ?>" style="color:#<?php echo $blogsett[box_header_color]?>">
                            <?php echo $blog[baslik] ?>
                        </a></h4>
                        <ul>
                            <li>
                                <i class="icofont-calendar"></i>
                                <?=date('d-m-Y',time($blog[tarih]))?>
                            </li>
                        </ul>
                        <?php if($blog[spot] == !null) {?>
                            <p class="blog-box-in-spot"><?php echo $blog[spot] ?></p>
                        <?php }?>

                        <a href="blog/<?php echo seo($blog[id])?>/<?php echo seo($blog[baslik]) ?>">
                        <?php echo $diller['blog-devamini-oku']?> <i class="fa fa-long-arrow-right"></i>
                        </a>
                    </div>
                </div>
            <?php } ?>

        </div>                 
        <?php } ?>
    </div>
</section>


