
<?php 


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