<?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());

$array_num = count($_POST['name']);


if(isset($_POST['submit'])){
	for ($i=0; $i <$array_num; $i++){
		foreach(array($i) as $num){
			$id = $_POST['id'][$num];
			$name = $_POST['name'][$num];
			$type = $_POST['type'][$num];
			$price = $_POST['price'][$num];
			$detail = $_POST['detail'][$num];

			
			$query=mysql_query("select * from product where id = '$id'")or die(mysql_error());

			if(isset($_POST['check'][$i])){
				mysql_query("UPDATE product SET status='remove' WHERE id = '$id'")or die(mysql_error());	
			}
		}
	}
}
echo "<script language=javascript>alert('Delete Complete');window.location='removeproduct.php';</script>";
die();
?>

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