<?php 


if(($_POST['act']== 'unblock_control_boxs')) {
	$id_array = $_POST['control_box']; // return array
	$id_count = count($_POST['control_box']); // count array
	
	for($i=0; $i < $id_count; $i++) {
		$id = $id_array[$i];
		$query = mysql_query("UPDATE  `controls`  SET active = 1 WHERE `id` = '$id'");
		if(!$query) { die(mysql_error()); }
	}
	header("Location: gateway.php?act=view_control_boxs&is=Update done successfully."); // redirent after deleting
}
?>