<?php
include('spaceship/krypton.php');
error_reporting(0);
ini_set('display_errors', 0);

if(isset($_REQUEST['deleteall'])){
	$userid = mysqli_real_escape_string($krypton, $_POST['usesid']);
if($_REQUEST['check'] == NULL) {

       echo '
    <script>
    alert("Harus Pilih dahulu Nomor yang ingin dihapus!!");
    window.location.href = "/admsuper";
    </script>
    ';

} else {

    $checkbox =  $_REQUEST['check'];
    $todayupdate = date("Y-m-d H:i:s");
    
    	for($i=0;$i<count($checkbox);$i++){
	$del_id = $checkbox[$i]; 
	$del = mysqli_query($krypton,"UPDATE justicewonder SET trashed='1', update_oleh = '$userid', tanggal_hapus = '$todayupdate' WHERE id='".$del_id."'");
	
}

if($del) {
      echo '
    <script>
    alert("Berhasil Di Hapus Semua!!");
    window.location.href = "/admsuper";
    </script>
    ';

} else {
    echo '
    <script>
    alert("Gagal Di Hapus Semua!!");
    window.location.href = "/admsuper";
    </script>
    ';
}


}


}

?>