<?php


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

	for($i=0; $i < $id_count; $i++) {
		$id = $id_array[$i];
		$query = mysqli_query($dbc, "UPDATE `pictures` SET status = 2, date_trashed = NOW() WHERE `id` = '$id'");
		if(!$query) { die(mysqli_error($dbc)); }
	}
	header("Location: gateway.php?act=view_pictures&is=Successfully Deleted"); // redirent after deleting
}
?>
