<?php


echo !defined("GUVENLIK") ? exit : NULL;
$limit = $limitayar["transfer_sayisi"];
$ttsorgu = $db->prepare("SELECT COUNT(*) FROM transfer WHERE durum = ? AND dil = ?");
$ttsorgu->execute(["1", $_SESSION["k_dil"]]);
$total = $ttsorgu->fetchColumn();
$BSorgu = $db->prepare("SELECT * FROM transfer WHERE durum = ? AND dil = ? ORDER BY id DESC LIMIT " . $limit);
$BSorgu->execute(["1", $_SESSION["k_dil"]]);
$Bislem = $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\r\n                    <div class=\"page-block\">\r\n                        <div class=\"block-title\">\r\n                            <h1>";
echo $dil["transfer"];
echo "</h1>\r\n                        </div>\r\n                        <div class=\"block-body\">\r\n                            <article>\r\n\t\t\t\t\t\t\t\t<div class=\"transferbolgeleri\">\r\n\t\t\t\t\t\t\t\t\t<table>\r\n\t\t\t\t\t\t\t\t\t\t<tbody id=\"row\">\r\n\t\t\t\t\t\t\t\t\t\t\t<tr class=\"hidden-xs\">\r\n\t\t\t\t\t\t\t\t\t\t\t\t<th>";
echo $dil["alis_yeri"];
echo "</th>\r\n\t\t\t\t\t\t\t\t\t\t\t\t<th>";
echo $dil["varis_yeri"];
echo "</th>\r\n\t\t\t\t\t\t\t\t\t\t\t\t<th>1-4 ";
echo $dil["kisi_sayisi"];
echo "</th>\r\n\t\t\t\t\t\t\t\t\t\t\t\t<th>5-8 ";
echo $dil["kisi_sayisi"];
echo "</th>\r\n\t\t\t\t\t\t\t\t\t\t\t\t<th>9-15 ";
echo $dil["kisi_sayisi"];
echo "</th>\r\n\t\t\t\t\t\t\t\t\t\t\t\t<th>16-30 ";
echo $dil["kisi_sayisi"];
echo "</th>\r\n\t\t\t\t\t\t\t\t\t\t\t\t<th> ";
echo $dil["mesafe"];
echo "</th>\r\n\t\t\t\t\t\t\t\t\t\t\t\t<th>";
echo $dil["rezervasyon"];
echo "</th>\r\n\t\t\t\t\t\t\t\t\t\t\t</tr>\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t";
foreach ($Bislem as $Sonuc) {
    echo "\t\t\t\t\t\t\t\t\t\t\t<tr class=\"item\" id=\"";
    echo $Sonuc["id"];
    echo "\">\r\n\t\t\t\t\t\t\t\t\t\t\t\t<td>";
    echo $Sonuc["alis"];
    echo "</td>\r\n\t\t\t\t\t\t\t\t\t\t\t\t<td>";
    echo $Sonuc["varis"];
    echo "</td>\r\n\t\t\t\t\t\t\t\t\t\t\t\t<td>";
    echo para_birim();
    echo " ";
    echo $Sonuc["t1_4"];
    echo "</td>\r\n\t\t\t\t\t\t\t\t\t\t\t\t<td>";
    echo para_birim();
    echo " ";
    echo $Sonuc["t5_8"];
    echo "</td>\r\n\t\t\t\t\t\t\t\t\t\t\t\t<td>";
    echo para_birim();
    echo " ";
    echo $Sonuc["t9_15"];
    echo "</td>\r\n\t\t\t\t\t\t\t\t\t\t\t\t<td>";
    echo para_birim();
    echo " ";
    echo $Sonuc["t16_30"];
    echo "</td>\r\n\t\t\t\t\t\t\t\t\t\t\t\t<td>";
    echo $Sonuc["mesafe"];
    echo " ";
    echo $dil["km"];
    echo "</td>\r\n\t\t\t\t\t\t\t\t\t\t\t\t<td><a data-toggle=\"modal\" data-target=\"#transfer_formu_";
    echo $Sonuc["id"];
    echo "\" data-backdrop=\"static\" data-keyboard=\"false\" style=\"padding: 7px 20px;height:auto;\" class=\"btn btn-primary-o btn-block\">";
    echo $dil["rezervasyon"];
    echo " <i class=\"fa fa-arrow-circle-o-right\"></i></a></td>\r\n\t\t\t\t\t\t\t\t\t\t\t</tr>\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t";
}
echo "\t\t\t\t\t\t\t\t\t\t</tbody>\r\n\t\t\t\t\t\t\t\t\t</table>\r\n\t\t\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t\t\t";
if ($limitayar["transfer_sayisi"] < $total) {
    echo "\t\t\t\t\t\t\t\t<div class=\"show-more daha\">\r\n\t\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\t<button class=\"btn btn-primary-o\">";
    echo $dil["daha_fazla"];
    echo "</button>\r\n\t\t\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t\t\t";
}
echo "                            </article>\r\n                        </div>\r\n                    </div>\r\n                </div>\r\n            </div>\r\n        </div>\r\n    </div>\r\n</section>\r\n";
$Sorgu = $db->prepare("SELECT * FROM transfer WHERE durum = ? AND dil = ? ORDER BY id ASC");
$Sorgu->execute(["1", $_SESSION["k_dil"]]);
$islem = $Sorgu->fetchALL(PDO::FETCH_ASSOC);
foreach ($islem as $Sonuc) {
    echo "\r\n<!-- Teklif Formu -->\r\n<div class=\"modal fade\" id=\"transfer_formu_";
    echo $Sonuc["id"];
    echo "\" role=\"dialog\">\r\n\t<div class=\"modal-dialog modal-md\">\r\n\r\n\t\t<!-- Modal content-->\r\n\t\t<div class=\"modal-content\">\r\n\t\t\t<div class=\"modal-header\">\r\n\t\t\t\t<button type=\"button\" class=\"close\" data-dismiss=\"modal\">&times;</button>\r\n\t\t\t\t<h4 class=\"modal-title\" style=\"display: inline-block;\">";
    echo $dil["transfer_rezervasyon"];
    echo "</h4>\r\n\t\t\t</div>\r\n\t\t\t<form method=\"post\" action=\"system/site_islemler.php\" class=\"comment-form\" autocomplete=\"off\">\r\n\t\t\t<div class=\"modal-body\"> \r\n\t\t\t\t\r\n\t\t\t\t<input type=\"hidden\" name=\"url\" value=\"";
    echo $_SERVER["REQUEST_URI"];
    echo "\" />\r\n\t\t\t\t<div class=\"row\">\r\n\t\t\t\t\t<div class=\"col-md-12\">\r\n\t\t\t\t\t\t<div class=\"transferbolgeleri\" style=\"margin-bottom:10px;\">\r\n\t\t\t\t\t\t\t<table>\r\n\t\t\t\t\t\t\t\t<tbody>\r\n\t\t\t\t\t\t\t\t\t<tr class=\"hidden-xs\">\r\n\t\t\t\t\t\t\t\t\t\t<th>";
    echo $dil["alis_yeri"];
    echo "</th>\r\n\t\t\t\t\t\t\t\t\t\t<th>";
    echo $dil["varis_yeri"];
    echo "</th>\r\n\t\t\t\t\t\t\t\t\t\t<th>";
    echo $dil["mesafe"];
    echo "</th>\r\n\t\t\t\t\t\t\t\t\t</tr>\r\n\t\t\t\t\t\t\t\t\t<tr>\r\n\t\t\t\t\t\t\t\t\t\t<td>";
    echo $Sonuc["alis"];
    echo "</td>\r\n\t\t\t\t\t\t\t\t\t\t<td>";
    echo $Sonuc["varis"];
    echo "</td>\r\n\t\t\t\t\t\t\t\t\t\t<td>";
    echo $Sonuc["mesafe"];
    echo " ";
    echo $dil["km"];
    echo "</td>\r\n\t\t\t\t\t\t\t\t\t</tr>\r\n\t\t\t\t\t\t\t\t</tbody>\r\n\t\t\t\t\t\t\t</table>\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=\"col-md-12\">\r\n\t\t\t\t\t\t<input type=\"text\" class=\"form-control transfer_form\" name=\"adsoyad\" placeholder=\"";
    echo $dil["ad_soyad"];
    echo "\">\r\n\t\t\t\t\t</div>\r\n\t\t\t\t\t<div class=\"col-md-12\">\r\n\t\t\t\t\t\t<input type=\"text\" class=\"form-control transfer_form\" name=\"email\" placeholder=\"";
    echo $dil["email"];
    echo "\">\r\n\t\t\t\t\t</div>\r\n\t\t\t\t\t<div class=\"col-md-12\">\r\n\t\t\t\t\t\t<input type=\"text\" class=\"form-control transfer_form\" name=\"telefon\" placeholder=\"";
    echo $dil["telefon"];
    echo "\">\r\n\t\t\t\t\t</div>\r\n\t\t\t\t\t<div class=\"col-md-12\">\r\n\t\t\t\t\t\t<input type=\"text\" class=\"form-control transfer_form\" name=\"havayolu\" placeholder=\"";
    echo $dil["havayolu"];
    echo "\">\r\n\t\t\t\t\t</div>\r\n\t\t\t\t\t<div class=\"col-md-12\">\r\n\t\t\t\t\t\t<input type=\"text\" class=\"form-control transfer_form\" name=\"kalkis\" placeholder=\"";
    echo $dil["kalkis"];
    echo "\">\r\n\t\t\t\t\t</div>\r\n\t\t\t\t\t<div class=\"col-md-12\">\r\n\t\t\t\t\t\t<input type=\"text\" class=\"form-control transfer_form dt-picker dt-start\" name=\"rezervasyontarih\" placeholder=\"";
    echo $dil["rezervasyon_tarih"];
    echo "\">\r\n\t\t\t\t\t</div>\r\n\t\t\t\t\t<div class=\"row\">\r\n\t\t\t\t\t\t<div class=\"col-md-12\">\r\n\t\t\t\t\t\t\t<div class=\"col-md-6\">\r\n\t\t\t\t\t\t\t\t<input type=\"text\" class=\"form-control transfer_form\" name=\"ucus\" placeholder=\"";
    echo $dil["ucus_no"];
    echo "\">\r\n\t\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t\t<div class=\"col-md-6\">\r\n\t\t\t\t\t\t\t\t<input type=\"text\" class=\"form-control transfer_form\" name=\"kisi\" placeholder=\"";
    echo $dil["kisi_sayisi"];
    echo "\">\r\n\t\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t</div>\t\t\t\t\t\r\n\t\t\t\t\t</div>\t\t\t\r\n\t\t\t\t\t<div class=\"col-md-12\">\r\n\t\t\t\t\t<textarea class=\"form-control transfer_form\" placeholder=\"";
    echo $dil["notunuz"];
    echo "\" rows=\"5\" name=\"notu\"></textarea>\t\t\t\t\t\r\n\t\t\t\t\t</div>\r\n\t\t\t\t</div>\t\t\t\r\n\t\t\t</div>\r\n\t\t\t<div class=\"modal-footer\">\r\n\t\t\t\t<input type=\"hidden\" name=\"alis\" value=\"";
    echo $Sonuc["alis"];
    echo "\" />\r\n\t\t\t\t<input type=\"hidden\" name=\"varis\" value=\"";
    echo $Sonuc["varis"];
    echo "\" />\r\n\t\t\t\t<input type=\"hidden\" name=\"mesafe\" value=\"";
    echo $Sonuc["mesafe"];
    echo "\" />\r\n\t\t\t\t<button name=\"transferbtn\" class=\"btn btn-primary transfer_form_btn\">";
    echo $dil["gonder"];
    echo "</button>\r\n\t\t\t\t<button type=\"button\" class=\"btn btn-default transfer_form_btn\" data-dismiss=\"modal\">";
    echo $dil["kapat"];
    echo "</button>\t\t\t\t\r\n\t\t\t</div>\r\n\t\t\t</form>\r\n\t\t</div>\r\n\r\n\t</div>\r\n</div>\r\n";
}
if ($_SESSION["transferbtn"] == "yes") {
    echo "\r\n\t\t<script>\r\n\t\tswal({\r\n\t\t\ttype: 'success',\r\n\t\t\ttitle: '" . $dil["basarili"] . "',\r\n\t\t\ttext: '" . $dil["mesajiniz_basarili_bir_sekilde"] . "',\r\n\t\t\tconfirmButtonText: '" . $dil["tamam"] . "',\r\n\t\t\ttimer: 5000\r\n\t\t})\r\n\t\t</script>";
    unset($_SESSION["transferbtn"]);
}
if ($_SESSION["transferbtn"] == "no") {
    echo "\r\n\t\t<script>\r\n\t\tswal({\r\n\t\t\ttype: 'error',\r\n\t\t\ttitle: '" . $dil["hata"] . "',\r\n\t\t\ttext: '" . $dil["hata_olustu"] . "',\r\n\t\t\tconfirmButtonText: '" . $dil["tamam"] . "',\r\n\t\t\ttimer: 5000\r\n\t\t})\r\n\t\t</script>";
    unset($_SESSION["transferbtn"]);
}
if ($_SESSION["transferbtn"] == "bos") {
    echo "\r\n\t\t<script>\r\n\t\tswal({\r\n\t\t\ttype: 'warning',\r\n\t\t\ttitle: '" . $dil["hata"] . "',\r\n\t\t\ttext: '" . $dil["lutfen_gerekli_alanlari_doldurunuz"] . "',\r\n\t\t\tconfirmButtonText: '" . $dil["tamam"] . "',\r\n\t\t\ttimer: 5000\r\n\t\t})\r\n\t\t</script>";
    unset($_SESSION["transferbtn"]);
}
if ($_SESSION["transferbtn"] == "mailhata") {
    echo "\r\n\t\t<script>\r\n\t\tswal({\r\n\t\t\ttype: 'error',\r\n\t\t\ttitle: '" . $dil["hata"] . "',\r\n\t\t\ttext: '" . $dil["smtp_mail_ayar"] . "',\r\n\t\t\tconfirmButtonText: '" . $dil["tamam"] . "',\r\n\t\t\ttimer: 5000\r\n\t\t})\r\n\t\t</script>";
    unset($_SESSION["transferbtn"]);
}
echo "<script type=\"text/javascript\">\r\n\$(function(){\r\n\t\$(\".daha\").click(function(){\r\n\t\tvar id = \$(\"table .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/transfer.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\$(\"table #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>";

?>