<?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["arac_listesi"];
    $ARACSorgu = $db->prepare("SELECT * FROM araclar WHERE durum = ? AND dil = ? AND id > ? ORDER BY id ASC, bir_uc ASC LIMIT " . $limit);
    $ARACSorgu->execute(["1", $_SESSION["k_dil"], $id]);
    $ARACislem = $ARACSorgu->fetchALL(PDO::FETCH_ASSOC);
    if ($ARACSorgu->rowCount() != "0") {
        foreach ($ARACislem as $ARACSonuc) {
            echo "\t\t\t<div class=\"col-md-12\">\r\n\t\t\t\t<div class=\"item\" id=\"";
            echo $ARACSonuc["id"];
            echo "\">\r\n\t\t\t\t\t";
            if ($ARACSonuc["yeni"] == 1) {
                echo "<div class='new-box'><span>";
                echo $dil["yeni"];
                echo "</span></div>";
            }
            echo "\t\t\t\t\t<div class=\"row\">\r\n\t\t\t\t\t\t<div class=\"col-md-6\">\r\n\t\t\t\t\t\t\t<div class=\"price-box\"><span class=\"price-value\">";
            echo para_birim();
            echo intval($ARACSonuc["bir_uc"]);
            echo "</span><span class=\"price-text\"><b>/</b> ";
            echo $dil["gun"];
            echo "</span></div>\r\n\t\t\t\t\t\t\t<div class=\"image-box\"><img src=\"";
            echo TEMA;
            echo "/uploads/araclar/";
            echo $ARACSonuc["resim"];
            echo "\"></div>\r\n\t\t\t\t\t\t\t<div class=\"discount-box\">";
            if ($_SESSION["gunfarki"]) {
                echo $_SESSION["gunfarki"];
            } else {
                echo "1";
            }
            echo " ";
            echo $dil["gun_icin"];
            echo "&nbsp; ";
            echo para_birim();
            echo gun_fiyat($_SESSION["gunfarki"], $ARACSonuc["bir_uc"], $ARACSonuc["dort_yedi"], $ARACSonuc["sekiz_onbes"], $ARACSonuc["onalti_yirmibir"], $ARACSonuc["yirmiiki_yirmisekiz"], $ARACSonuc["yirmidokuz_doksandokuz"]);
            echo "</div>\r\n\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t<div class=\"col-md-6\">\r\n\t\t\t\t\t\t\t<div class=\"car-info\">\r\n\t\t\t\t\t\t\t\t<div class=\"car-name\">";
            echo $ARACSonuc["adi"];
            echo " <span></span></div>\r\n\t\t\t\t\t\t\t\t<div class=\"car-class\"> ";
            echo $kategoriler["adi"];
            echo " </div>\r\n\t\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t\t<div class=\"car-option-list\">\r\n\t\t\t\t\t\t\t\t<ul>\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t<li><i class=\"fa fa-battery-three-quarters\"></i><span>";
            if ($ARACSonuc["yakit"] == 1) {
                echo "Dizel";
            }
            if ($ARACSonuc["yakit"] == 2) {
                echo "Benzin";
            }
            if ($ARACSonuc["yakit"] == 3) {
                echo "Lpg";
            }
            echo "</span></li>\r\n\t\t\t\t\t\t\t\t\t<li><i class=\"fa fa-tachometer\"></i><span>";
            if ($ARACSonuc["vites"] == 1) {
                echo "Manuel";
            }
            if ($ARACSonuc["vites"] == 2) {
                echo "Otomatik";
            }
            if ($ARACSonuc["vites"] == 3) {
                echo "Triptonik";
            }
            echo "</span></li>\r\n\t\t\t\t\t\t\t\t\t<li><i class=\"fa fa-recycle\"></i><span>";
            if ($ARACSonuc["klima"] == 1) {
                echo "Dijital";
            }
            if ($ARACSonuc["klima"] == 2) {
                echo "Analog";
            }
            if ($ARACSonuc["klima"] == 3) {
                echo "Yok";
            }
            echo "</span></li>\r\n\t\t\t\t\t\t\t\t\t<li><i class=\"fa fa-suitcase\"></i><span>";
            echo $ARACSonuc["bagaj"];
            echo " ";
            echo $dil["lt"];
            echo "</span></li>\r\n\t\t\t\t\t\t\t\t</ul>\r\n\t\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t\t<div class=\"fiyatliste hidden-xs hidden-sm\">\r\n\t\t\t\t\t\t\t\t<div class=\"fiyatlisteborder\">\r\n\t\t\t\t\t\t\t\t\t<div class=\"fiyatlistehizala\"> \r\n\t\t\t\t\t\t\t\t\t\t<span class=\"gunlukfiyatlar ";
            if ($_SESSION["gunfarki"] <= 3) {
                echo "active";
            }
            echo "\">1-3 ";
            echo $dil["gun"];
            echo "<em> ";
            echo para_birim();
            echo " ";
            echo intval($ARACSonuc["bir_uc"]);
            echo " </em></span> \r\n\t\t\t\t\t\t\t\t\t\t<span class=\"gunlukfiyatlar ";
            if ($_SESSION["gunfarki"] <= 7 && 4 <= $_SESSION["gunfarki"]) {
                echo "active";
            }
            echo "\">4-7 ";
            echo $dil["gun"];
            echo "<em> ";
            echo para_birim();
            echo " ";
            echo intval($ARACSonuc["dort_yedi"]);
            echo "</em></span> \r\n\t\t\t\t\t\t\t\t\t\t<span class=\"gunlukfiyatlar ";
            if ($_SESSION["gunfarki"] <= 15 && 8 <= $_SESSION["gunfarki"]) {
                echo "active";
            }
            echo "\">8-15 ";
            echo $dil["gun"];
            echo "<em> ";
            echo para_birim();
            echo " ";
            echo intval($ARACSonuc["sekiz_onbes"]);
            echo " </em></span> \r\n\t\t\t\t\t\t\t\t\t\t<span class=\"gunlukfiyatlar ";
            if ($_SESSION["gunfarki"] <= 21 && 16 <= $_SESSION["gunfarki"]) {
                echo "active";
            }
            echo "\">16-21 ";
            echo $dil["gun"];
            echo "<em> ";
            echo para_birim();
            echo " ";
            echo intval($ARACSonuc["onalti_yirmibir"]);
            echo "</em></span> \r\n\t\t\t\t\t\t\t\t\t\t<span class=\"gunlukfiyatlar ";
            if ($_SESSION["gunfarki"] <= 28 && 22 <= $_SESSION["gunfarki"]) {
                echo "active";
            }
            echo "\">22-28 ";
            echo $dil["gun"];
            echo "<em> ";
            echo para_birim();
            echo " ";
            echo intval($ARACSonuc["yirmiiki_yirmisekiz"]);
            echo "</em></span> \r\n\t\t\t\t\t\t\t\t\t\t<span class=\"gunlukfiyatlar ";
            if (29 <= $_SESSION["gunfarki"]) {
                echo "active";
            }
            echo "\">29-99 ";
            echo $dil["gun"];
            echo "<em> ";
            echo para_birim();
            echo " ";
            echo intval($ARACSonuc["yirmidokuz_doksandokuz"]);
            echo "</em></span> \r\n\t\t\t\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t\t<div class=\"action-btn\">\r\n\t\t\t\t\t\t\t\t<a href=\"tum-arac-listesi/";
            echo $ARACSonuc["seo"];
            echo ".html\" class=\"btn btn-primary-o\">";
            echo $dil["rezervasyon_yap"];
            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";
    }
}

?>