<?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);
    } else {
        header("Location:../404.html");
    }
} else {
    header("Location:../index.html");
}
echo "<section class=\"site-content\">\r\n    <div class=\"page-filter\">\r\n        <div class=\"container\">\r\n            <div class=\"promo-form\">\r\n\t\t\t\t<form action=\"system/site_islemler.php\" method=\"POST\" autocomplete=\"off\">\r\n\t\t\t\t\t<div class=\"promo-form-input\">\r\n\t\t\t\t\t\t<div class=\"row\">\r\n\t\t\t\t\t\t\t<div class=\"col-md-4 col-sm-12\">\r\n\t\t\t\t\t\t\t\t<div class=\"form-group\">\r\n\t\t\t\t\t\t\t\t\t<div class=\"icon-box\"><i class=\"fa fa-car\"></i></div>\r\n\t\t\t\t\t\t\t\t\t<div class=\"input-box\">\r\n\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<option selected=\"selected\" value=\"\">";
echo $dil["alis_noktasi"];
echo "</option>\r\n\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";
foreach ($LOCislem as $LOCSonuc) {
    echo "\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";
}
echo "\t\t\t\t\t\t\t\t\t\t</select>\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=\"col-md-3 col-sm-6\">\r\n\t\t\t\t\t\t\t\t<div class=\"form-group\">\r\n\t\t\t\t\t\t\t\t\t<div class=\"icon-box\"><i class=\"fa fa-calendar\"></i></div>\r\n\t\t\t\t\t\t\t\t\t<div class=\"input-box\">\r\n\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</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=\"col-md-3 col-sm-6\">\r\n\t\t\t\t\t\t\t\t<div class=\"form-group\">\r\n\t\t\t\t\t\t\t\t\t<div class=\"icon-box\"><i class=\"fa fa-calendar\"></i></div>\r\n\t\t\t\t\t\t\t\t\t<div class=\"input-box\">\r\n\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</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=\"col-md-2 col-sm-6 col-md-offset-0 col-sm-offset-3\">\r\n\t\t\t\t\t\t\t\t<input type=\"hidden\" id=\"url\" name=\"url\" value=\"";
echo $_SERVER["REQUEST_URI"];
echo "\">\r\n\t\t\t\t\t\t\t\t<input type=\"submit\" name=\"arac_bul\" value=\"";
echo $dil["arac_bul"];
echo "\" class=\"btn btn-primary-o btn-submit\" />\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\t<div class=\"promo-form-action\">\r\n\t\t\t\t\t\t<div class=\"other-delivery-area\">\r\n\t\t\t\t\t\t\t<div class=\"col-md-6 col-md-offset-3\">\r\n\t\t\t\t\t\t\t\t<div class=\"promo-form-input mt-20\">\r\n\t\t\t\t\t\t\t\t\t<div class=\"form-group\">\r\n\t\t\t\t\t\t\t\t\t\t<div class=\"icon-box\"><i class=\"fa fa-car\"></i></div>\r\n\t\t\t\t\t\t\t\t\t\t<div class=\"input-box\">\r\n\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<option selected=\"selected\" value=\"\">";
echo $dil["iade_noktasi"];
echo "</option>\r\n\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";
foreach ($LOCislem as $LOCSonuc) {
    echo "\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";
}
echo "\t\t\t\t\t\t\t\t\t\t\t</select>\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\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</div>\r\n\r\n\t\t\t\t\t\t<div class=\"other-delivery\">\r\n\t\t\t\t\t\t\t<button type=\"button\" class=\"btn-link\" id=\"btnsec\">";
echo $dil["farkli_lokasyon"];
echo "</button>\r\n\t\t\t\t\t\t</div>\r\n\t\t\t\t\t</div>\r\n\t\t\t\t</form>\r\n            </div>\r\n        </div>\r\n    </div>\r\n\t\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\r\n\r\n                </div>\r\n            </div>\r\n            <div class=\"row\">\r\n                <div class=\"col-md-3 col-sm-5 col-md-offset-1 col-xs-12 pull-right\">\r\n                    <div class=\"page-sidebar\">\r\n                        <div class=\"widget widget-price\"><span>";
echo $dil["genel_toplam"];
echo "</span><div style=\"float: right\"><b style=\"float:left;margin-right: 2px;\">";
echo para_birim();
echo "</b> <b id=\"fiyat\" style=\"float: left !important\">\r\n                                ";
$genel_fiyat = gun_fiyat($_SESSION["gunfarki"], $Sonuc["bir_uc"], $Sonuc["dort_yedi"], $Sonuc["sekiz_onbes"], $Sonuc["onalti_yirmibir"], $Sonuc["yirmiiki_yirmisekiz"], $Sonuc["yirmidokuz_doksandokuz"]);
echo "\t\t\t\t\t\t\t\t";
echo $genel_fiyat;
$_SESSION["f"] = $genel_fiyat;
echo "\t\t\t\t\t\t\t\t</b></div>\r\n                            <strong style=\"float:left\">";
echo $dil["kdv_dahil"];
echo "</strong>\r\n                        </div>\r\n                        <div class=\"widget mb-30\" style=\"background: none;\">\r\n                            <a href=\"system/site_islemler.php?rezervasyon=ok&aracid=";
echo $Sonuc["id"];
echo "&genel_fiyat=";
echo $genel_fiyat;
echo "\" class=\"btn btn-orange btn-block\">";
echo $dil["rezervasyon_yap"];
echo "</a>\r\n                        </div>\r\n                        <div class=\"widget widget-reservation\">\r\n                            <div class=\"widget-head\"><i class=\"fa fa-car\"></i><span>";
echo $dil["islem_bilgi"];
echo "</span></div>\r\n                            <div class=\"widget-body\">\r\n\r\n                                <div class=\"car-detail\">\r\n                                    <div class=\"date-box\">";
echo $_SESSION["gunfarki"];
echo " <span>";
echo $dil["gun"];
echo "</span></div>\r\n                                    <div class=\"image-box\">\r\n                                        <img src=\"";
echo TEMA;
echo "/uploads/araclar/";
echo $Sonuc["resim"];
echo "\">\r\n\t\t\t\t\t\t\t\t\t</div>\r\n                                    <div class=\"car-info\">\r\n                                        <div class=\"car-name\">";
echo $Sonuc["adi"];
echo "<span></span></div>\r\n                                    </div>\r\n                                </div>\r\n\r\n                                <div class=\"filter-list\">\r\n                                    <div class=\"list-head\"><span>";
echo $dil["ek_secenek"];
echo "</span></div>\r\n                                    <div class=\"list-body\">\r\n                                        <ul class=\"ekicerik\">\r\n                                            <li><span style=\"font: 22px/31px !important;color: #5d6469;\">";
echo $dil["extra_ucret"];
echo " : </span><b>";
echo para_birim();
echo "</b> <span class=\"pull-right\" style=\"margin-left: 2px;font-size: 19px;margin-top: -2px;\" id=\"ekicerik\">0</span></li>\r\n                                        </ul>\r\n                                    </div>\r\n                                </div>\r\n                            </div>\r\n                        </div>\r\n                    </div>\r\n                </div>\r\n                <div class=\"col-md-8 col-sm-6 col-xs-12\">\r\n                    <div class=\"page-block\">\r\n                        <div class=\"block-title\">\r\n                            <h2>";
echo $dil["ek_secenek"];
echo "</h2>\r\n                        </div>\r\n                        <div class=\"block-body\">\r\n                        \t<form class=\"ekstra-form\">\r\n                            <div class=\"extra-option-list\">\r\n\t\t\t\t\t\t\t";
$EXTSorgu = $db->prepare("SELECT * FROM ekstra WHERE durum = ? AND dil = ? ORDER BY id ASC");
$EXTSorgu->execute(["1", $_SESSION["k_dil"]]);
$EXTislem = $EXTSorgu->fetchALL(PDO::FETCH_ASSOC);
echo "\t\t\t\t\t\t\t\t";
foreach ($EXTislem as $EXTSonuc) {
    echo "                                <div class=\"item \">\r\n                                    <div class=\"option-detail\">                                        \r\n                                        <div class=\"text-box\">\r\n                                            <div class=\"option-name\">";
    echo $EXTSonuc["adi"];
    echo "</div>\r\n                                            <div class=\"option-statu\"><span> ";
    echo $dil["eklenmedi"];
    echo "</span><i class=\"fa fa-check\"></i></div>\r\n                                        </div>\r\n                                        <div class=\"select-box\" id=\"1\">\r\n\t\t\t\t\t\t\t\t\t\t\t<select name=\"ekstra[";
    echo $EXTSonuc["id"];
    echo "]\" onchange=\"myFunction23('";
    echo $Sonuc["id"];
    echo "',this.value)\" data-style=\"btn-select\" class=\"selectpicker\">\r\n\t\t\t\t\t\t\t\t\t\t\t\t";
    for ($i = 0; $i <= $EXTSonuc["adet"]; $i++) {
        echo "\t\t\t\t\t\t\t\t\t\t\t\t\t<option value=\"";
        echo $i;
        echo "\">";
        echo $i;
        echo "</option>\t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t";
    }
    echo "\t\t\t\t\t\t\t\t\t\t\t</select>\r\n                                        </div>\r\n                                        <div class=\"price-box\">\r\n                                            <div class=\"price-value\"> ";
    echo para_birim();
    echo " ";
    echo $EXTSonuc["fiyat"];
    echo "</div>\r\n                                            <div class=\"price-text\"><b>/</b> ";
    echo $dil["adet"];
    echo "</div>\r\n                                        </div>\r\n                                    </div>\r\n                                </div>\r\n\t\t\t\t\t\t\t\t";
}
echo "                            </div>\r\n                            </form>\r\n                        </div>\r\n                    </div>\r\n                    <div class=\"page-block\">\r\n                        <p>\r\n                            <strong>";
echo $dil["arac_hakkinda"];
echo "</strong><br /> ";
echo $Sonuc["aciklama"];
echo "                        </p>\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\$(\"#btnsec\").css(\"display\", \"none\");\r\n</script>\r\n";
}
echo "<script type=\"text/javascript\">\r\nfunction myFunction23(AracID, elm) {\r\n\r\n\tvar AracID = AracID;\r\n\tvar fiyat = document.getElementById(\"fiyat\").innerText;\r\n\tvar elm = elm;\r\n\tvar formlar = \$(\".ekstra-form\").serialize()+\"&AracID=\"+AracID+\"&fiyat=";
echo $genel_fiyat;
echo "&elm=\"+elm;\r\n\t\r\n\t\$.ajax({\r\n\t\ttype: \"POST\",\r\n\t\turl: \"";
echo TEMA;
echo "/ajax/extra.php\",\r\n\t\tdata: formlar,\r\n\t\tdataType: \"json\",\r\n\t\tsuccess: function (data) {\r\n\t\t\t\$(elm).parent().remove();\r\n\t\t\t\$('#fiyat').html('');\r\n\t\t\t\$('#ekicerik').html('');\r\n\t\t\t\$('#fiyat').append(data.d);\r\n\t\t\t\$('#ekicerik').append(data.exfiyat);\r\n\t\t}\r\n\t});\r\n}\r\n</script>\r\n";

?>