<?php
include "../koneksi.php";

if(isset($_POST["but"]))   
    $kat=$_POST['r'];
    $p=$_POST['p'];
    { 
        $cek = count($_POST["cek"]);
        
        if($cek == 0)
        {
            echo "<script>alert('tidak ada data terpilih');location='?page=komentar_warga</script>";
        }
        else
        {
            for($i=0; $i < $cek;$i++)
            {
                $ID=$_POST["cek"][$i];
            $hapus=mysql_query("delete from komentar  where id_komentar='$ID'");
            }
            if($hapus)
            {
             echo "<script>alert('data berhasil terhapus');location='?page=komentar_warga'</script>";
            }
            
        }
    }

?>