<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
	<title>DİJ-EĞİTİM </title>

	<link rel="stylesheet" href="css/style.css">

	<script src="https://kit.fontawesome.com/52d8d9fe06.js" crossorigin="anonymous"></script>


<style>
#customers {
  font-family: Arial, Helvetica, sans-serif;
  border-collapse: collapse;
  width: 100%;
}

#customers td, #customers th {
  border: 1px solid #ddd;
  padding: 8px;
}

#customers tr:nth-child(even){background-color: #f2f2f2;}

#customers tr:hover {background-color: #ddd;}

#customers th {
  padding-top: 12px;
  padding-bottom: 12px;
  text-align: left;
  background-color: #003666;
  color: white;
}
</style>
</head>
<body>
  <section id="menu">
	   <div 
	   id="logo">Gelen Mesajlar</div>
	    <nav>
           <a href="Admin.php"><i class="fa-solid fa-graduation-cap"></i>Eğitim Ekle</a>
		       <a href="Adminegitim.php"><i class="fa-solid fa-pen-to-square"></i>Eğitimleri Düzenle</a>
           <a href="Admingiris.php"><i class="fa-solid fa-arrow-right-from-bracket ikon"></i>Çıkış</a>

       </nav>
  </section>

<table id="customers">
  <tr>
    <th>Ad Soyad</th>
    <th>Telefon</th>
    <th>Email</th>
    <th>Konu</th>
    <th>Mesaj</th>
    <th>Sil</th>
  </tr>


  <?php

  session_start();
  if($_SESSION["user"]=="")
  {
    echo"<script>window.location.href='cikis.php'</script>";
  }

  else
  {
    include("baglanti.php");

    $sec="Select * From iletisim";
    $sonuc=$baglan->query($sec);
    
    if($sonuc->num_rows>0){
      while($cek=$sonuc->fetch_assoc()){
        echo"
          <tr>
            <td>".$cek['adsoyad']."</td>
            <td>".$cek['telefon']."</td>
            <td>".$cek['email']."</td>
            <td>".$cek['konu']."</td>
            <td>".$cek['mesaj']."</td>
            <td><a href='sil.php?id=".$cek['id']."' onclick='return confirm(\"Silmek istediğinize emin misiniz?\")'>Sil</a></td>
            </tr>
        ";
      }
    
    }
    
    else{
        echo "Veritabanında Kayıtlı Hiçbir Veri Bulunamamıştır.";
    }
    

  }


?>




  
</table>

</body>
</html>
  

