<?php

//tab confirm restore users when ok is pressed

if(($_POST['act']== 'restore_hostel_category')) {
	$id_array = $_POST['user']; // return array
	$id_count = count($_POST['user']); // count array

	for($i=0; $i < $id_count; $i++) {
		$id = $id_array[$i];

		$query = mysqli_query($conn_1, "UPDATE hostel_blocks SET status = '1', trashed='0', date_modified = NOW()  WHERE `id` = '$id'");
		if(!$query) { die(mysqli_error($conn_1)); }
	}
	header("Location: gateway.php?act=trashed_hostel_categories&is=Done successfully!"); // redirent after deleting
}
?>
