<?
$queryold = "SELECT * FROM office_transhistory WHERE CYCLE_NO=".$CYCLE_NO;
$cursorold = exequery ( TD::conn (), $queryold );
$data="{";
while ( $ROWOLD = mysql_fetch_array ( $cursorold ) )
{
$PRO_ID = $ROWOLD['PRO_ID'];
$FACT_QTY = $ROWOLD['FACT_QTY'];
//$data.="{"PRO_ID":"".$PRO_ID."","FACT_QTY":"".$FACT_QTY.""},";
$data.=""PRO_ID".$PRO_ID."":"".$FACT_QTY."",";
};
$data=substr($data,0,-1);
$data.="}";
?>
<div><textarea style="display:none;" id="oldapply"><?=$data;?></textarea></div>
var npid=this.getAttribute('data-np-id')
var proid="PRO_ID"+npid;
var oldstr= $("#oldapply").val();
var dataObj = eval("("+oldstr+")");
temval=parseInt(dataObj[proid]?dataObj[proid]:0);