<?php

sleep(1);
ob_start();
session_start();
require_once "../../../system/baglan.php";
require_once "../../../system/fonk.php";
require_once "../../../language/dil_" . $_SESSION["k_dil"] . ".php";
if ($_POST) {
    $id = $_POST["id"];
    $limit = $limitayar["haber_sayisi"];
    $BSorgu = $db->prepare("SELECT * FROM haberler WHERE durum = ? AND dil = ? AND id < ? ORDER BY id DESC LIMIT " . $limit);
    $BSorgu->execute(["1", $_SESSION["k_dil"], $id]);
    $islem = $BSorgu->fetchALL(PDO::FETCH_ASSOC);
    if ($BSorgu->rowCount() != "0") {
        foreach ($islem as $BSonuc) {
            echo "\t\t\t<div class=\"col-md-12 col-sm-6\">\r\n\t\t\t\t<div class=\"item\" id=\"";
            echo $BSonuc["id"];
            echo "\">\r\n\t\t\t\t\t<div class=\"row\">\r\n\t\t\t\t\t\t<div class=\"col-md-5\">\r\n\t\t\t\t\t\t\t<div class=\"center-image-canvas\" style=\"height: 320px; overflow: hidden; position: relative;\">\r\n\t\t\t\t\t\t\t\t<img style=\"transform: translate(-50%, -50%);position: absolute;left: 50%;top: 50%;width: undefinedpx;\" src=\"";
            echo TEMA;
            echo "/uploads/haberler/kucuk/";
            echo $BSonuc["resim"];
            echo "\" data-height=\"320\" class=\"center-image\">\r\n\t\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t<div class=\"col-md-7\">\r\n\t\t\t\t\t\t\t<div class=\"text-box\">\r\n\t\t\t\t\t\t\t\t<div class='date-time'><span>";
            echo $BSonuc["tarih"];
            echo "</span> <i class='ic ic-clock'></i></div>\r\n\t\t\t\t\t\t\t\t<h2 class=\"news-title\">";
            echo $BSonuc["adi"];
            echo " </h2>\r\n\t\t\t\t\t\t\t\t<p>";
            echo kisalt(strip_tags($BSonuc["aciklama"]), 500);
            echo "</p><a href=\"haber/";
            echo $BSonuc["seo"];
            echo ".html\" class=\"btn btn-primary-o more-btn\">";
            echo $dil["devamini_oku"];
            echo "</a>\r\n\t\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t</div>\r\n\t\t\t\t\t</div>\r\n\t\t\t\t</div>\r\n\t\t\t</div>\r\n\t\t";
        }
    } else {
        echo "yok";
    }
}

?>