<?php
    include'connection.php';
    
    $userid = $_GET['usr'];
    
    $quGetEwalletId="select * from RetBal where Userid='$userid'";
    $reGetEwalletId=mysqli_query($con,$quGetEwalletId);
    $dataGetEwalletId=mysqli_fetch_array($reGetEwalletId);
    $EwalletId=$dataGetEwalletId['Walletid'];
    
    
    $queryNewBal="select * from wallet where Userid='$userid' and Id>=$EwalletId";
	$resultNewBal=mysqli_query($con,$queryNewBal);
	$newbal=0;
	while($dataNewBal=mysqli_fetch_array($resultNewBal))
	{
	    $Retbal= $dataNewBal['Txn'];
	    $newbal=$newbal+$Retbal;
	}
	$Bal = number_format($newbal, 2, '.', '');
	echo money_format('%n', $Bal);;
	
?>