<?php


echo !defined("GUVENLIK") ? exit : NULL;
$ayar_dizi = $db->prepare("SELECT * FROM ayarlar WHERE id = ?");
$ayar_dizi->execute([1]);
if ($ayar_dizi->rowCount()) {
    $Sonuc = $ayar_dizi->fetch(PDO::FETCH_ASSOC);
    echo "<div class=\"page-header\">\r\n\t<div class=\"page-title mt-0 mb-0\">\r\n\t\t<h3>";
    echo $admindil["txt15_1"];
    echo "</h3>\r\n\t\t<div class=\"crumbs\">\r\n\t\t\t<ul id=\"breadcrumbs\" class=\"breadcrumb\">\r\n\t\t\t\t<li><a href=\"index.html\"><i class=\"icon-home menu-icon\"></i></a></li>\r\n\t\t\t\t<li><a href=\"";
    echo $sayfalink;
    echo "\">";
    echo $admindil["txt13"];
    echo "</a></li>\r\n\t\t\t\t<li class=\"active\"><a href=\"";
    echo $sayfalink;
    echo "\">";
    echo $admindil["txt15_1"];
    echo "</a></li>\r\n\t\t\t</ul>\r\n\t\t</div>\r\n\t</div>\r\n</div>\r\n<div class=\"row\">\r\n\t<div class=\"col-12 grid-margin stretch-card\">\r\n\t\t<div class=\"card\">\r\n\t\t\t<div class=\"card-body\">\t\r\n\t\t\t\t<div class=\"row\">\r\n\t\t\t\t\t<div class=\"col-12\">\r\n\t\t\t\t\t";
    $dizin = "../language/admin_dil.php";
    require_once "../language/admin_dil.php";
    $yazan = "";
    if (0 < count($admindil)) {
        echo "\t\t\t\t\r\n\t\t\t\t\t\t<div class=\"table-responsive\">\r\n\t\t\t\t\t\t\t<table id=\"editable-form\" class=\"table table-bordered user-list\">\r\n\t\t\t\t\t\t\t\t<thead>\r\n\t\t\t\t\t\t\t\t\t<tr>\r\n\t\t\t\t\t\t\t\t\t\t<th style=\"width:250px;\">Key</th>\r\n\t\t\t\t\t\t\t\t\t\t<th>Açıklama</th>\r\n\t\t\t\t\t\t\t\t\t</tr>\r\n\t\t\t\t\t\t\t\t</thead>\r\n\t\t\t\t\t\t\t\t<tbody>\r\n\t\t\t\t\t\t\t\t\t";
        $i = 1;
        foreach ($admindil as $key => $d) {
            echo "\t\t\t\t\t\t\t\t\t<tr>\r\n\t\t\t\t\t\t\t\t\t\t<td class=\"uneditable\">";
            echo $key;
            echo "</td>\r\n\t\t\t\t\t\t\t\t\t\t<td><input type=\"text\" name=\"text\" id=\"text";
            echo $i++;
            echo "\" value=\"";
            echo $d;
            echo "\" onchange=\"saveData(event,'";
            echo $key;
            echo "')\"><span style=\"display:none\">";
            echo $d;
            echo "</span></td>\t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t</tr>\r\n\t\t\t\t\t\t\t\t\t";
        }
        echo "\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>\t\t\r\n\t\t\t\t\t\t";
    } else {
        echo "\t\t\t\t\t\t<div class=\"alert alert-danger\">\r\n\t\t\t\t\t\t\t<strong>Kritik Hata!</strong> Dil dosyası bulunamadı veya içi boş acilen ";
        echo str_replace("/", "\\", $dizin);
        echo " yerini doldurun. Veya düzenleye basıp otomatik olarak ekleyebilirsiniz.\r\n\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t";
    }
    echo "\t\t\t\t\t</div>\r\n\t\t\t\t</div>\r\n\t\t\t</div>\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t</div>\r\n\t</div>\r\n\r\n</div>\r\n<style>\r\n    table input{\r\n        font-size:14px;\r\n        padding:5px 0px;\r\n        display:block;\r\n        width:100%;\r\n\t\tcolor: #03a9f4;\r\n\t\tcursor:pointer;\r\n        border:none;\r\n        background: transparent;\r\n        text-decoration: underline;\r\n        text-decoration-color: #0088cc;\r\n        text-decoration-style: dashed;\r\n\r\n    }\r\n    table input:focus{\r\n        outline: none;\r\n        border-bottom: 1px dashed #0088cc;\r\n        text-decoration: none;\r\n    }\r\n\ttable tr {\r\n \t\tbox-shadow: none;\r\n\t}\r\n</style>\r\n<script>\r\n\$(function() {\r\n\$('#editable-form').DataTable({\r\n  \"aLengthMenu\": [\r\n\t[5, 10, 15, -1],\r\n\t[5, 10, 15, \"Tümü\"]\r\n  ],\r\n  \"iDisplayLength\": 20,\r\n  \"language\": {\r\n\t\t\"url\":\"js/Turkish.json\"\r\n\t}\r\n});\r\n\r\n\$('#order-listing').each(function() {\r\n\tvar datatable = \$(this);\r\n\tvar search_input = datatable.closest('.dataTables_wrapper').find('div[id\$=_filter] input');\r\n\tsearch_input.attr('placeholder', 'Search');\r\n\tsearch_input.removeClass('form-control-sm');\r\n\tvar length_sel = datatable.closest('.dataTables_wrapper').find('div[id\$=_length] select');\r\n\tlength_sel.removeClass('form-control-sm');\r\n});\r\n});\r\nfunction saveData(event,key){\r\n\tvar value = \$('#'+event.target.id).val();\r\n\t\$.post(\"../_class/yonetim_islem.php\",{\r\n\t\tkey: key,\r\n\t\tvalue: value,\r\n\t\tadmindilchange:\"true\",\r\n\t\tdil_id:\"";
    echo $Sonuc["id"];
    echo "\"\r\n\t}, function(){\r\n\t\t";
    if ($_SESSION["rutbe"] == 0) {
        echo "\t\t\$.toast({\r\n\t\t  heading: 'Başarılı!',\r\n\t\t  text: 'Başarı ile guncellenmiştir.',\r\n\t\t  showHideTransition: 'slide',\r\n\t\t  icon: 'success',\r\n\t\t  loaderBg: '#fff',\r\n\t\t  position: 'top-right'\r\n\t\t})\r\n\t\t";
    } else {
        echo "\t\t\$.toast({\r\n\t\t  heading: 'Uyarı',\r\n\t\t  text: 'Demo hesapta işlem yapamassınız.!',\r\n\t\t  showHideTransition: 'slide',\r\n\t\t  icon: 'warning',\r\n\t\t  loaderBg: '#fff',\r\n\t\t  position: 'top-right'\r\n\t\t})\r\n\t\t";
    }
    echo "\t});\r\n}\r\n</script>\r\n";
   
} else {
    header("Location:" . $url . "/404.html");
    exit;
}

?>