<?php


echo "\r\n<div class=\"content\">\r\n\t<div class=\"container\">\r\n\r\n\t\t<!-- Page-Title -->\r\n\t\t<div class=\"row\">\r\n\t\t\t<div class=\"col-sm-12\">\r\n\t\t\t\t<div class=\"btn-group pull-right m-t-15\">\r\n\t\t\t\t\t<button type=\"button\" class=\"btn btn-default dropdown-toggle waves-effect waves-light\" data-toggle=\"dropdown\" aria-expanded=\"false\">Düzenleme Dili <strong>";
echo $mevcutDil["adi"];
echo "</strong></button>\r\n\t\t\t\t\t<div class=\"dropdown-menu dropdown-menu-right\" aria-labelledby=\"btnGroupDrop1\">\r\n\t\t\t\t\t\t";
$DILSorgu = $db->prepare("SELECT * FROM diller ORDER BY sira ASC");
$DILSorgu->execute();
$DILislem = $DILSorgu->fetchALL(PDO::FETCH_ASSOC);
echo "\t\t\t\t\t\t\t";
foreach ($DILislem as $DILSonuc) {
    echo "\t\t\t\t\t\t\t<a class=\"dropdown-item\" href=\"mesajlar.html?dil=";
    echo $DILSonuc["id"];
    echo "\">";
    echo $DILSonuc["adi"];
    echo "</a>\r\n\t\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\t<h4 class=\"page-title\">";
echo $admindil["txt45"];
echo "</h4>\r\n\t\t\t\t<ol class=\"breadcrumb\">\r\n\t\t\t\t\t<li><a href=\"index.html\">";
echo $admindil["txt1"];
echo "</a></li>\r\n\t\t\t\t\t<li><a href=\"mesajlar.html\">";
echo $admindil["txt45"];
echo "</a></li>\r\n\t\t\t\t\t<li class=\"active\">Gelen Kutusu</li>\r\n\t\t\t\t</ol>\r\n\t\t\t</div>\r\n\t\t</div>\r\n\r\n\t\t<div class=\"row\">\r\n\t\t\r\n\t\t\t<!-- Right Sidebar -->\r\n\t\t\t<div class=\"col-lg-12 col-md-12\">\r\n\t\t\t<form action=\"../system/panel_islemler.php\" method=\"post\" id=\"form1\">\r\n\t\t\t\t<div class=\"row\">\r\n\t\t\t\t\t<div class=\"col-lg-12\">\r\n\t\t\t\t\t\t<div class=\"btn-toolbar m-t-20\" role=\"toolbar\" style=\"display: inline-block;\">\r\n\t\t\t\t\t\t\t<div class=\"btn-group\">\r\n\t\t\t\t\t\t\t\t<button name=\"secilen_sil\" class=\"btn btn-primary waves-effect waves-light \"><i class=\"fa fa-trash-o\"></i></button>\r\n\t\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t\t<div class=\"btn-group\">\r\n\t\t\t\t\t\t\t\t<button type=\"button\" class=\"btn btn-primary dropdown-toggle waves-effect waves-light\" data-toggle=\"dropdown\" aria-expanded=\"false\">\r\n\t\t\t\t\t\t\t\t<i class=\"fa fa-folder\"></i>\r\n\t\t\t\t\t\t\t\t<b class=\"caret\"></b>\r\n\t\t\t\t\t\t\t\t</button>\r\n\t\t\t\t\t\t\t\t<ul class=\"dropdown-menu\" role=\"menu\">\r\n\t\t\t\t\t\t\t\t\t<li><button class=\"dropdown-item\" name=\"secilen_okunmadi\">Okunmadı olarak işaretle</button></li>\r\n\t\t\t\t\t\t\t\t\t<li><button class=\"dropdown-item\" name=\"secilen_okundu\">Okundu olarak işaretle</button></li>\r\n\t\t\t\t\t\t\t\t</ul>\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\t<div class=\"input-group input-medium form-inline pull-right m-t-20\">\r\n\t\t\t\t\t\t\t<input type=\"text\" class=\"form-control\" name=\"mesajara\" placeholder=\"Mesaj Ara\">\r\n\t\t\t\t\t\t</div>\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t</div>\r\n\t\t\t\t</div> <!-- End row -->\r\n\t\t\t\t\r\n\t\t\t\t<div class=\"panel panel-default m-t-20\">\r\n\t\t\t\t\t<div class=\"panel-body p-0\">\r\n\t\t\t\t\t\t<div class=\"table-responsive\">\r\n\t\t\t\t\t\t\t<table class=\"table table-hover mails m-0\">\r\n\t\t\t\t\t\t\t\t<tbody id=\"mesajliste\">\r\n\t\t\t\t\t\t\t\t";
$Page = intval($_GET["Page"]);
if (!$Page) {
    $Page = 1;
}
$Say = $db->query("SELECT * FROM iletisim");
$ToplamVeri = $Say->rowCount();
$Limit = 10;
$SayfaSayisi = ceil($ToplamVeri / $Limit);
if ($SayfaSayisi < $Page) {
    $Page = 1;
}
$Goster = $Page * $Limit - $Limit;
$Sorgu = $db->prepare("SELECT * FROM iletisim ORDER BY id DESC LIMIT " . $Goster . "," . $Limit);
$Sorgu->execute();
if (!$Sorgu->rowCount()) {
    echo "\t\t\t\t\t\t\t\t\t<tr class=\"unread\" data-messageid=\"1\">\r\n\t\t\t\t\t\t\t\t\t\t<td colspan=\"4\" align=\"center\"><h5>Mesaj Bulunamadı.</h5></td>\r\n\t\t\t\t\t\t\t\t\t</tr>\r\n\t\t\t\t\t\t\t\t";
} else {
    $islem = $Sorgu->fetchALL(PDO::FETCH_ASSOC);
    echo "\t\t\t\t\t\t\t\t";
    foreach ($islem as $Sonuc) {
        echo "\t\t\t\t\t\t\t\t\t<tr ";
        echo $Sonuc["durum"] == "0" ? "class=\"unread\"" : "";
        echo " >\r\n\t\t\t\t\t\t\t\t\t\t<td class=\"mail-select\">\r\n\t\t\t\t\t\t\t\t\t\t\t<div class=\"checkbox checkbox-primary m-r-15\">\r\n\t\t\t\t\t\t\t\t\t\t\t\t<input id=\"checkbox";
        echo $Sonuc["id"];
        echo "\" name=\"id[]\" value=\"";
        echo $Sonuc["id"];
        echo "\" type=\"checkbox\">\r\n\t\t\t\t\t\t\t\t\t\t\t\t<label for=\"checkbox";
        echo $Sonuc["id"];
        echo "\"></label>\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";
        echo $Sonuc["txtAd"];
        echo " ";
        echo $Sonuc["txtSoyad"];
        echo "\t\t\r\n\t\t\t\t\t\t\t\t\t\t</td>\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t<td>\r\n\t\t\t\t\t\t\t\t\t\t\t<a href=\"mesaj-oku.html?id=";
        echo $Sonuc["id"];
        echo "\" class=\"email-name\">";
        echo $Sonuc["konu"];
        echo "</a>\r\n\t\t\t\t\t\t\t\t\t\t</td>\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t<td>\r\n\t\t\t\t\t\t\t\t\t\t\t<a href=\"mesaj-oku.html?id=";
        echo $Sonuc["id"];
        echo "\" class=\"email-msg\">";
        echo kisalt($Sonuc["mesaj"], 50);
        echo "</a>\r\n\t\t\t\t\t\t\t\t\t\t</td>\r\n\t\t\t\t\t\t\t\t\t\t<td class=\"text-right\">\r\n\t\t\t\t\t\t\t\t\t\t\t";
        echo $Sonuc["tarih"];
        echo "\t\t\t\t\t\t\t\t\t\t</td>\r\n\t\t\t\t\t\t\t\t\t</tr>\r\n\t\t\t\t\t\t\t\t";
    }
}
echo "\t\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\r\n\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\r\n\t\t\t\t\t</div> <!-- panel body -->\r\n\t\t\t\t</div> <!-- panel -->\r\n\t\t\t\t\r\n\t\t\t\t<div class=\"row\">\r\n\t\t\t\t\t<div class=\"col-xs-7\">\r\n\t\t\t\t\t\tGöster ";
echo $Page;
echo " - ";
echo $Limit;
echo " Toplam ";
echo $SayfaSayisi;
echo "\t\t\t\t\t</div>\r\n\t\t\t\t\t";
if ($Page) {
    echo "\t\t\t\t\t<div class=\"col-xs-5\">\r\n\t\t\t\t\t\t<div class=\"btn-group pull-right\">\r\n\t\t\t\t\t\t";
    if (1 < $Page) {
        echo "\t\t\t\t\t\t  <a href=\"mesajlar.html?Page=";
        echo $Page - 1;
        echo "\" class=\"btn btn-default waves-effect\"><i class=\"fa fa-chevron-left\"></i></a>\r\n\t\t\t\t\t\t";
    }
    echo "\t\t\t\t\t\t";
    if ($Page < $SayfaSayisi) {
        echo "\t\t\t\t\t\t";
        if ($Page != $SayfaSayisi) {
            echo "\t\t\t\t\t\t  <a href=\"mesajlar.html?Page=";
            echo $Page + 1;
            echo "\" class=\"btn btn-default waves-effect\"><i class=\"fa fa-chevron-right\"></i></a>\r\n\t\t\t\t\t\t";
        }
        echo "\t\t\t\t\t\t";
    }
    echo "\t\t\t\t\t\t</div>\r\n\t\t\t\t\t</div>\r\n\t\t\t\t\t";
}
echo "\t\t\t\t</div>\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t</form>\r\n\t\t\t</div> <!-- end Col-9 -->\r\n\t\t\r\n\t\t</div><!-- End row -->\r\n\r\n\r\n\r\n\t</div> <!-- container -->\r\n\t\t\t   \r\n</div> <!-- content -->\r\n<script>\r\njQuery.expr[':'].contains = function(a, i, m) {\r\nreturn jQuery(a).text().toUpperCase()\r\n.indexOf(m[3].toUpperCase()) >= 0;\r\n};\r\nvar eleman=document.getElementsByName('id[]');\r\nvar eleman_sayisi = eleman.length;\r\nvar durum = false;\r\nfunction sec(){\r\n\tfor(var i=0;i<=eleman_sayisi-1;i++){\r\n\t\tif(durum) eleman[i].checked=false;\r\n\t\telse eleman[i].checked=true;\r\n\t}\r\n\tif(durum) durum=false;\r\n\telse durum=true;\r\n}\r\n\r\n\$(function()\r\n{\r\n\t\$(\"input[name=mesajara]\").keyup(function()\r\n\t{\r\n\t\tvar deger = \$(this).val();\r\n\t\tif(deger.length > 0)\r\n\t\t{\r\n\t\t\t\$(\"#mesajliste tr:not(:contains('\"+deger+\"'))\").hide();\t\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t\$(\"#mesajliste tr\").show();\r\n\t\t}\r\n\t});\r\n\t\r\n});\r\n</script>\r\n";
if ($_SESSION["mesajsil"] == "yes") {
    echo "\r\n\t<script>\r\n\t\$(document).ready(function () {\r\n\t\t\$.Notification.autoHideNotify('success', 'top right', 'Başarılı!','Başarı ile silinmiştir.')\r\n\t});\r\n\t</script>";
    unset($_SESSION["mesajsil"]);
}
if ($_SESSION["mesajsil"] == "no") {
    echo "\r\n\t<script>\r\n\t\$(document).ready(function () {\r\n\t\t\$.Notification.autoHideNotify('error', 'top right', 'Hata!','Hata oluştu tekrar deneyiniz.!')\r\n\t});\r\n\t</script>";
    unset($_SESSION["mesajsil"]);
}
echo "\r\n";
if ($_SESSION["secilen_sil"] == "yes") {
    echo "\r\n\t<script>\r\n\t\$(document).ready(function () {\r\n\t\t\$.Notification.autoHideNotify('success', 'top right', 'Başarılı!','Başarı ile silindi.')\r\n\t});\r\n\t</script>";
    unset($_SESSION["secilen_sil"]);
}
if ($_SESSION["secilen_sil"] == "no") {
    echo "\r\n\t<script>\r\n\t\$(document).ready(function () {\r\n\t\t\$.Notification.autoHideNotify('error', 'top right', 'Hata!','Hata oluştu tekrar deneyiniz.!')\r\n\t});\r\n\t</script>";
    unset($_SESSION["secilen_sil"]);
}
if ($_SESSION["secilen_okundu"] == "yes") {
    echo "\r\n\t<script>\r\n\t\$(document).ready(function () {\r\n\t\t\$.Notification.autoHideNotify('success', 'top right', 'Başarılı!','Okundu olarak işaretlendi.')\r\n\t});\r\n\t</script>";
    unset($_SESSION["secilen_okundu"]);
}
if ($_SESSION["secilen_okundu"] == "no") {
    echo "\r\n\t<script>\r\n\t\$(document).ready(function () {\r\n\t\t\$.Notification.autoHideNotify('error', 'top right', 'Hata!','Hata oluştu tekrar deneyiniz.!')\r\n\t});\r\n\t</script>";
    unset($_SESSION["secilen_okundu"]);
}
if ($_SESSION["secilen_okunmadi"] == "yes") {
    echo "\r\n\t<script>\r\n\t\$(document).ready(function () {\r\n\t\t\$.Notification.autoHideNotify('success', 'top right', 'Başarılı!','Okunmadı olarak işaretlendi.')\r\n\t});\r\n\t</script>";
    unset($_SESSION["secilen_okunmadi"]);
}
if ($_SESSION["secilen_okunmadi"] == "no") {
    echo "\r\n\t<script>\r\n\t\$(document).ready(function () {\r\n\t\t\$.Notification.autoHideNotify('error', 'top right', 'Hata!','Hata oluştu tekrar deneyiniz.!')\r\n\t});\r\n\t</script>";
    unset($_SESSION["secilen_okunmadi"]);
}
if ($_SESSION["secilen"] == "no") {
    echo "\r\n\t<script>\r\n\t\$(document).ready(function () {\r\n\t\t\$.Notification.autoHideNotify('error', 'top right', 'Hata!','Lütfen önce seçim işlemi yapınız.!')\r\n\t});\r\n\t</script>";
    unset($_SESSION["secilen"]);
}

?>