<?php


echo !defined("GUVENLIK") ? exit : NULL;
$limit = $limitayar["haber_sayisi"];
$ttsorgu = $db->prepare("SELECT COUNT(*) FROM haberler WHERE durum = ? AND dil = ?");
$ttsorgu->execute(["1", $_SESSION["k_dil"]]);
$total = $ttsorgu->fetchColumn();
$BSorgu = $db->prepare("SELECT * FROM haberler WHERE durum = ? AND dil = ? ORDER BY id DESC LIMIT " . $limit);
$BSorgu->execute(["1", $_SESSION["k_dil"]]);
$islem = $BSorgu->fetchALL(PDO::FETCH_ASSOC);
echo "<section class=\"site-content\">\r\n    <div class=\"page-content\">\r\n        <div class=\"container\">\r\n            <div class=\"row\">\r\n                <div class=\"col-md-12\">\r\n                    <div class=\"page-block\">\r\n                        <div class=\"block-title\">\r\n                            <h1>";
echo $dil["haberler1"];
echo "</h1>\r\n                        </div>\r\n                        <div class=\"block-body\">\r\n                            <div class=\"news-list\">\r\n                                <div class=\"row\" id=\"row\">\r\n\t\t\t\t\t\t\t\t\t";
foreach ($islem as $BSonuc) {
    echo "                                    <div class=\"col-md-12 col-sm-6\">\r\n                                        <div class=\"item\" id=\"";
    echo $BSonuc["id"];
    echo "\">\r\n                                            <div class=\"row\">\r\n                                                <div class=\"col-md-5\"><img src=\"";
    echo TEMA;
    echo "/uploads/haberler/kucuk/";
    echo $BSonuc["resim"];
    echo "\" data-height=\"320\" class=\"center-image\"></div>\r\n                                                <div class=\"col-md-7\">\r\n                                                    <div class=\"text-box\">\r\n                                                        <div class='date-time'><span>";
    echo $BSonuc["tarih"];
    echo "</span> <i class='ic ic-clock'></i></div>\r\n                                                        <h2 class=\"news-title\">";
    echo $BSonuc["adi"];
    echo " </h2>\r\n                                                        <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                                                    </div>\r\n                                                </div>\r\n                                            </div>\r\n                                        </div>\r\n                                    </div>\r\n\t\t\t\t\t\t\t\t\t";
}
echo "                                </div>\r\n                            </div>\r\n\t\t\t\t\t\t\t";
if ($limitayar["haber_sayisi"] < $total) {
    echo "                            <div class=\"show-more daha\">\r\n\t\t\t\t\t\t\t\t<div style=\"display:none;min-width: 220px;height: 40px;padding: 0;position: relative;background: #fff;border-color: #dddddd;\"><img src=\"";
    echo TEMA;
    echo "/images/yukleniyor.gif\" /></div>\r\n                                <button class=\"btn btn-primary-o\">";
    echo $dil["daha_fazla"];
    echo "</button>\r\n                            </div>\r\n\t\t\t\t\t\t\t";
}
echo "                        </div>\r\n                    </div>\r\n                </div>\r\n            </div>\r\n        </div>\r\n    </div>\r\n</section>\r\n<script type=\"text/javascript\">\r\n\$(function(){\r\n\t\$(\".daha\").click(function(){\r\n\t\tvar id = \$(\".news-list .item:last\").attr(\"id\");\r\n\t\tvar t = \$(this);\r\n\t\t\$(\"button\", this).hide();\r\n\t\t\$(\"div\", this).show();\r\n\t\t\$.ajax({\r\n\t\t\ttype:\"POST\",\r\n\t\t\turl: \"";
echo TEMA;
echo "/ajax/haber.php\",\r\n\t\t\tdata: {\"id\":id},\r\n\t\t\tsuccess: function(cevap){\r\n\t\t\t\tif(cevap == \"yok\")\r\n\t\t\t\t{\r\n\t\t\t\t\tswal({\r\n\t\t\t\t\t\ttype: 'warning',\r\n\t\t\t\t\t\ttitle: '";
echo $dil["uyari"];
echo "',\r\n\t\t\t\t\t\ttext: '";
echo $dil["daha_fazla_veri_kalmadi"];
echo "',\r\n\t\t\t\t\t\tconfirmButtonText: '";
echo $dil["tamam"];
echo "',\r\n\t\t\t\t\t\ttimer: 5000\r\n\t\t\t\t\t})\r\n\t\t\t\t\t\$(\".daha\").remove();\r\n\t\t\t\t}\r\n\t\t\t\telse\r\n\t\t\t\t{\r\n\t\t\t\t\t\$(\".news-list #row\").append(cevap);\r\n\t\t\t\t\t\$(\"div\", t).hide();\r\n\t\t\t\t\t\$(\"button\", t).show();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t})\r\n\t});\r\n});\r\n</script>";

?>