<?php


echo !defined("GUVENLIK") ? exit : NULL;
$limit = $limitayar["kampanya_sayisi"];
$ttsorgu = $db->prepare("SELECT COUNT(*) FROM araclar WHERE durum = ? AND kampanya = ? AND dil = ?");
$ttsorgu->execute(["1", "1", $_SESSION["k_dil"]]);
$total = $ttsorgu->fetchColumn();
$Sorgu = $db->prepare("SELECT * FROM araclar WHERE durum = ? AND kampanya = ? AND dil = ? ORDER BY id ASC, yirmidokuz_doksandokuz DESC LIMIT " . $limit);
$Sorgu->execute(["1", "1", $_SESSION["k_dil"]]);
$islem = $Sorgu->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["kampanyalar"];
echo "</h1>\r\n                        </div>\r\n                        <div class=\"block-body\">\r\n                            <div class=\"campaign-list\">\r\n                                <div class=\"row\" id=\"row\">\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t";
foreach ($islem as $Sonuc) {
    echo "                                    <div class=\"col-sm-6\">\r\n                                        <div class=\"item\" id=\"";
    echo $Sonuc["id"];
    echo "\">\r\n                                            <div class=\"item-inner\">\r\n                                                <div class=\"image-box\"><img src=\"";
    echo TEMA;
    echo "/uploads/araclar/";
    echo $Sonuc["resim"];
    echo "\" class=\"center-image\" data-height=\"200\">\r\n                                                    <div class=\"campaign-price\">\r\n                                                        <div class=\"label-value\"><b>";
    echo para_birim();
    echo "</b> ";
    echo intval($Sonuc["yirmidokuz_doksandokuz"] * 30);
    echo "</div>\r\n                                                        <div class=\"label-text\">/ ";
    echo $dil["aylik"];
    echo "</div>\r\n                                                    </div>\r\n                                                </div>\r\n                                                <div class=\"car-option-list\">\r\n                                                    <ul>\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<li><i class=\"fa fa-battery-three-quarters\"></i><span>";
    if ($Sonuc["yakit"] == 1) {
        echo "Dizel";
    }
    if ($Sonuc["yakit"] == 2) {
        echo "Benzin";
    }
    if ($Sonuc["yakit"] == 3) {
        echo "Lpg";
    }
    echo "</span></li>\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<li><i class=\"fa fa-tachometer\"></i><span>";
    if ($Sonuc["vites"] == 1) {
        echo "Manuel";
    }
    if ($Sonuc["vites"] == 2) {
        echo "Otomatik";
    }
    if ($Sonuc["vites"] == 3) {
        echo "Triptonik";
    }
    echo "</span></li>\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<li><i class=\"fa fa-recycle\"></i><span>";
    if ($Sonuc["klima"] == 1) {
        echo "Dijital";
    }
    if ($Sonuc["klima"] == 2) {
        echo "Analog";
    }
    if ($Sonuc["klima"] == 3) {
        echo "Yok";
    }
    echo "</span></li>\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<li><i class=\"fa fa-suitcase\"></i><span>";
    echo $Sonuc["bagaj"];
    echo " ";
    echo $dil["lt"];
    echo "</span></li>\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t</ul>\r\n                                                </div>\r\n                                                <div class=\"campaign-title\">";
    echo $Sonuc["adi"];
    echo " ";
    echo $dil["kampanyalar_txt"];
    echo " <span>";
    echo para_birim();
    echo " ";
    echo intval($Sonuc["yirmidokuz_doksandokuz"] * 30);
    echo "</span></div>\r\n                                            </div>\r\n                                            <div class=\"action-btn\"><a href=\"arac/";
    echo $Sonuc["seo"];
    echo ".html\" class=\"btn btn-primary-o\">";
    echo $dil["rezervasyon_yap"];
    echo "</a></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["kampanya_sayisi"] < $total) {
    echo "\t\t\t\t\t\t\t<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\t\t\t\t\t\t\t\t<button class=\"btn btn-primary-o\">";
    echo $dil["daha_fazla"];
    echo "</button>\r\n\t\t\t\t\t\t\t</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 = \$(\".campaign-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/kampanyalar.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\$(\".campaign-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>";

?>