<?php
include("../session.php");
include("../connect.php");

$user=$_SESSION['company'];

date_default_timezone_set ("Singapore"); 
$date=date("d-m-Y", time());
$time=date("h:i:sa", time());

$getAction=$_POST["checkAction"];
$getID=$_POST["id"];

if ($getAction=='Restore'){
	mysql_query("UPDATE product SET status='available' WHERE id = '$getID'")or die(mysql_error());
	echo "<script language=javascript>alert('Restore Complete');window.location='trash.php';</script>";
	die();
}
elseif ($getAction=='Delete Forever'){
	mysql_query("UPDATE product SET status='deleteforever',dateRemove='$date' WHERE id = '$getID'")or die(mysql_error());
	echo "<script language=javascript>alert('Delete Complete');window.location='trash.php';</script>";
	die();
}
else{
die();
}

?>
<?php 
include("../closeconnection.php");
?>