<?php
 
	@$sqlr = mysqli_query($con ,"select * from dvredocl where codigo = '$ccp' and num_doc = '$nud'");
	@$rep=mysqli_fetch_array($sqlr);
	$nc = $rep['tot_not'] - $cat;
	$bus = mysqli_query($con ,"update dvredocl set tot_not = '$nc' where codigo = '$ccp' and num_doc = '$nud'");
	@$sqlr = mysqli_query($con ,"select * from dvredocl where codigo = '$ccp' and num_doc = '$nud'");
	@$rep=mysqli_fetch_array($sqlr);
	$cc = $rep['tot_doc'] - ($rep['tot_pag'] + $rep['tot_not']);
	$bus = mysqli_query($con ,"update dvredocl set tot_sal = '$cc' where codigo = '$ccp' and num_doc = '$nud'");
?>


