<?php
    include'connection.php';
    
    $userid = $_GET['userid'];
	$token = $_GET['token'];
	
	$QuGetUser = "select * from retailer where Userid='$userid' and ApiToken='$token'";
	$ReGetUser = mysqli_query($con,$QuGetUser);
	$GetUser = mysqli_num_rows($ReGetUser);
	
	if($GetUser!==1)
	{    
		$myresponse = array("bal"=>"Invalid Userid Or API Token !");
		echo $myresult = json_encode($myresponse);
	}
	else
	{
	    $query8="select * from wallet where Userid='$userid' order by Id desc";
		$result8=mysqli_query($con,$query8);
		$data8=mysqli_fetch_array($result8);
		$currentbal= $data8['Balance'];
		
		$myresponse = array("bal"=>"$currentbal");
		echo $myresult = json_encode($myresponse);
	}

?>