<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 projeler where id='$s'")->fetch(PDO::FETCH_ASSOC);
	 unlink('../../resimler/'.$resim_sorgu1['resim']);
	$simdii=$db->query("delete from projeler 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="proje-ekle"> <i class="fa fa-plus "></i>  Proje 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">Projeler</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>Proje Adı</strong></th>
                                        <th><strong>Kategori</strong></th>
                                        <th><strong>Görüntülenme</strong></th>
                                        <th><strong>Durum</strong></th>
                                        <th>İşlem</th>
                                    </tr>
                                </thead>
                                <tbody>




<?php

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

foreach($cek as $goster){

    $kat = $db->query("select * from proje_kategori where id='{$goster["kategori"]}'")->fetch(PDO::FETCH_ASSOC);

?>


  <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><strong><?=$goster["sira"]?></strong></td>
                                        <td><div class="d-flex align-items-center"><img href="hizmet-ekle?islem=duzenle&id=<?=$goster["id"]?>" src="../resimler/<?=$goster["resim"]?>" alt="<?=$goster["adi"]?>" class="rounded-lg me-2" width="30" alt=""/> <span class="w-space-no"><?=$goster["adi"]?></span></div></td>
                                      
                                        <td><?=$kat["adi"]?></td>
                                       <td><?=$goster["hit"]?></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>
                                            <div class="d-flex">
                                                <a href="proje-ekle?islem=duzenle&id=<?=$goster["id"]?>" class="btn btn-primary shadow btn-xs sharp me-1"><i class="fas fa-pencil-alt"></i></a>
                                                <a target="_blank" href="../<?=$goster["seo"]?>" class="btn btn-danger shadow btn-xs sharp"><i class="fa fa-eye"></i></a>
                                            </div>
                                        </td>
                                    </tr>






<?php }?>

                          </tbody>
                            </table>
                        </div>
                    </div>
                </div>
            </div>
            
                </div>
            </div>
        </div>