<?php

//tab confirm restore  when ok is pressed

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

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

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