<?php
@session_start();
error_reporting(0);
include("config.php");

$newstock=$_POST[newstock];
$pid=$_POST[pid];
$oldstock=$_POST[oldstock];

/***********************************/
$mode = $_REQUEST[mode];
$flag = $_REQUEST[flag];
/***********************************/
$id=$_POST[id];
/***********************************/
	
$stockinv = $oldstock - $newstock;
$query_update=sprintf("UPDATE  product SET qty='%s' where id='%s' ",$stockinv,$pid); 
if(!($result=mysql_query($query_update))){echo $query_update.mysql_error(); exit;}
header("Location:product-list.php?flag=up");exit;
?>
