<?php
include_once"../config.php";
$per = $_GET['per'];
$oldp = $_GET['oldp'];
$pid = $_GET['pid'];
$q = mysqli_query($con, "select percent from area where pid = '$pid' and status = 1");
$cou = 0;
while($r = mysqli_fetch_object($q)){
	$cou += $r->percent;
}
$cou =  $cou + $per;
if($oldp){$cou =  $cou - $oldp;}
echo $cou;