<?
REQUIRE_ONCE('functions.php');
$user=$_SESSION['user'];
REQUIRE_ONCE('mysql.php');

$ip=get_client_ip();
$tiller=teller($ip);

		
 if ( (isset($_GET['id'])) &&
 (($_GET['id'])) ) {
$id = $_GET['id'];
} elseif ( (isset($_POST['id'])) &&
 (($_POST['id'])) ) {
$id = $_POST['id'];
}
if($id){
$r="select * from hold where  user='$user' and sessio='$id' and status='ACTIVE'";
$sql=mysqli_query($dbc,$r);
$n=mysqli_num_rows($sql);
if($n>0){
$t="select * from hold where sessio='$id'";
$tt=mysqli_query($dbc,$t);
while($row=mysqli_fetch_array($tt)){
$product[] = array('name'=>$row["product"], 'system'=>$row["system"],
					'qty'=>$row['qty'], 'price'=>$row["price"],'product_id'=>$row['product_id']);

}
$y="delete from hold where sessio='$id'";
$yy=mysqli_query($dbc,$y);
$_SESSION["products"] = $product;
}

}

header("location: tables.php");
?>