<?php include("header.php");?>
<?php 
if(isset($_POST['tsil'])){
	$id = implode(",", $_POST["sil"]);
	if(empty($id)){
	
	}else{
	$delete = Sorgu("DELETE FROM iletisim WHERE id IN($id)");
	if($delete){
		  header("Location:mesajlar.php");
		}else{
	
		}
	}
}
?>


 <!--main content start-->
       <!--main content start-->
      <section id="main-content">
          <section class="wrapper">
              <!--mail inbox start-->
              <div class="mail-box">
          
                  <aside class="lg-side">
                      <div class="inbox-head">
                          <h3>Gelen Kutusunda <?php echo say($mesajSorgu);?> mesaj var.</h3>
                         
                      </div>
             <form action="" method="post" id="form1">
                          <table class="table table-inbox table-hover">
                            <tbody>
                        
                        
                   
                           <?php $MesajSorgu = Sorgu("SELECT * FROM iletisim");
					  if(!mysql_affected_rows()){?>
					  			<tr>
                            <td colspan="5">
                                 Mesaj Bulunamadı.
                            </td>
                        </tr>  
					<?php }else{
					  while($MesajSonuc = Sonuc($MesajSorgu)){?>
                             
                              <tr class="">
                        
                                  <td class="inbox-small-cells"><i class="fa fa-envelope"></i></td>
                                  <td class="view-message dont-show"><a href="mesajoku.php?id=<?php echo $MesajSonuc->id; ?>"><?php echo $MesajSonuc->isim; ?></a> <span class="label label-info pull-right"><?php echo $MesajSonuc->konu; ?></span></td>
                                  <td class="view-message view-message"><?php echo kisalt($MesajSonuc->mesaj,40); ?></td>
                                  <td class="view-message inbox-small-cells"></td>
                                  <td class="view-message text-right"><?php echo $MesajSonuc->tarih; ?></td>
								   <td class="view-message text-right"> <a href="mesajoku.php?id=<?php echo $MesajSonuc->id; ?>"  class="btn btn-primary btn-xs"><i class="fa fa-pencil"></i></a></td>
                              </tr>
							
							  
							  
							  	<?php }} ?>
					
                          </tbody>
                          </table>  </form>
                      </div>
                  </aside>
              </div>
              <!--mail inbox end-->
          </section>
      </section>
 

<?php include("footer.php");?>