<?php 

if(($_POST['act']== 'publish_events')) {
	$id_array = $_POST['event']; // return array
	$id_count = count($_POST['event']); // count array
	
	for($i=0; $i < $id_count; $i++) {
		$id = $id_array[$i];
		$query = mysqli_query(dbc(),"UPDATE events SET status =  0  WHERE `id` = '$id'");
		if(!$query) { die(mysql_error()); }
	}
	header("Location: gateway.php?act=view_events&is=Successfully Published"); // redirent after deleting
}
?>