<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 sayfalar where id='$s'")->fetch(PDO::FETCH_ASSOC);
	 unlink('../../resimler/'.$resim_sorgu1['resim']);
	$simdii=$db->query("delete from sayfalar 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="sayfa-ekle"> <i class="fa fa-plus "></i>  Sayfa 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">sayfalar</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><strong>Sıra</strong></th>
                                        <th><strong>Adı</strong></th>
                                        <th><strong>Eklenme Tarihi</strong></th>
                                        <th><strong>Durum</strong></th>
                                        <th>İşlem</th>
                                    </tr>
                                </thead>
                                <tbody> 



<?php

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

foreach($cek as $goster){

?>

<tr>

<td>

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

                                            </div>

</td>

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



 <td><div class="d-flex align-items-center"><img href="hizmet-ekle?islem=duzenle&id=<?=$goster["id"]?>" src="../resimler/<?=$goster["resim"]?>" class="rounded-lg me-2" width="30" alt=""/> <span class="w-space-no"><?=$goster["adi"]?></span></div></td>

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

<td><?php if($goster["durum"]==0){ echo "Aktif";}else {echo"Pasif";}?></td>

<td>

<a class="me-3" href="sayfa-ekle?islem=duzenle&id=<?=$goster["id"]?>">

<img src="assets/img/icons/edit.svg" alt="img">

</a>



</td>

</tr>

<?php }?>
                   </tbody>
                            </table>
                        </div>
                    </div>
                </div>
            </div>
            
                </div>
            </div>
        </div>