<?php

//tab confirm delete users delete users when ok is pressed

if(($_POST['act']== 'delete_hostel_categories')) {
	$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 = mysql_query("DELETE FROM `users` WHERE `user_id` = '$id'");
		$query = mysqli_query($conn_1, "UPDATE hostel_blocks SET status = '2', trashed='1', trash_delete_date = NOW()  WHERE `id` = '$id'");
		if(!$query) { die(mysqli_error($conn_1)); }
	}
	header("Location: gateway.php?act=view_hostel_categories&is=Successfully deleted to trash"); // redirent after deleting
}
?>
