<div class="content-body">
    <div class="container-fluid">
        <div class="page-wrapper">
    <?php
if(isset($_POST['sil'])){
	
	$sil=$_POST['toplu_sil'];
	$sill = implode(",",$sil);
	
	foreach($sil as $s){
		
	$resim_sorgu1=$db->query("select * from istatik where id='$s'")->fetch(PDO::FETCH_ASSOC);
	 unlink('../../resimler/'.$resim_sorgu1['resim']);
	$simdii=$db->query("delete from istatik where id='$s'")->fetch(PDO::FETCH_ASSOC);
	}
	
}
?>

   <form method="post">
<div class="content">
    
    <div class="row page-titles mx-0">
            <div class="col-sm-6 p-md-0">
                <div class="welcome-text">
                    
                </div>
            </div>
            <div class="col-sm-6 p-md-0 justify-content-sm-end mt-2 mt-sm-0 d-flex">
                <ol class="breadcrumb">
                   
                    <li class="breadcrumb-item active"><a href="istatik-ekle"> <i class="fa fa-plus "></i>  İstatik Ekle</a></li>
                </ol>
               &nbsp;&nbsp; <div class="page-btn">


   <input type="submit" name="sil" class="btn btn-primary" value="Seçilenleri Sil">

</div>
            </div>
        </div>
        


<div class="card">
    <div class="card-header">
                        <h4 class="card-title">İstatikler</h4>
                    </div>



<div class="card-body">
                            <table class="table table-responsive-md">
                                <thead>
                                    <tr>
                                       
                                        <th>
<label class="checkboxs">
<input type="checkbox" class="form-check-input" id="checkAll">
<span class="checkmarks"></span>
</label>
</th>
											<th>Sıra</th>
											<th>Adı</th>
											<th>Eklenme Tarihi</th>
											<th>Durum</th>
											<th>İşlem</th>
                                    </tr>
                                </thead>
                                <tbody>




<?php

$cek = $db->query("select * from istatik order by id desc")->fetchAll(PDO::FETCH_ASSOC);

foreach($cek as $goster){

?>

<tr>

<td>

 <input type="checkbox" class="form-check-input" name="toplu_sil[]" value="<?=$goster["id"]?>">
                                                <label class="form-check-label" for="customCheckBox2"></label>

</label>

</td>

<td><?=$goster["sira"]?></td>



<td class="productimgname">



<a href="istatik-ekle?islem=duzenle&id=<?=$goster["id"]?>"><?=$goster["adi"]?></a>

</td>

<td><?=$goster["eklenme_tarihi"]?></td>

<td><div class="d-flex align-items-center"><i class="fa fa-circle text-success me-1"></i> <?php if($goster["durum"]==0){ echo "Aktif";}else {echo"Pasif";}?></div></td>

<td>


<a href="istatik-ekle?islem=duzenle&id=<?=$goster["id"]?>" class="btn btn-primary shadow btn-xs sharp me-1"><i class="fas fa-pencil-alt"></i></a>


</td>

</tr>

<?php }?>

</tbody>

</table>

</div>

</div>

</div>



</div></form>

</div>