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