<?php


if (isset($_GET["islem"]) == "duzenle") {
    $durum = "duzenle";
    $Sorgu = $db->prepare("SELECT * FROM bildirim_sablonu WHERE id = ?");
    $Sorgu->execute([$_GET["id"]]);
    if ($Sorgu->rowCount()) {
        $Sonuc = $Sorgu->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["txt33"];
        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["txt26"];
        echo "</a></li>\r\n\t\t\t\t<li class=\"active\"><a href=\"";
        echo $sayfalink;
        echo "\">";
        echo $admindil["txt33"];
        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\">\r\n\t\t\t\t<label class=\"badge badge-primary\" style=\"font-size:15px;\">";
        echo $Sonuc["sablon_adi"];
        echo "</label>\r\n\t\t\t\t<form class=\"forms-sample\" method=\"post\" action=\"../_class/yonetim_islem.php\" enctype=\"multipart/form-data\">\r\n\t\t\t\t<input id=\"id\" name=\"id\" type=\"hidden\" value=\"";
        echo $Sonuc["id"];
        echo "\">\r\n\t\t\t\t\t<div class=\"card mb-4\">\r\n\t\t\t\t\t\t<div class=\"card-header\">\r\n\t\t\t\t\t\t\tÜye'ye E-Posta Gönder\r\n\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t<div class=\"card-body m-0 p-0 pl-3\">\r\n\t\t\t\t\t\t\t<div class=\"form-check form-check-success d-inline-block mr-2\">\r\n\t\t\t\t\t\t\t\t<label class=\"form-check-label\">\r\n\t\t\t\t\t\t\t\t\t<input type=\"radio\" class=\"form-check-input\" name=\"ubildirim\" id=\"ubildirim_sec1\" value=\"1\" ";
        if ($Sonuc["ubildirim"] == "1") {
            echo " checked ";
        }
        echo " checked>\r\n\t\t\t\t\t\t\t\t\tAktif\r\n\t\t\t\t\t\t\t\t</label>\r\n\t\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t\t<div class=\"form-check form-check-danger d-inline-block mr-2\">\r\n\t\t\t\t\t\t\t\t<label class=\"form-check-label\">\r\n\t\t\t\t\t\t\t\t\t<input type=\"radio\" class=\"form-check-input\" name=\"ubildirim\" id=\"ubildirim_sec2\" value=\"0\" ";
        if ($Sonuc["ubildirim"] == "0") {
            echo " checked ";
        }
        echo ">\r\n\t\t\t\t\t\t\t\t\tPasif\r\n\t\t\t\t\t\t\t\t</label>\r\n\t\t\t\t\t\t\t</div>\t\t\t\t\t\t\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=\"card mb-4\">\r\n\t\t\t\t\t\t<div class=\"card-header\">\r\n\t\t\t\t\t\t\tÜye'ye SMS Gönder\r\n\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t<div class=\"card-body m-0 p-0 pl-3\">\r\n\t\t\t\t\t\t\t<div class=\"form-check form-check-success d-inline-block mr-2\">\r\n\t\t\t\t\t\t\t\t<label class=\"form-check-label\">\r\n\t\t\t\t\t\t\t\t\t<input type=\"radio\" class=\"form-check-input\" name=\"sbildirim\" id=\"sbildirim_sec1\" value=\"1\" ";
        if ($Sonuc["sbildirim"] == "1") {
            echo " checked ";
        }
        echo " checked>\r\n\t\t\t\t\t\t\t\t\tAktif\r\n\t\t\t\t\t\t\t\t</label>\r\n\t\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t\t<div class=\"form-check form-check-danger d-inline-block mr-2\">\r\n\t\t\t\t\t\t\t\t<label class=\"form-check-label\">\r\n\t\t\t\t\t\t\t\t\t<input type=\"radio\" class=\"form-check-input\" name=\"sbildirim\" id=\"sbildirim_sec2\" value=\"0\" ";
        if ($Sonuc["sbildirim"] == "0") {
            echo " checked ";
        }
        echo ">\r\n\t\t\t\t\t\t\t\t\tPasif\r\n\t\t\t\t\t\t\t\t</label>\r\n\t\t\t\t\t\t\t</div>\t\t\t\t\t\t\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=\"card mb-4\">\r\n\t\t\t\t\t\t<div class=\"card-header\">\r\n\t\t\t\t\t\t\tYönetici'ye E-Posta Gönder\r\n\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t<div class=\"card-body m-0 p-0 pl-3\">\r\n\t\t\t\t\t\t\t<div class=\"form-check form-check-success d-inline-block mr-2\">\r\n\t\t\t\t\t\t\t\t<label class=\"form-check-label\">\r\n\t\t\t\t\t\t\t\t\t<input type=\"radio\" class=\"form-check-input\" name=\"abildirim\" id=\"abildirim_sec1\" value=\"1\" ";
        if ($Sonuc["abildirim"] == "1") {
            echo " checked ";
        }
        echo " checked>\r\n\t\t\t\t\t\t\t\t\tAktif\r\n\t\t\t\t\t\t\t\t</label>\r\n\t\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t\t<div class=\"form-check form-check-danger d-inline-block mr-2\">\r\n\t\t\t\t\t\t\t\t<label class=\"form-check-label\">\r\n\t\t\t\t\t\t\t\t\t<input type=\"radio\" class=\"form-check-input\" name=\"abildirim\" id=\"abildirim_sec2\" value=\"0\" ";
        if ($Sonuc["abildirim"] == "0") {
            echo " checked ";
        }
        echo ">\r\n\t\t\t\t\t\t\t\t\tPasif\r\n\t\t\t\t\t\t\t\t</label>\r\n\t\t\t\t\t\t\t</div>\t\t\t\t\t\t\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=\"card mb-4\">\r\n\t\t\t\t\t\t<div class=\"card-header\">\r\n\t\t\t\t\t\t\tYönetici'ye SMS Gönder\r\n\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t<div class=\"card-body m-0 p-0 pl-3\">\r\n\t\t\t\t\t\t\t<div class=\"form-check form-check-success d-inline-block mr-2\">\r\n\t\t\t\t\t\t\t\t<label class=\"form-check-label\">\r\n\t\t\t\t\t\t\t\t\t<input type=\"radio\" class=\"form-check-input\" name=\"ysbildirim\" id=\"ysbildirim_sec1\" value=\"1\" ";
        if ($Sonuc["ysbildirim"] == "1") {
            echo " checked ";
        }
        echo " checked>\r\n\t\t\t\t\t\t\t\t\tAktif\r\n\t\t\t\t\t\t\t\t</label>\r\n\t\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t\t<div class=\"form-check form-check-danger d-inline-block mr-2\">\r\n\t\t\t\t\t\t\t\t<label class=\"form-check-label\">\r\n\t\t\t\t\t\t\t\t\t<input type=\"radio\" class=\"form-check-input\" name=\"ysbildirim\" id=\"ysbildirim_sec2\" value=\"0\" ";
        if ($Sonuc["ysbildirim"] == "0") {
            echo " checked ";
        }
        echo ">\r\n\t\t\t\t\t\t\t\t\tPasif\r\n\t\t\t\t\t\t\t\t</label>\r\n\t\t\t\t\t\t\t</div>\t\t\t\t\t\t\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=\"form-group ubildirim\">\r\n\t\t\t\t\t\t<label for=\"konu\">E-Posta Konu Başlığı (Üye)</label>\r\n\t\t\t\t\t\t<input type=\"text\" class=\"form-control form-control-sm\" name=\"konu\" id=\"konu\" value=\"";
        echo isset($_GET["islem"]) == "duzenle" ? $Sonuc["konu"] : "";
        echo "\" />\r\n\t\t\t\t\t</div>\t\t\t\t\t\t\t\r\n\t\t\t\t\t<div class=\"form-group abildirim\">\r\n\t\t\t\t\t\t<label for=\"konu2\">E-Posta Konu Başlığı (Yönetici)</label>\r\n\t\t\t\t\t\t<input type=\"text\" class=\"form-control form-control-sm\" name=\"konu2\" id=\"konu2\" value=\"";
        echo isset($_GET["islem"]) == "duzenle" ? $Sonuc["konu2"] : "";
        echo "\" />\r\n\t\t\t\t\t</div>\r\n\r\n\t\t\t\t\t<div class=\"form-group ubildirim\">\r\n\t\t\t\t\t\t<label for=\"adi\">Üye'ye Gidecek E-Posta</label>\r\n\t\t\t\t\t\t<textarea name=\"icerik\" id=\"myTextarea\">";
        echo isset($_GET["islem"]) == "duzenle" ? $Sonuc["icerik"] : "";
        echo "</textarea>\r\n\t\t\t\t\t</div>\r\n\t\t\t\t\t\r\n\t\t\t\t\t<div class=\"form-group abildirim\">\r\n\t\t\t\t\t\t<label for=\"adi\">Yönetici'ye Gidecek E-Posta</label>\r\n\t\t\t\t\t\t<textarea name=\"icerik2\" id=\"myTextarea\">";
        echo isset($_GET["islem"]) == "duzenle" ? $Sonuc["icerik2"] : "";
        echo "</textarea>\r\n\t\t\t\t\t</div>\r\n\t\t\t\t\t\r\n\t\t\t\t\t<div class=\"form-group sbildirim\">\r\n\t\t\t\t\t\t<label for=\"icerik3\">Üye'ye Gidecek SMS</label>\r\n\t\t\t\t\t\t<textarea name=\"icerik3\" class=\"form-control\" id=\"icerik3\" rows=\"9\">";
        echo isset($_GET["islem"]) == "duzenle" ? $Sonuc["icerik3"] : "";
        echo "</textarea>\r\n\t\t\t\t\t</div>\r\n\t\t\t\t\t\r\n\t\t\t\t\t<div class=\"form-group ysbildirim\">\r\n\t\t\t\t\t\t<label for=\"icerik4\">Yönetici'ye Gidecek SMS</label>\r\n\t\t\t\t\t\t<textarea name=\"icerik4\" class=\"form-control\" id=\"icerik4\" rows=\"9\">";
        echo isset($_GET["islem"]) == "duzenle" ? $Sonuc["icerik4"] : "";
        echo "</textarea>\r\n\t\t\t\t\t</div>\r\n\t\t\t\t\t<div class=\"alert alert-info\" role=\"alert\">\r\n\t\t\t\t\t\tDeğişkenler : <strong>";
        echo $Sonuc["degiskenler"];
        echo "</strong>  Belirtilen değişkenleri içerik'de istediğiniz yere koyarak bildirim'de belirtilmesini sağlayabilirsiniz.\r\n\t\t\t\t\t</div>\r\n\t\t\t\t\t<button type=\"submit\" name=\"sablon_guncelle\" class=\"btn btn-success btn-icon-text btn-sm\">\r\n\t\t\t\t\t\t<i class=\"mdi mdi-reload  btn-icon-prepend\"></i>                                                    \r\n\t\t\t\t\t\tKAYDET\r\n\t\t\t\t\t</button>\r\n\t\t\t\t</form>\r\n\t\t\t</div>\r\n\t\t</div>\r\n\t</div>\r\n\r\n</div>\r\n<script>\r\n\$(document).ready(function(e) {\r\n\t\$('input[name=ubildirim]').bind('change', ubildirim);\r\n\t\$('input[name=abildirim]').bind('change', abildirim);\r\n\t\$('input[name=sbildirim]').bind('change', sbildirim);\r\n\t\$('input[name=ysbildirim]').bind('change', ysbildirim);\r\n});\r\nfunction ubildirim(){\r\n\tvar secilen = \$(this).val();\r\n\tif (secilen == 0) {\r\n\t\t\$(\".ubildirim\").slideUp(500);\r\n\t} else {\r\n\t\t\$(\".ubildirim\").slideDown(500);\r\n\t}\r\n}\r\nfunction abildirim(){\r\n\tvar secilen = \$(this).val();\r\n\tif (secilen == 0) {\r\n\t\t\$(\".abildirim\").slideUp(500);\r\n\t} else {\r\n\t\t\$(\".abildirim\").slideDown(500);\r\n\t}\r\n}\r\nfunction sbildirim(){\r\n\tvar secilen = \$(this).val();\r\n\tif (secilen == 0) {\r\n\t\t\$(\".sbildirim\").slideUp(500);\r\n\t} else {\r\n\t\t\$(\".sbildirim\").slideDown(500);\r\n\t}\r\n}\r\nfunction ysbildirim(){\r\n\tvar secilen = \$(this).val();\r\n\tif (secilen == 0) {\r\n\t\t\$(\".ysbildirim\").slideUp(500);\r\n\t} else {\r\n\t\t\$(\".ysbildirim\").slideDown(500);\r\n\t}\r\n}\r\n\$('input[name=ubildirim]').ready(function(){\r\n\tvar secilen = \$(\"input[name=ubildirim]:checked\").val();\r\n\tif (secilen == 0) {\r\n\t\t\$(\".ubildirim\").slideUp(0);\r\n\t} else {\r\n\t\t\$(\".ubildirim\").slideDown(0);\r\n\t}\r\n});\r\n\r\n\$('input[name=abildirim]').ready(function(){\r\n\tvar secilen = \$(\"input[name=abildirim]:checked\").val();\r\n\tif (secilen == 0) {\r\n\t\t\$(\".abildirim\").slideUp(0);\r\n\t} else {\r\n\t\t\$(\".abildirim\").slideDown(0);\r\n\t}\r\n});\r\n\r\n\$('input[name=sbildirim]').ready(function(){\r\n\tvar secilen = \$(\"input[name=sbildirim]:checked\").val();\r\n\tif (secilen == 0) {\r\n\t\t\$(\".sbildirim\").slideUp(0);\r\n\t} else {\r\n\t\t\$(\".sbildirim\").slideDown(0);\r\n\t}\r\n});\r\n\r\n\$('input[name=ysbildirim]').ready(function(){\r\n\tvar secilen = \$(\"input[name=ysbildirim]:checked\").val();\r\n\tif (secilen == 0) {\r\n\t\t\$(\".ysbildirim\").slideUp(0);\r\n\t} else {\r\n\t\t\$(\".ysbildirim\").slideDown(0);\r\n\t}\r\n});\r\n\r\nfunction tumunu_gizle() {\r\n    \$(\".ubildirim,.abildirim,.sbildirim,.ysbildirim\").slideUp(500);\r\n}\r\n</script>\r\n";
        mesaj("sablon_guncelle", 1, "yes", "Başarı ile guncellenmiştir.");
        mesaj("sablon_guncelle", 2, "no", "Hata oluştu tekrar deneyiniz.!");
        echo "\t\r\n";
       
} else {
    header("Location:" . $url . "/index.html");
    exit;
}

?>