<?php

//tab confirm restore items when ok is pressed

if(($_POST['act']== 'restore_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 = mysqli_query($dbc, "UPDATE controls SET status = 1  WHERE `id` = '$id'");
		if(!$query) { die(mysqli_error($dbc)); }
	}
	header("Location: gateway.php?act=trashed_control_boxs&is=Done successfully!"); // redirent after deleting
}
?>
