<?php

echo !defined("GUVENLIK") ? exit : NULL;
if (isset($_GET["id"])) {
    $Sorgu = $db->prepare("SELECT * FROM araclar WHERE seo = ? AND durum = ? AND dil = ?");
    $Sorgu->execute([$_GET["id"], "1", $_SESSION["k_dil"]]);
    if ($Sorgu->rowCount()) {
        $Sonuc = $Sorgu->fetch(PDO::FETCH_ASSOC);
        $kategoriler = $db->query("SELECT * FROM kategori WHERE durum = '1' AND id='" . $Sonuc["kategori"] . "' AND dil = '" . $_SESSION["k_dil"] . "'")->fetch(PDO::FETCH_ASSOC);
        $alissube = $db->query("SELECT * FROM lokasyon WHERE adi = '" . $_SESSION["alis"] . "' AND dil = '" . $_SESSION["k_dil"] . "'")->fetch(PDO::FETCH_ASSOC);
    } else {
        echo "<meta http-equiv=\"refresh\" content=\"0; url=404.html\">";
    }
} else {
    $Sorgu = $db->prepare("SELECT * FROM araclar WHERE durum = ? AND dil = ? ORDER BY id ASC");
    $Sorgu->execute(["1", $_SESSION["k_dil"]]);
    if ($Sorgu->rowCount()) {
        $Sonuc = $Sorgu->fetch(PDO::FETCH_ASSOC);
        $kategoriler = $db->query("SELECT * FROM kategori WHERE durum = '1' AND id='" . $Sonuc["kategori"] . "' AND dil = '" . $_SESSION["k_dil"] . "'")->fetch(PDO::FETCH_ASSOC);
        $alissube = $db->query("SELECT * FROM lokasyon WHERE adi = '" . $_SESSION["alis"] . "' AND dil = '" . $_SESSION["k_dil"] . "'")->fetch(PDO::FETCH_ASSOC);
    } else {
        echo "<meta http-equiv=\"refresh\" content=\"0; url=404.html\">";
    }
}
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 $Sonuc["adi"];
echo "</h1>\r\n                        </div>\r\n                        <div class=\"block-body\">\r\n\r\n                            <div class=\"news-list\">\r\n                                <div class=\"row\">\r\n                                    <div class=\"col-md-12\">\r\n                                        <div class=\"arac-campaign\">\r\n                                            <div class=\"campaign-price\">\r\n                                                <div class=\"label-value\"><b>";
echo para_birim();
echo "</b>";
echo intval($Sonuc["bir_uc"]);
echo "</div>\r\n                                                <div class=\"label-text\"> ";
echo $dil["gunluk"];
echo "</div>\r\n                                            </div>\r\n                                        </div>\r\n                                        <div class=\"arac-slider\"><img src=\"";
echo TEMA;
echo "/uploads/araclar/";
echo $Sonuc["resim"];
echo "\"></div>\r\n                                        <div class=\"info\">\r\n                                            <div class=\"item-box\">\r\n                                                <div class=\"car-info\">\r\n                                                    <div class=\"car-name\">";
echo $Sonuc["adi"];
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<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<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<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<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</ul>\r\n                                            </div>\t\t\t\t\t\t\t\t\t\t\t\r\n                                        </div>\r\n                                    </div>\r\n\t\t\t\t\t\t\t\t\t<div class=\"col-md-12\">\r\n\t\t\t\t\t\t\t\t\t\t<div class=\"col-md-12\">\r\n\t\t\t\t\t\t\t\t\t\t\t<div class=\"fiyatliste hidden-xs hidden-sm\" style=\"margin-bottom: 20px;border: 1px solid ";
echo RENK1;
echo ";padding: 5px;border-radius: 7px;\">\r\n\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"fiyatlisteborder\">\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"fiyatlistehizala\"> \r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<span style=\"padding: 3px 5px;font-size: 16px;width:49.7%;\" class=\"gunlukfiyatlar\">1-3 ";
echo $dil["gun"];
echo "<em style=\"width: 60px;\"> ";
echo para_birim();
echo " ";
echo intval($Sonuc["bir_uc"]);
echo " </em></span> \r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<span style=\"padding: 3px 5px;font-size: 16px;width:49.7%;\" class=\"gunlukfiyatlar\">4-7 ";
echo $dil["gun"];
echo "<em style=\"width: 60px;\"> ";
echo para_birim();
echo " ";
echo intval($Sonuc["dort_yedi"]);
echo " </em></span> \r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<span style=\"padding: 3px 5px;font-size: 16px;width:49.7%;\" class=\"gunlukfiyatlar\">8-15 ";
echo $dil["gun"];
echo "<em style=\"width: 60px;\"> ";
echo para_birim();
echo " ";
echo intval($Sonuc["sekiz_onbes"]);
echo " </em></span> \r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<span style=\"padding: 3px 5px;font-size: 16px;width:49.7%;\" class=\"gunlukfiyatlar\">16-21 ";
echo $dil["gun"];
echo "<em style=\"width: 60px;\"> ";
echo para_birim();
echo " ";
echo intval($Sonuc["onalti_yirmibir"]);
echo " </em></span> \r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<span style=\"padding: 3px 5px;font-size: 16px;width:49.7%;\" class=\"gunlukfiyatlar\">22-28 ";
echo $dil["gun"];
echo "<em style=\"width: 60px;\"> ";
echo para_birim();
echo " ";
echo intval($Sonuc["yirmiiki_yirmisekiz"]);
echo " </em></span> \r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<span style=\"padding: 3px 5px;font-size: 16px;width:49.7%;\" class=\"gunlukfiyatlar\">29-99 ";
echo $dil["gun"];
echo "<em style=\"width: 60px;\"> ";
echo para_birim();
echo " ";
echo intval($Sonuc["yirmidokuz_doksandokuz"]);
echo " </em></span> \r\n\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t\t\t\t</div>\r\n                                </div>\r\n                            </div>\r\n\t\t\t\t\t\t\t<form action=\"system/site_islemler.php\" method=\"POST\" autocomplete=\"off\">\r\n                            <div class=\"col-md-10\">\r\n                                <div class=\"promo-form\">\t\t\t\t\t\t\t\t\r\n                                    <div class=\"promo-form-input\">\r\n                                        <div class=\"col-md-5 col-sm-5\">\r\n                                            <div class=\"form-group\">\r\n                                                <div class=\"icon-box\"><i class=\"fa fa-car\"></i></div>\r\n                                                <div class=\"input-box\">\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t<select name=\"alis\" data-style=\"home-btn-select btn-link\" data-live-search=\"true\" data-size=\"10\" class=\"selectpicker\" data-custom-id=\"custom\" data-custom-class=\"custom\">\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<option selected=\"selected\" value=\"\">";
echo $dil["alis_noktasi"];
echo "</option>\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t";
$LOCSorgu = $db->prepare("SELECT * FROM lokasyon WHERE durum = ? AND konum = ? AND dil = ? ORDER BY id ASC");
$LOCSorgu->execute(["1", "0", $_SESSION["k_dil"]]);
$LOCislem = $LOCSorgu->fetchALL(PDO::FETCH_ASSOC);
echo "\t\t\t\t\t\t\t\t\t\t\t\t\t\t";
foreach ($LOCislem as $LOCSonuc) {
    echo "\t\t\t\t\t\t\t\t\t\t\t\t\t\t<option value=\"";
    echo $LOCSonuc["adi"];
    echo "\" ";
    echo $LOCSonuc["adi"] == $_SESSION["alis"] ? "selected" : "";
    echo ">";
    echo $LOCSonuc["adi"];
    echo "</option>\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t";
}
echo "\t\t\t\t\t\t\t\t\t\t\t\t\t</select>\r\n\t\t\t\t\t\t\t\t\t\t\t\t</div>\r\n                                            </div>\r\n                                        </div>\r\n                                        <div class=\"col-md-7 col-sm-7\">\r\n                                            <div class=\"col-md-6 col-sm-6 border-l\">\r\n                                                <div class=\"form-group\">\r\n                                                    <div class=\"icon-box\"><i class=\"fa fa-calendar\"></i></div>\r\n                                                    <div class=\"input-box\">\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<input name=\"alistarih\" type=\"text\" placeholder=\"";
echo $dil["tarih_seciniz"];
echo "\" value=\"";
echo $_SESSION["alistarih"] != "" ? $_SESSION["alistarih"] : date("d-m-Y") . " " . date("H", strtotime("+1 hours")) . ":00";
echo "\" class=\"form-control dt-picker dt-start\" />\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\r\n                                                </div>\r\n                                            </div>\r\n                                            <div class=\"col-md-6 col-sm-6 border-l\">\r\n                                                <div class=\"form-group\">\r\n                                                    <div class=\"icon-box\"><i class=\"fa fa-calendar\"></i></div>\r\n                                                    <div class=\"input-box\">\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<input name=\"donustarih\" type=\"text\" placeholder=\"";
echo $dil["tarih_seciniz"];
echo "\" value=\"";
echo $_SESSION["donustarih"] != "" ? $_SESSION["donustarih"] : date("d-m-Y", strtotime("+1 days")) . " " . date("H", strtotime("+1 hours")) . ":00";
echo "\" class=\"form-control dt-picker dt-end\" />\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\r\n                                                </div>\r\n                                            </div>\r\n                                        </div>\r\n                                    </div>\r\n                                    <div class=\"promo-form-action action-last\">\r\n                                        <div class=\"other-delivery-area\">\r\n                                            <div class=\"row\">\r\n                                                <div class=\"col-md-5\">\r\n                                                    <div class=\"promo-form-input mt-20\">\r\n                                                        <div class=\"form-group\">\r\n                                                            <div class=\"icon-box\"><i class=\"fa fa-car\"></i></div>\r\n                                                            <div class=\"input-box\">\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<select name=\"donus\" data-style=\"home-btn-select btn-link\" data-live-search=\"true\" data-size=\"10\" class=\"selectpicker\" data-custom-id=\"custom\" data-custom-class=\"custom\">\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<option selected=\"selected\" value=\"\">";
echo $dil["iade_noktasi"];
echo "</option>\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t";
$LOCSorgu = $db->prepare("SELECT * FROM lokasyon WHERE durum = ? AND konum = ? AND dil = ? ORDER BY id ASC");
$LOCSorgu->execute(["1", "1", $_SESSION["k_dil"]]);
$LOCislem = $LOCSorgu->fetchALL(PDO::FETCH_ASSOC);
echo "\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t";
foreach ($LOCislem as $LOCSonuc) {
    echo "\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<option value=\"";
    echo $LOCSonuc["adi"];
    echo "\" ";
    echo $LOCSonuc["adi"] == $_SESSION["donus"] ? "selected" : "";
    echo ">";
    echo $LOCSonuc["adi"];
    echo "</option>\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t";
}
echo "\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</select>\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\r\n                                                        </div>\r\n                                                    </div>\r\n                                                </div>\r\n                                            </div>\r\n                                        </div>\r\n                                        <div class=\"check\">\r\n                                            <div class=\"checkbox-inline\">\r\n                                                <label class=\"styled\" id=\"ilavealan\">\r\n                                                    <input id=\"donus\" type=\"checkbox\" name=\"farkli_lokasyon\" /><span>";
echo $dil["farkli_lokasyon"];
echo " </span>\r\n                                                </label>\r\n                                            </div>\r\n                                        </div>\r\n                                    </div>\t\t\t\t\t\t\t\t\t\r\n                                </div>\r\n                            </div>\r\n                            <div class=\"col-md-2\">\r\n\t\t\t\t\t\t\t\t<input type=\"hidden\" id=\"url\" name=\"url\" value=\"";
echo $Sonuc["seo"];
echo "\">\r\n                                <input type=\"submit\" name=\"arac_kirala\" style=\"height: 58px;\" value=\"";
echo $dil["arac_kirala"];
echo "\" class=\"btn btn-primary-o btn-submit btn-block\" />\r\n                            </div>\r\n\t\t\t\t\t\t\t</form>\r\n                            <div class=\"col-md-12\">\r\n                                <div class=\"arac-text\">\r\n                                    <h4>";
echo $dil["arac_hakkinda"];
echo "</h4>\r\n                                    <p>\r\n                                        ";
echo $Sonuc["aciklama"];
echo "                                    </p>\r\n                                </div>\r\n\t\t\t\t\t\t\t\t";
if ($alissube["adres"]) {
    echo "                                <div class=\"contact\">\r\n                                    <h4>";
    echo $dil["irtibat_icin_sube"];
    echo "</h4>\r\n                                    <div class=\"box\"><span class=\"adon\"><i aria-hidden=\"true\" class=\"fa fa-map-marker\"></i></span><span class=\"text\">";
    echo $alissube["adres"];
    echo "</span></div>\r\n                                    <div class=\"box\"><span class=\"adon\"><i aria-hidden=\"true\" class=\"fa fa-phone\"></i></span><span class=\"text\">";
    echo $alissube["telefon"];
    echo "</span></div>\r\n                                </div>\r\n\t\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    </div>\r\n</section>\r\n";
if ($_SESSION["donus"]) {
    echo "<script>\r\n\t\$('.btn-link').toggleClass('active');\r\n\t\$('.other-delivery-area').toggle();\r\n\t\$(\"#ilavealan\").css(\"display\", \"none\");\r\n</script>\r\n";
}

?>