<?php 

if(($_POST['act']== 'publish_roles')) {
	$id_array = $_POST['role']; // return array
	$id_count = count($_POST['role']); // count array
	
	for($i=0; $i < $id_count; $i++) {
		$id = $id_array[$i];
		$query = mysql_query("UPDATE roles SET status =  0  WHERE `role_id` = '$id'");
		if(!$query) { die(mysql_error()); }
	}
	header("Location: gateway.php?act=view_roles&is=Successfully Published"); // redirent after deleting
}
?>