<?php
include "../koneksi.php";

if(isset($_POST["but"]))
    $r=$_POST['kat'];
   
    { 
        $cek = count($_POST["cek"]);
        
        if($cek == 0)
        {
            echo "<script>alert('tidak ada data terpilih');location='?page=kategori_warga2&dp=$r'</script>";
        }
        else
        {
            for($i=0; $i < $cek;$i++)
            {
                $ID=$_POST["cek"][$i];
            $hapus=mysql_query("delete from data_warga  where id_warga='$ID'");
            }
            if($hapus)
            {
             echo "<script>alert('data berhasil terhapus');location='?page=kategori_warga2&dp=$r'</script>";
            }
            
        }
    }

?>