

<?php 


if(($_POST['act']== 'delete_news')) {
	$id_array = $_POST['news']; // return array
	$id_count = count($_POST['news']); // count array
	
	for($i=0; $i < $id_count; $i++) {
		$id = $id_array[$i];
		$query = mysql_query("UPDATE `news` SET status = 2, date_trashed = NOW() WHERE `id` = '$id'");
		if(!$query) { die(mysql_error()); }
	}
	header("Location: gateway.php?act=view_news&is=Successfully Deleted"); // redirent after deleting
}
?>