<?php

//tab confirm restore users when ok is pressed

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